Commit 01f152a6 authored by Dirk Wildt's avatar Dirk Wildt
Browse files

0.0.1

parent 0bfa4142
Pipeline #93 failed with stages
<?php
if( TYPO3_MODE == 'BE' )
namespace Netzmacher\Startt3managed\Backend\Extensions;
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
/* * *************************************************************
* Copyright notice
*
* (c) 2019 - Dirk Wildt <http://wildt.at.die-netzmacher.de/>
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
* ************************************************************* */
/**
* @author Dirk Wildt <http://wildt.at.die-netzmacher.de>
* @package TYPO3
* @subpackage startt3managed
* @version 0.0.1
* @since 0.0.1
*/
class Backend
{
/* * ****************************************************************************
* Configure Backend Extension
* **************************************************************************** */
if( !is_array( $GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'startt3managed' ] ) )
/**
* @access public
* @return void
* @version 0.0.1
* @since 0.0.1
*/
static public function Style()
{
if( TYPO3_MODE != 'BE' )
{
return;
}
SELF::_ExtConfUnserialize();
if( SELF::_HostDisallowed() )
{
SELF::_ExtConfSerialize();
return;
}
SELF::_BackendStyle();
SELF::_BackendLogo();
SELF::_ExtConfSerialize();
}
/**
* @access private
* @return void
* @version 0.0.1
* @since 0.0.1
*/
static private function _BackendLogo()
{
$GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'startt3managed' ] = unserialize( $GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'startt3managed' ] );
$backendstyleDisabled = $GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'startt3managed' ][ 'backendstyleDisabled' ];
if( $backendstyleDisabled )
{
return;
}
$TYPO3_version = VersionNumberUtility::convertVersionNumberToInteger( TYPO3_version );
switch( TRUE )
{
case ( $TYPO3_version < 7006000 ):
$GLOBALS[ 'TBE_STYLES' ][ 'logo' ] = '../typo3conf/ext/startt3managed/Resources/Public/Images/Backend/startt3managed_backendLogo@2x.png';
$GLOBALS[ 'TBE_STYLES' ][ 'logo_login' ] = '../typo3conf/ext/startt3managed/Resources/Public/Images/Backend/startt3managed_loginLogo-v6.2.jpg';
break;
case ( $TYPO3_version < 8007000 ):
$GLOBALS[ 'TBE_STYLES' ][ 'logo' ] = '../typo3conf/ext/startt3managed/Resources/Public/Images/Backend/startt3managed_backendLogo@2x.png';
break;
default:
// Is done above;
break;
}
}
if( !$GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'startt3managed' ][ 'backendstyleDisabled' ] )
/**
* @access private
* @return void
* @version 0.0.1
* @since 0.0.1
*/
static private function _BackendStyle()
{
$backendstyleDisabled = $GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'startt3managed' ][ 'backendstyleDisabled' ];
if( $backendstyleDisabled )
{
return;
}
if( !is_array( $GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'backend' ] ) )
{
$GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'backend' ] = unserialize( $GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'backend' ] );
......@@ -22,35 +117,37 @@ if( TYPO3_MODE == 'BE' )
if( !isset( $GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'backend' ][ 'loginLogo' ] ) || empty( trim( $GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'backend' ][ 'loginLogo' ] ) )
)
{
$GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'backend' ][ 'loginLogo' ] = 'EXT:startt3managed/Resources/Public/Images/Backend/netzmacher_loginLogo.jpg';
$loginLogo = 'EXT:startt3managed/Resources/Public/Images/Backend/startt3managed_loginLogo.jpg';
$GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'backend' ][ 'loginLogo' ] = $loginLogo;
}
// Login Background
if( !isset( $GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'backend' ][ 'loginBackgroundImage' ] ) || empty( trim( $GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'backend' ][ 'loginBackgroundImage' ] ) )
)
{
$GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'backend' ][ 'loginBackgroundImage' ] = 'EXT:startt3managed/Resources/Public/Images/Backend/typo3_die-netzmacher.jpg';
$GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'backend' ][ 'loginBackgroundImage' ] = 'EXT:startt3managed/Resources/Public/Images/Backend/startt3managed_loginBackgroundImage.jpg';
}
// Backend Logo
if( !isset( $GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'backend' ][ 'backendLogo' ] ) || empty( trim( $GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'backend' ][ 'backendLogo' ] ) )
)
{
$GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'backend' ][ 'backendLogo' ] = 'EXT:startt3managed/Resources/Public/Images/Backend/netzmacher_backendLogo.svg';
$backendLogo = 'EXT:startt3managed/Resources/Public/Images/Backend/startt3managed_backendLogo@2x.png';
$GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'backend' ][ 'backendLogo' ] = $backendLogo;
}
// Favicon
if( !isset( $GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'backend' ][ 'backendFavicon' ] ) || empty( trim( $GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'backend' ][ 'backendFavicon' ] ) )
)
{
$GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'backend' ][ 'backendFavicon' ] = 'EXT:startt3managed/Resources/Public/Images/die-netzmacher.ico';
$GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'backend' ][ 'backendFavicon' ] = 'EXT:startt3managed/Resources/Public/Images/Backend/startt3managed.ico';
}
// loginHighlightColor
if( !isset( $GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'backend' ][ 'loginHighlightColor' ] ) || empty( trim( $GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'backend' ][ 'loginHighlightColor' ] ) )
)
{
$GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'backend' ][ 'loginHighlightColor' ] = '#FF7700';
$GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'backend' ][ 'loginHighlightColor' ] = '#FE5E00';
}
if( is_array( $GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'backend' ] ) )
......@@ -59,8 +156,60 @@ if( TYPO3_MODE == 'BE' )
}
}
if( is_array( $GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'startt3managed' ] ) )
/**
* @access private
* @return void
* @version 0.0.1
* @since 0.0.1
*/
static private function _ExtConfSerialize()
{
if( is_array( $GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'startt3managed' ] ) )
{
$GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'startt3managed' ] = serialize( $GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'startt3managed' ] );
}
}
/**
* @access private
* @return void
* @version 0.0.1
* @since 0.0.1
*/
static private function _ExtConfUnserialize()
{
$GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'startt3managed' ] = serialize( $GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'startt3managed' ] );
if( !is_array( $GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'startt3managed' ] ) )
{
$GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'startt3managed' ] = unserialize( $GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'startt3managed' ] );
}
}
}
\ No newline at end of file
/**
* @access private
* @return boolean
* @version 0.0.1
* @since 0.0.1
*/
static private function _HostDisallowed()
{
$backendstyleHosts = $GLOBALS[ 'TYPO3_CONF_VARS' ][ 'EXT' ][ 'extConf' ][ 'startt3managed' ][ 'backendstyleHosts' ];
// Any host isn't set, all hosts are allowed
if( empty( $backendstyleHosts ) )
{
return FALSE;
}
$backendstyleHosts = str_replace( ' ', NULL, $backendstyleHosts );
$arrBackendstyleHosts = explode( ',', $backendstyleHosts );
// Current host is in the list of allowed hosts
if( in_array( $_SERVER[ 'SERVER_NAME' ], $arrBackendstyleHosts ) )
{
return FALSE;
}
// Current host isn't in the list of allowed hosts
return TRUE;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<svg width="30pt" version="1.1" xmlns="http://www.w3.org/2000/svg" height="30pt" viewBox="0 0 30 30" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<clipPath id="Clip0">
<path d="M0 0 L27.9999 0 L27.9999 28.0018 L0 28.0018 L0 0 Z" transform="translate(1, 0.998276)"/>
</clipPath>
</defs>
<g id="Neue Ebene 1">
<g id="Gruppe11" clip-path="url(#Clip0)">
<path style="fill:#ffffff; fill-rule:evenodd;stroke:#ff8c00; stroke-width:0.061601; stroke-linecap:butt; stroke-linejoin:miter; stroke-dasharray:none;" d="M0 0 L5.23849 0 L5.23849 1.74654 L0 1.74654 L0 0 Z" transform="translate(1.0308, 16.7444)"/>
<path style="fill:#ffffff; fill-rule:evenodd;stroke:#ff8c00; stroke-width:0.061601; stroke-linecap:butt; stroke-linejoin:miter; stroke-dasharray:none;" d="M0 0 L1.74658 0 L1.74658 5.23847 L0 5.23847 L0 0 Z" transform="translate(1.0308, 16.7444)"/>
<path style="fill:#ffffff; fill-rule:evenodd;stroke:#ff8c00; stroke-width:0.061601; stroke-linecap:butt; stroke-linejoin:miter; stroke-dasharray:none;" d="M0 0 L1.74658 0 L1.74658 3.49204 L0 3.49204 L0 0 Z" transform="translate(4.52314, 23.7295)"/>
<path style="fill:#ffffff; fill-rule:evenodd;stroke:#ff8c00; stroke-width:0.061601; stroke-linecap:butt; stroke-linejoin:miter; stroke-dasharray:none;" d="M0 0 L3.49315 0 L3.49315 1.74617 L0 1.74617 L0 0 Z" transform="translate(6.26849, 18.491)"/>
<path style="fill:#ffffff; fill-rule:evenodd;stroke:#ff8c00; stroke-width:0.061601; stroke-linecap:butt; stroke-linejoin:miter; stroke-dasharray:none;" d="M0 0 L1.74658 0 L1.74658 1.74654 L0 1.74654 L0 0 Z" transform="translate(2.77656, 21.9829)"/>
<path style="fill:#ffffff; fill-rule:evenodd;stroke:#ff8c00; stroke-width:0.061601; stroke-linecap:butt; stroke-linejoin:miter; stroke-dasharray:none;" d="M0 0 L1.74658 0 L1.74658 1.74699 L0 1.74699 L0 0 Z" transform="translate(6.26849, 27.2223)"/>
<path style="fill:#ffffff; fill-rule:evenodd;stroke:#ff8c00; stroke-width:0.061601; stroke-linecap:butt; stroke-linejoin:miter; stroke-dasharray:none;" d="M0 0 L1.74617 0 L1.74617 1.74654 L0 1.74654 L0 0 Z" transform="translate(27.2229, 14.9979)"/>
<path style="fill:#ffffff; fill-rule:evenodd;stroke:#ff8c00; stroke-width:0.061601; stroke-linecap:butt; stroke-linejoin:miter; stroke-dasharray:none;" d="M0 0 L3.49193 0 L3.49193 1.74535 L0 1.74535 L0 0 Z" transform="translate(23.7306, 13.2526)"/>
<path style="fill:#ffffff; fill-rule:evenodd;stroke:#ff8c00; stroke-width:0.061601; stroke-linecap:butt; stroke-linejoin:miter; stroke-dasharray:none;" d="M0 0 L1.74617 0 L1.74617 6.98501 L0 6.98501 L0 0 Z" transform="translate(23.7306, 13.2526)"/>
<path style="fill:#ffffff; fill-rule:evenodd;stroke:#ff8c00; stroke-width:0.061601; stroke-linecap:butt; stroke-linejoin:miter; stroke-dasharray:none;" d="M0 0 L5.23849 0 L5.23849 1.74658 L0 1.74658 L0 0 Z" transform="translate(18.4913, 11.506)"/>
<path style="fill:#ffffff; fill-rule:evenodd;stroke:#ff8c00; stroke-width:0.061601; stroke-linecap:butt; stroke-linejoin:miter; stroke-dasharray:none;" d="M0 0 L5.23891 0 L5.23891 1.74535 L0 1.74535 L0 0 Z" transform="translate(13.2536, 9.76062)"/>
<path style="fill:#ffffff; fill-rule:evenodd;stroke:#ff8c00; stroke-width:0.061601; stroke-linecap:butt; stroke-linejoin:miter; stroke-dasharray:none;" d="M0 0 L1.74576 0 L1.74576 6.98501 L0 6.98501 L0 0 Z" transform="translate(18.4913, 11.506)"/>
<path style="fill:#ffffff; fill-rule:evenodd;stroke:#ff8c00; stroke-width:0.061601; stroke-linecap:butt; stroke-linejoin:miter; stroke-dasharray:none;" d="M0 0 L1.74658 0 L1.74658 15.7154 L0 15.7154 L0 0 Z" transform="translate(13.2536, 2.77562)"/>
<path style="fill:#ffffff; fill-rule:evenodd;stroke:#ff8c00; stroke-width:0.061601; stroke-linecap:butt; stroke-linejoin:miter; stroke-dasharray:none;" d="M0 0 L1.74658 0 L1.74658 20.9539 L0 20.9539 L0 0 Z" transform="translate(8.01507, 2.77562)"/>
<path style="fill:#ffffff; fill-rule:evenodd;stroke:#ff8c00; stroke-width:0.061601; stroke-linecap:butt; stroke-linejoin:miter; stroke-dasharray:none;" d="M0 0 L3.49315 0 L3.49315 1.74617 L0 1.74617 L0 0 Z" transform="translate(9.76165, 1.02908)"/>
</g>
</g>
</svg>
# cat=Backend style//100; type=boolean; label= Disable:Disable the Corporate Design of TYPO3 GRÜNE at backend login.
backendstyleDisabled = 0
\ No newline at end of file
# cat=Backend style//100; type=boolean; label= Disable:Disable the Corporate Design of TYPO3 GRÜNE at backend login.
backendstyleDisabled = 0
# cat=Backend style//101; type=string; label= Hosts:Limited for hosts (csv-list). If empty: backend style is enabled on all hosts. Example for limiting: myhost.de, myotherhost.com
backendstyleHosts =
......@@ -5,4 +5,4 @@ if ( !defined( 'TYPO3_MODE' ) )
die( 'Access denied.' );
}
require_once( PATH_typo3conf . 'ext/startt3managed/Configuration/ExtTables/Extensions/Backend.php' );
\ No newline at end of file
\Netzmacher\Startt3managed\Backend\Extensions\Backend::Style();
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment