public function after() { if ($this->auto_render) { Jx_Event::post($this, 'beforeRender', $this->template); $this->request->response = $this->template; } return parent::after(); }
public static function get_admin_menu() { /** * each menu item should be setup as a button config with an extra parameter * for the filename that should be loaded to render the panel/tab */ $menu = array('content' => array('toplevel' => true, 'text' => 'Site Content', 'title' => '', 'submenu' => array()), 'system' => array('toplevel' => true, 'text' => 'System', 'title' => '', 'submenu' => array('dashboard' => array('text' => 'Dashboard', 'title' => '', 'file' => 'dashboard'))), 'plugins' => array('toplevel' => true, 'text' => 'Plugins', 'title' => '', 'submenu' => array())); $notification = Jx_Event::post($menu, 'getAdminMenu'); $menu = $notification->getReturnData(); //sort the submenus foreach ($menu as $key => $arr) { array_multisort($menu[$key]['submenu'], SORT_ASC); } return $menu; }
<?php Jx_Event::addObserver(array('Jx_Theme', 'onBeforeRender'), 'beforeRender'); Jx_Event::addObserver(array('Jx_Theme', 'onGetAdminMenu'), 'getAdminMenu');
<?php if (!defined('DS')) { define('DS', DIRECTORY_SEPARATOR); } //we need to go through and initialize all of the modules we need to use Jx_Modules::init(); Route::add('media', 'media/<action>/<file>(.<ext>)', null, 'admin')->defaults(array('controller' => 'media')); //add event callbacks as needed Jx_Event::addObserver(array('Jx_Modules', 'onGetAdminMenu'), 'getAdminMenu'); Jx_Event::addObserver(array('Jx_Settings', 'onGetAdminMenu'), 'getAdminMenu');