diff --git a/system/modules/BackendCustomStartpage/BackendCustomStartpageHook.php b/system/modules/BackendCustomStartpage/classes/BackendCustomStartpageHooksImpl.php similarity index 69% rename from system/modules/BackendCustomStartpage/BackendCustomStartpageHook.php rename to system/modules/BackendCustomStartpage/classes/BackendCustomStartpageHooksImpl.php index 4c06995..23f7b26 100644 --- a/system/modules/BackendCustomStartpage/BackendCustomStartpageHook.php +++ b/system/modules/BackendCustomStartpage/classes/BackendCustomStartpageHooksImpl.php @@ -2,7 +2,7 @@ /** * Contao Open Source CMS - * Copyright (C) 2005-2014 Leo Feyer + * Copyright (C) 2005-2015 Leo Feyer * * Formerly known as TYPOlight Open Source CMS. * @@ -21,28 +21,33 @@ * Software Foundation website at . * * PHP version 5 - * @copyright Cliff Parnitzky 2014 + * @copyright Cliff Parnitzky 2014-2015 * @author Cliff Parnitzky * @package BackendCustomStartpage * @license LGPL */ /** - * Class BackendCustomStartpageHook + * Run in a custom namespace, so the class can be replaced + */ +namespace CliffParnitzky; + +/** + * Class BackendCustomStartpageHooksImpl * * Special hook implementation for redirect to the custom startpage - * @copyright Cliff Parnitzky 2014 + * @copyright Cliff Parnitzky 2014-2015 * @author Cliff Parnitzky * @package Controller */ -class BackendCustomStartpageHook extends Backend +class BackendCustomStartpageHooksImpl extends \Backend { /** * Execute postLogin hook to redirect to the custom startpage */ - public function redirectToCustomStartpage (User $objUser) + public function redirectToCustomStartpage (\User $objUser) { - if ($objUser instanceof BackendUser && (strlen($objUser->backendCustomStartpage) > 0) && $objUser->hasAccess($objUser->backendCustomStartpage, 'modules')) + if ($objUser instanceof \BackendUser && (strlen($objUser->backendCustomStartpage) > 0) && $objUser->hasAccess($objUser->backendCustomStartpage, 'modules')) { $this->redirect('contao/main.php?do=' . $objUser->backendCustomStartpage); } diff --git a/system/modules/BackendCustomStartpage/config/autoload.php b/system/modules/BackendCustomStartpage/config/autoload.php index 3e95070..22fdcb6 100644 --- a/system/modules/BackendCustomStartpage/config/autoload.php +++ b/system/modules/BackendCustomStartpage/config/autoload.php @@ -3,18 +3,26 @@ /** * Contao Open Source CMS * - * Copyright (c) 2005-2014 Leo Feyer + * Copyright (c) 2005-2015 Leo Feyer * - * @package BackendCustomStartpage - * @link https://contao.org - * @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL + * @license LGPL-3.0+ */ +/** + * Register the namespaces + */ +ClassLoader::addNamespaces(array +( + 'CliffParnitzky', +)); + + /** * Register the classes */ ClassLoader::addClasses(array ( - 'BackendCustomStartpageHook' => 'system/modules/BackendCustomStartpage/BackendCustomStartpageHook.php', + // Classes + 'CliffParnitzky\BackendCustomStartpageHooksImpl' => 'system/modules/BackendCustomStartpage/classes/BackendCustomStartpageHooksImpl.php', )); diff --git a/system/modules/BackendCustomStartpage/config/config.php b/system/modules/BackendCustomStartpage/config/config.php index a280fce..1f01f15 100644 --- a/system/modules/BackendCustomStartpage/config/config.php +++ b/system/modules/BackendCustomStartpage/config/config.php @@ -2,7 +2,7 @@ /** * Contao Open Source CMS - * Copyright (C) 2005-2014 Leo Feyer + * Copyright (C) 2005-2015 Leo Feyer * * Formerly known as TYPOlight Open Source CMS. * @@ -21,7 +21,7 @@ * Software Foundation website at . * * PHP version 5 - * @copyright Cliff Parnitzky 2014 + * @copyright Cliff Parnitzky 2014-2015 * @author Cliff Parnitzky * @package BackendCustomStartpage * @license LGPL @@ -30,7 +30,6 @@ /** * Hooks */ -// Set monitoring as start page -$GLOBALS['TL_HOOKS']['postLogin'][] = array('BackendCustomStartpageHook', 'redirectToCustomStartpage'); +$GLOBALS['TL_HOOKS']['postLogin'][] = array('CliffParnitzky\BackendCustomStartpageHooksImpl', 'redirectToCustomStartpage'); ?> \ No newline at end of file diff --git a/system/modules/BackendCustomStartpage/config/database.sql b/system/modules/BackendCustomStartpage/config/database.sql deleted file mode 100644 index 67f052e..0000000 --- a/system/modules/BackendCustomStartpage/config/database.sql +++ /dev/null @@ -1,16 +0,0 @@ --- ******************************************************** --- * * --- * IMPORTANT NOTE * --- * * --- * Do not import this file manually but use the Contao * --- * install tool to create and maintain database tables! * --- * * --- ******************************************************** - --- --- Table `tl_user` --- - -CREATE TABLE `tl_user` ( - `backendCustomStartpage` varchar(255) NOT NULL default '' -) ENGINE=MyISAM DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/system/modules/BackendCustomStartpage/dca/tl_user.php b/system/modules/BackendCustomStartpage/dca/tl_user.php index 87e57f9..2768b97 100644 --- a/system/modules/BackendCustomStartpage/dca/tl_user.php +++ b/system/modules/BackendCustomStartpage/dca/tl_user.php @@ -2,7 +2,7 @@ /** * Contao Open Source CMS - * Copyright (C) 2005-2014 Leo Feyer + * Copyright (C) 2005-2015 Leo Feyer * * Formerly known as TYPOlight Open Source CMS. * @@ -21,7 +21,7 @@ * Software Foundation website at . * * PHP version 5 - * @copyright Cliff Parnitzky 2014 + * @copyright Cliff Parnitzky 2014-2015 * @author Cliff Parnitzky * @package BackendCustomStartpage * @license LGPL @@ -42,7 +42,8 @@ 'inputType' => 'select', 'options_callback' => array('tl_user_customStartPage', 'getBackendModules'), 'reference' => &$GLOBALS['TL_LANG']['MOD'], - 'eval' => array('tl_class'=>'w50', 'includeBlankOption'=>true) + 'eval' => array('tl_class'=>'w50', 'includeBlankOption'=>true), + 'sql' => "varchar(255) NOT NULL default ''" ); @@ -50,7 +51,7 @@ * Class tl_user_customStartPage * * Provide miscellaneous methods that are used by the data configuration array. - * @copyright Cliff Parnitzky 2014 + * @copyright Cliff Parnitzky 2014-2015 * @author Cliff Parnitzky * @package Controller */ diff --git a/system/modules/BackendCustomStartpage/languages/de/modules.php b/system/modules/BackendCustomStartpage/languages/de/modules.php index c328496..5694dee 100644 --- a/system/modules/BackendCustomStartpage/languages/de/modules.php +++ b/system/modules/BackendCustomStartpage/languages/de/modules.php @@ -2,7 +2,7 @@ /** * Contao Open Source CMS - * Copyright (C) 2005-2014 Leo Feyer + * Copyright (C) 2005-2015 Leo Feyer * * Formerly known as TYPOlight Open Source CMS. * @@ -21,7 +21,7 @@ * Software Foundation website at . * * PHP version 5 - * @copyright Cliff Parnitzky 2014 + * @copyright Cliff Parnitzky 2014-2015 * @author Cliff Parnitzky * @package BackendCustomStartpage * @license LGPL diff --git a/system/modules/BackendCustomStartpage/languages/de/tl_user.php b/system/modules/BackendCustomStartpage/languages/de/tl_user.php index c0e281c..9991800 100644 --- a/system/modules/BackendCustomStartpage/languages/de/tl_user.php +++ b/system/modules/BackendCustomStartpage/languages/de/tl_user.php @@ -2,7 +2,7 @@ /** * Contao Open Source CMS - * Copyright (C) 2005-2014 Leo Feyer + * Copyright (C) 2005-2015 Leo Feyer * * Formerly known as TYPOlight Open Source CMS. * @@ -21,7 +21,7 @@ * Software Foundation website at . * * PHP version 5 - * @copyright Cliff Parnitzky 2014 + * @copyright Cliff Parnitzky 2014-2015 * @author Cliff Parnitzky * @package BackendCustomStartpage * @license LGPL diff --git a/system/modules/BackendCustomStartpage/languages/en/modules.php b/system/modules/BackendCustomStartpage/languages/en/modules.php index a2e112d..d41d20e 100644 --- a/system/modules/BackendCustomStartpage/languages/en/modules.php +++ b/system/modules/BackendCustomStartpage/languages/en/modules.php @@ -2,7 +2,7 @@ /** * Contao Open Source CMS - * Copyright (C) 2005-2014 Leo Feyer + * Copyright (C) 2005-2015 Leo Feyer * * Formerly known as TYPOlight Open Source CMS. * @@ -21,7 +21,7 @@ * Software Foundation website at . * * PHP version 5 - * @copyright Cliff Parnitzky 2014 + * @copyright Cliff Parnitzky 2014-2015 * @author Cliff Parnitzky * @package BackendCustomStartpage * @license LGPL diff --git a/system/modules/BackendCustomStartpage/languages/en/tl_user.php b/system/modules/BackendCustomStartpage/languages/en/tl_user.php index 9485dd9..f38fa96 100644 --- a/system/modules/BackendCustomStartpage/languages/en/tl_user.php +++ b/system/modules/BackendCustomStartpage/languages/en/tl_user.php @@ -2,7 +2,7 @@ /** * Contao Open Source CMS - * Copyright (C) 2005-2014 Leo Feyer + * Copyright (C) 2005-2015 Leo Feyer * * Formerly known as TYPOlight Open Source CMS. * @@ -21,7 +21,7 @@ * Software Foundation website at . * * PHP version 5 - * @copyright Cliff Parnitzky 2014 + * @copyright Cliff Parnitzky 2014-2015 * @author Cliff Parnitzky * @package BackendCustomStartpage * @license LGPL