From e1bd322726089de5cef52fb6ff26c386df2b8b1f Mon Sep 17 00:00:00 2001 From: Myles Beardsmore Date: Wed, 27 Jan 2016 11:52:31 +1300 Subject: [PATCH] PSR-2 updates --- code/DevTasks.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/code/DevTasks.php b/code/DevTasks.php index c327977..e6697db 100644 --- a/code/DevTasks.php +++ b/code/DevTasks.php @@ -6,10 +6,14 @@ * @package DevTasks * */ -class DevTasks extends LeftAndMainExtension implements PermissionProvider { - public function init() { +class DevTasks extends LeftAndMainExtension implements PermissionProvider +{ + + public function init() + { parent::init(); - if(!Permission::check("VIEW_DEVTASKS")) return; + + if (!Permission::check("VIEW_DEVTASKS")) return; $tasks = array( 'devbuild' => array( @@ -20,6 +24,7 @@ public function init() { ); $config_tasks = Config::inst()->get(__CLASS__, 'tasks'); + if (is_array($config_tasks)) { $tasks = array_merge($tasks, $config_tasks); } @@ -36,13 +41,19 @@ public function init() { // priority controls the ordering of the link in the stack. The // lower the number, the lower in the list $priority = -90; + CMSMenu::add_link($item, '', '#', $priority, $attributes); + } } - public function providePermissions() { + public function providePermissions() + { return array( "VIEW_DEVTASKS" => "Access dev task menu", ); } + } + +?>