Skip to content

Commit

Permalink
Reorder file and folder structure, remove Contao 2.x stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
cliffparnitzky committed Oct 20, 2015
1 parent b70f005 commit b76c493
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -21,28 +21,33 @@
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* 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);
}
Expand Down
18 changes: 13 additions & 5 deletions system/modules/BackendCustomStartpage/config/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
));
7 changes: 3 additions & 4 deletions system/modules/BackendCustomStartpage/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -21,7 +21,7 @@
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright Cliff Parnitzky 2014
* @copyright Cliff Parnitzky 2014-2015
* @author Cliff Parnitzky
* @package BackendCustomStartpage
* @license LGPL
Expand All @@ -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');

?>
16 changes: 0 additions & 16 deletions system/modules/BackendCustomStartpage/config/database.sql

This file was deleted.

9 changes: 5 additions & 4 deletions system/modules/BackendCustomStartpage/dca/tl_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -21,7 +21,7 @@
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright Cliff Parnitzky 2014
* @copyright Cliff Parnitzky 2014-2015
* @author Cliff Parnitzky
* @package BackendCustomStartpage
* @license LGPL
Expand All @@ -42,15 +42,16 @@
'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 ''"
);


/**
* 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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -21,7 +21,7 @@
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright Cliff Parnitzky 2014
* @copyright Cliff Parnitzky 2014-2015
* @author Cliff Parnitzky
* @package BackendCustomStartpage
* @license LGPL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -21,7 +21,7 @@
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright Cliff Parnitzky 2014
* @copyright Cliff Parnitzky 2014-2015
* @author Cliff Parnitzky
* @package BackendCustomStartpage
* @license LGPL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -21,7 +21,7 @@
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright Cliff Parnitzky 2014
* @copyright Cliff Parnitzky 2014-2015
* @author Cliff Parnitzky
* @package BackendCustomStartpage
* @license LGPL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -21,7 +21,7 @@
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright Cliff Parnitzky 2014
* @copyright Cliff Parnitzky 2014-2015
* @author Cliff Parnitzky
* @package BackendCustomStartpage
* @license LGPL
Expand Down

0 comments on commit b76c493

Please sign in to comment.