public function save() { $logger = Zupal_Module_Manager::getInstance()->get('people')->logger(); parent::save(); $logger->info('Employee ' . $this->get_domain()->identity() . ' saved'); $cache = Zupal_Bootstrap::$registry->cache; $cache->remove('employee_data'); }
function createAction() { $this->view->modules = array(); foreach (Zupal_Module_Manager::getInstance()->get_all() as $module_item) { if ($module_item->info()->admin && $module_item->info()->admin->create) { $this->view->modules[] = $module_item; } } }
public function __construct($pTitle = '', $pData = NULL) { $config = new Zend_Config_Xml(realpath(dirname(__FILE__) . '/../../../menu.xml')); parent::__construct('', $config->menu); foreach (Zupal_Module_Manager::getInstance()->get_all() as $item) { if ($item->has_admin()) { $this->set_item($item->admin_menu_item()); } } }
/** * */ public function loadAction() { $module = Zupal_Module_Manager::getInstance()->get('media'); $dir_path = (string) $module->info()->musicolio_files; $di = new DirectoryIterator($dir_path); $this->view->files = array(); foreach ($di as $fi) { if ($fi->isFile()) { $this->view->files[$fi->getFilename()] = $fi->getRealPath(); } } }
function get_adapter($pReload = FALSE) { if ($pReload || is_null($this->_adapter)) { if ($this->get_database_name()) { $adapter = Zupal_Module_Manager::getInstance()->database($this->get_database_name()); } else { $adapter = Zend_Db_Table_Abstract::getDefaultAdapter(); } $this->_adapter = $adapter; } return $this->_adapter; }
public function preDispatch() { $menu = new Zupal_Menu('Modules'); $active_module = Zend_Controller_Front::getInstance()->getRequest()->getModuleName(); foreach (Zupal_Module_Manager::getInstance()->getModuleNames() as $module) { $item = new Zupal_Menu_Item(ucfirst($module), $module, 'index', 'index'); $menu->set_item($item); if (!strcasecmp($module, $active_module)) { $item->list_class = 'active'; $module_def = Zupal_Module_Manager::getInstance()->get($module); $menu_file = $module_def->info()->menu; if ($menu_file) { $menu_path = $module_def->directory() . DS . $menu_file; if (file_exists($menu_path)) { $config = FALSE; switch (pathinfo($menu_path, PATHINFO_EXTENSION)) { case 'xml': $config = new Zend_Config_Xml($menu_path, 'menu'); break; case 'ini': $config = new Zend_Config_Ini($menu_path); break; } if ($config) { $submenu = new Zupal_Menu('', $config); $item->submenu = $submenu; } } else { $module_item = Zupal_Module_Manager::getInstance()->get($module); if ($module_item->has('library' . DS . str_replace('_', DS, $menu_file) . '.php')) { $item->submenu = new $menu_file(); } } } } } $this->view->placeholder('nav')->set($menu); foreach (array('message', 'error') as $property) { $v = $this->_getParam($property, ''); if ($v) { error_log(__METHOD__ . ': ' . $property . ' = ' . $v); $this->view->placeholder($property)->set($v); } } }
public function searchvalidateAction() { $params = $this->_getAllParams(); extract($params); foreach ($params as $k => $v) { $this->view->{$k} = $v; } if ($search_module) { $module_list = array(Zupal_Module_Manager::getInstance()->get($search_module)); } else { $module_list = Zupal_Module_Manager::getInstance()->get_all(); } $hits = array(); foreach ($module_list as $module) { $hits = array_merge($hits, $module->search_logs($phrase, $lines)); } $this->view->hits = $hits; $log_form = new Zupal_Logs_SearchForm(); $log_form->isValid($params); $log_form->setAction(ZUPAL_BASEURL . DS . join(DS, array('admin', 'logs', 'searchvalidate'))); $this->view->form = $log_form; }
public function delete() { $logger = Zupal_Module_Manager::getInstance()->get('people')->logger(); $logger->info('Person ' . $this->identity() . ' deleted'); $cache = Zupal_Bootstrap::$registry->cache; $cache->remove('people_data'); parent::delete(); }
public function __construct() { parent::__construct(array("db" => Zupal_Module_Manager::getInstance()->database("musicbrainz"))); }
/** * * @return void */ public function set_module_options() { foreach (Zupal_Module_Manager::getInstance()->getModuleNames() as $module) { $this->search_module->addMultiOption($module, $module); } }
protected function load($pID) { if (is_object($pID)) { if ($pID instanceof Zend_Db_Table_Row) { $this->_row = $pID; return; } else { throw new Exception(__METHOD__ . ': Non integer ' . print_r($pID, 1) . ' passed to ' . __CLASS__); } } if ($pID) { $hits = $this->table()->find($pID); if ($hits) { $this->_row = $hits->current(); } else { $log = Zupal_Module_Manager::getInstance()->get('people')->logger(); $log->error('cannot find ' . $pID . ' in ' . $this->tableClass()); } } if (!$this->_row) { $this->_row = $this->table()->createRow(); } }
public static function setupModel() { Zupal_Database_Manager::init(); Zupal_Module_Manager::getInstance()->load_all(); foreach (Zupal_Module_Manager::getInstance()->get_all() as $item) { $item->add_paths(); } }
/** * */ public function viewAction() { $this->view->item = Zupal_Module_Manager::getInstance()->get($this->_getParam('name')); }
/** * @see Zupal_Grid_IGrid::render_script() * * @param unknown_type $pID * @param array $pParams */ public function render_script($pID, array $pParams = NULL) { //TODO - Insert your code here $media = Zupal_Module_Manager::getInstance()->get('media'); $module_root = $media->directory(); include $module_root . DS . join(DS, array('models', 'Zupal', 'Musicbrainz', 'Artist')) . DS . 'artists_grid_script.php'; }