Exemplo n.º 1
0
 public static function init()
 {
     // Register namespace
     Autoloader::registerNamespace('CustomTabs', __DIR__);
     // Add routes
     Router::add('/admin/custom_tabs', 'CustomTabs::controllers::admin::CustomTabs.index');
     Router::add('/admin/custom_tabs/new', 'CustomTabs::controllers::admin::CustomTabs.new');
     Router::add('/admin/custom_tabs/([0-9]+)/(edit|delete)', 'CustomTabs::controllers::admin::CustomTabs.$2/$1');
     // Hook into the admin navbar
     FishHook::add('template:layouts/admin/main_nav', array(get_called_class(), 'admin_nav'));
     // Get tabs
     static::$tabs = CustomTab::fetch_all();
     View::set('custom_tabs', static::$tabs);
     // Hook into navbar
     FishHook::add('template:layouts/default/main_nav', array(get_called_class(), 'display_tabs'));
 }
Exemplo n.º 2
0
 public static function init()
 {
     // Register namespace
     Autoloader::registerNamespace('SecurityQuestions', __DIR__);
     // Add routes
     Router::add('/admin/settings/security_questions', 'SecurityQuestions::controllers::Questions.index');
     Router::add('/admin/settings/security_questions/new_question', 'SecurityQuestions::controllers::Questions.new_question');
     // Hook into the settings navbar
     FishHook::add('template:admin/settings/_nav', array(get_called_class(), 'admin_nav'));
     // Hook into register form
     FishHook::add('template:users/register', array(get_called_class(), 'question_field'));
     // Hook into the register action
     FishHook::add('controller:users.register', array(get_called_class(), 'check_answer'));
     // Allow other plugins to use this plugin
     FishHook::add('use:plugins:security_questions.question_field', array(get_called_class(), 'question_field'));
     FishHook::add('use:plugins:security_questions.check_answer', array(get_called_class(), 'check_answer'));
 }