diff --git a/controllers/class.yagasettingscontroller.php b/controllers/class.yagasettingscontroller.php deleted file mode 100755 index 8acb728..0000000 --- a/controllers/class.yagasettingscontroller.php +++ /dev/null @@ -1,50 +0,0 @@ -Application = 'Yaga'; - Gdn_Theme::Section('Dashboard'); - if ($this->Menu) { - $this->Menu->HighlightRoute('/yagasettings'); - } - //$this->AddJsFile('yaga.js'); - $this->AddCssFile('yaga.css'); - } - - /** - * A simple configuration page for the Yaga Application - */ - public function Index() { - $this->Permission('Garden.Settings.Manage'); - - $ConfigModule = new ConfigurationModule($this); - - $ConfigModule->Initialize(array( - 'Yaga.Reactions.Enabled' => array('LabelCode' => 'Use Reactions', 'Control' => 'Checkbox'), - 'Yaga.Badges.Enabled' => array('LabelCode' => 'Use Badges', 'Control' => 'Checkbox'), - 'Yaga.Ranks.Enabled' => array('LabelCode' => 'Use Ranks', 'Control' => 'Checkbox'), - 'Yaga.LeaderBoard.Enabled' => array('LabelCode' => 'Show leaderboard on activity page', 'Control' => 'Checkbox'), - 'Yaga.LeaderBoard.Limit' => array('LabelCode' => 'Maximum number of leaders to show', 'Control' => 'Textbox', 'Options' => array('Size' => 45, 'class' => 'SmallInput')) - )); - $this->AddSideMenu('yagasettings'); - $this->Title(T('Yaga.Settings')); - $this->ConfigurationModule = $ConfigModule; - - $ConfigModule->RenderAll(); - } -} diff --git a/settings/about.php b/settings/about.php index c145503..c7670e5 100755 --- a/settings/about.php +++ b/settings/about.php @@ -8,7 +8,7 @@ $ApplicationInfo['Yaga'] = array( 'AuthorEmail' => 'hgtonight@daklutz.com', 'AuthorUrl' => 'http://www.daklutz.com', 'License' => 'GPLv3', - 'SettingsUrl' => '/yagasettings', + 'SettingsUrl' => '/settings/yaga', // Application requirements 'RequiredApplications' => array('Vanilla' => '2.1b2'), diff --git a/settings/class.hooks.php b/settings/class.hooks.php index c4981a6..bb5ed02 100755 --- a/settings/class.hooks.php +++ b/settings/class.hooks.php @@ -7,6 +7,57 @@ */ class YagaHooks implements Gdn_IPlugin { + /** + * This handles all the core settings for the gamification application. + * + * @param SettingsController $Sender + */ + public function SettingsController_Yaga_Create($Sender) { + $Sender->Application = 'Yaga'; + Gdn_Theme::Section('Dashboard'); + if ($Sender->Menu) { + $Sender->Menu->HighlightRoute('/settings/yaga'); + } + //$Sender->AddJsFile('yaga.js'); + $Sender->AddCssFile('yaga.css'); + + $Sender->Permission('Garden.Settings.Manage'); + + $ConfigModule = new ConfigurationModule($Sender); + + $ConfigModule->Initialize(array( + 'Yaga.Reactions.Enabled' => array( + 'LabelCode' => 'Use Reactions', + 'Control' => 'Checkbox' + ), + 'Yaga.Badges.Enabled' => array( + 'LabelCode' => 'Use Badges', + 'Control' => 'Checkbox' + ), + 'Yaga.Ranks.Enabled' => array( + 'LabelCode' => 'Use Ranks', + 'Control' => 'Checkbox' + ), + 'Yaga.LeaderBoard.Enabled' => array( + 'LabelCode' => 'Show leaderboard on activity page', + 'Control' => 'Checkbox' + ), + 'Yaga.LeaderBoard.Limit' => array( + 'LabelCode' => 'Maximum number of leaders to show', + 'Control' => 'Textbox', + 'Options' => array( + 'Size' => 45, + 'class' => 'SmallInput' + ) + ) + )); + $Sender->AddSideMenu('settings/yaga'); + $Sender->Title(T('Yaga.Settings')); + $Sender->ConfigurationModule = $ConfigModule; + + $ConfigModule->RenderAll(); + } + /** * Add the settings page links * @@ -17,7 +68,7 @@ class YagaHooks implements Gdn_IPlugin { $Section = 'Gamification'; $Attrs = array('class' => $Section); $Menu->AddItem($Section, $Section, FALSE, $Attrs); - $Menu->AddLink($Section, T('Settings'), 'yagasettings', 'Garden.Settings.Manage'); + $Menu->AddLink($Section, T('Settings'), 'settings/yaga', 'Garden.Settings.Manage'); if(C('Yaga.Reactions.Enabled')) { $Menu->AddLink($Section, T('Yaga.Reactions'), 'action/settings', 'Yaga.Reactions.Manage'); }