Exporting add-ons, database migration, test-suites and other add-ons have developed User Interface which can be simply "attached" to your application's admin. This is done through hooks in the Admin Class. It's also important that App_Admin relies on layout_fluid which makes it easier for add-ons to add menu items, sidebars and foot-bars.
Inheritance: extends App_Frontend
Example #1
0
 public function init()
 {
     parent::init();
     /*
     
     $this->api->pathfinder
         ->addLocation(array(
             'addons' => array('addons', 'vendor'),
         ))
         ->setBasePath($this->pathfinder->base_location->getPath() . '/..')
     ;
     */
     $this->template['css'] = 'compact.css';
     $this->dbConnect();
     $this->api->menu->addItem(['Dashboard', 'icon' => 'home'], '/');
     $this->api->menu->addItem(['Users', 'icon' => 'users'], 'users');
     $this->api->menu->addItem(['Keys', 'icon' => 'key'], 'keychain');
     $this->add('dokku_alt/Initiator');
     $auth = $this->add('Auth');
     $user = $auth->setModel('User');
     $auth->usePasswordEncryption();
     if ((string) $user->count() > 0) {
         $auth->check();
     } else {
         $this->layout->add('View_Error')->set('No user accounts found. Please define them before continuing.');
     }
 }
Example #2
0
 function init()
 {
     parent::init();
     $this->dbConnect();
     $a = $this->add('Auth');
     $a->setModel('Admin');
     $a->check();
     $this->api->menu->addItem('Manage Widgets', 'widgets');
     $this->api->menu->addItem('Manage Access', 'access');
     $this->api->menu->addItem('Logout', 'logout');
 }
Example #3
0
 function init()
 {
     parent::init();
     //DB Connect not default
     $this->dbConnect();
     // Might come handy when multi-timezone base networks integrates
     $this->today = date('Y-m-d', strtotime($this->recall('current_date', date('Y-m-d'))));
     $this->now = date('Y-m-d H:i:s', strtotime($this->recall('current_date', date('Y-m-d H:i:s'))));
     $superadmin = $this->add('Model_User');
     // ->addCondition('type','Backend');
     // print_r($superadmin->getRows());
     $auth = $this->add('BasicAuth');
     $auth->setModel($superadmin, 'email', 'password');
     $auth->check();
     $this->api->pathfinder->addLocation(array('addons' => array('addons', 'vendor', 'shared/addons2')))->setBasePath($this->pathfinder->base_location->getPath() . '/..');
 }
Example #4
0
 function init()
 {
     parent::init();
     $this->api->pathfinder->addLocation(array('addons' => array('addons', 'vendor')))->setBasePath($this->pathfinder->base_location->getPath() . '/..');
     $this->api->menu->addMenuItem('/', 'Home');
 }