/**
  * Initialize module.
  */
 public function init()
 {
     parent::init();
     $this->registerRoute('app_params/:domain', 'AppParamsController')->get()->put()->where(':domain', "[_a-zA-Z0-9]+");
     $this->registerRoute('app_params/:domain/:section/:varname', 'AppParamsController')->put()->where(':domain', "[_a-zA-Z0-9]+")->where(':domain', "[_a-zA-Z0-9]+")->where(':varname', "[_a-zA-Z0-9]+");
     // Main menu entries
     $menu = new MainMenuItem('app params', 'app-params', 'app_params', 'put_app_params', 'fa-gears');
     // Initialize parameters domains
     $this->initDomains($menu);
     MainMenu::instance()->add($menu, 5);
 }
Exemple #2
0
 /**
  *
  */
 public function init()
 {
     parent::init();
     /**
      * Routes
      */
     $this->registerRoute("/sb2/dashboard", 'Sb2DashboardController')->get();
     $this->registerRoute("/sb2/charts/flot", 'Sb2FlotChartsController')->get();
     $this->registerRoute("/sb2/charts/morris", 'Sb2MorrisChartsController')->get();
     $this->registerRoute("/sb2/tables", 'Sb2TablesController')->get();
     $this->registerRoute("/sb2/forms", 'Sb2FormsController')->get();
     $this->registerRoute("/sb2/panels-wells", 'Sb2PanelsWellsController')->get();
     $this->registerRoute("/sb2/buttons", 'Sb2ButtonsController')->get();
     $this->registerRoute("/sb2/notifications", 'Sb2NotificationsController')->get();
     $this->registerRoute("/sb2/typography", 'Sb2TypographyController')->get();
     $this->registerRoute("/sb2/icons", 'Sb2IconsController')->get();
     $this->registerRoute("/sb2/grid", 'Sb2GridController')->get();
     $this->registerRoute("/sb2/blank", 'Sb2BlankController')->get();
     /**
      * Add the menu options.
      * So, the menu is created dynamically based on the options declared in each module's init() method. 
      * This enforces plug-and-play functionality and module re-usability. 
      */
     // Dashboard
     $menu = new MainMenuItem('Dashboard', 'dashboard', '/sb2/dashboard', 0, 'fa-dashboard');
     MainMenu::instance()->add($menu, 0);
     // Charts
     MainMenu::instance()->add((new MainMenuItem('Charts', 'dashboard', '#', 0, 'fa-bar-chart-o'))->add(new MainMenuItem('Flot Charts', 'flot-charts', '/sb2/charts/flot', 0, 'fa-pie-chart'))->add(new MainMenuItem('Morris Charts', 'morris-charts', '/sb2/charts/morris', 0, 'fa-area-chart')));
     // Tables
     MainMenu::instance()->add(new MainMenuItem('Tables', 'tables', '/sb2/tables', 0, 'fa-table'));
     // Forms
     MainMenu::instance()->add(new MainMenuItem('Forms', 'forms', '/sb2/forms', 0, 'fa-edit'));
     // UI Elements
     MainMenu::instance()->add((new MainMenuItem('UI Elements', 'uielements', '#', 0, 'fa-wrench'))->add(new MainMenuItem('Panels and Wells', 'panels-wells', '/sb2/panels-wells', 0, 'fa-square-o'))->add(new MainMenuItem('Buttons', 'buttons', '/sb2/buttons', 0, 'fa-square'))->add(new MainMenuItem('Notifications', 'notifications', '/sb2/notifications', 0, 'fa-comment'))->add(new MainMenuItem('Typography', 'typography', '/sb2/typography', 0, 'fa-font'))->add(new MainMenuItem('Icons', 'icons', '/sb2/icons', 0, 'fa-image'))->add(new MainMenuItem('Grid', 'grid', '/sb2/grid', 0, 'fa-bars')));
     // Sample pages
     MainMenu::instance()->add((new MainMenuItem('Sample Pages', 'sample-pages', '#', 0, 'fa-files-o'))->add(new MainMenuItem('Blank page', 'blank-page', '/sb2/blank', 0, 'fa-file-o')));
     // Three level menu
     MainMenu::instance()->add((new MainMenuItem('Three levels menu', 'threelevelsmenu', '#', 0, 'fa-sitemap'))->add(new MainMenuItem('Second level item 1', 'second-level-item1', '#', 0, ''))->add((new MainMenuItem('Second level item 2', 'second-level-item2', '#', 0, ''))->add(new MainMenuItem('Third level item 1', 'third-level-item1', '#', 0, ''))->add(new MainMenuItem('Third level item 2', 'third-level-item2', '#', 0, ''))->add(new MainMenuItem('Third level item 3', 'third-level-item3', '#', 0, ''))));
 }
 /**
  * This method sets up an admin environment based on Star Bootstrap Adim 2:
  *		https://github.com/IronSummitMedia/startbootstrap-sb-admin-2
  */
 protected function setupAdminHttpResponse()
 {
     // Common components
     $this->components(array('navbar-header', 'navbar-top', 'side-menu', 'breadcrumbs'));
     // Common data
     $this->view->data(array('mainMenu' => MainMenu::instance()->request($this->app->request()), 'url_home' => $this->view->http()->url('/'), 'url_login' => $this->view->http()->url('/login'), 'url_logout' => $this->view->http()->url('/logout')));
 }