protected function _initialize() { if ($this->ns === null) { throw new Data_Insufficient_Exception('ns'); } parent::_initialize(); }
protected function _initialize() { //$this->_do = new Kiwi_Slide; $this->_do = Kiwi_Object_Manager::load('Kiwi_Slide'); // allows caching parent::_initialize(); }
protected function _initialize() { if ($this->group === null) { throw new Data_Insufficient_Exception('group'); } //$this->_kiwi_object = new Kiwi_Banners($this->group); $this->_kiwi_object = Kiwi_Object_Manager::load('Kiwi_Banners', array($this->group)); // allows caching parent::_initialize(); }
protected function _initialize() { if ($this->timestamp !== null) { $fields = array('year', 'month', 'day', 'hour', 'minute', 'second'); foreach ($fields as $field) { if ($this->{$field} !== null) { throw new Data_Superfluous_Exception('datetime::timestamp', "datetime::{$field}"); } } $this->updateByTimestamp(); } elseif ($this->year !== null) { $this->updateTimestamp(); } elseif ($this->month !== null || $this->day !== null || $this->hour !== null || $this->minute !== null || $this->second !== null) { throw new Data_Insufficient_Exception('datetime::year'); } else { $this->timestamp = time(); $this->updateByTimestamp(); } parent::_initialize(); }
protected function _initialize() { //$module = new Kiwi_Text_Module($this->mid, $this->name); $module = Kiwi_Object_Manager::load('Kiwi_Text_Module', array($this->mid, $this->name)); // allows caching // non-overridable attributes (module attributes have priority) $attr_no = array('mid' => 'id', 'name' => 'name', 'mactive' => 'active'); foreach ($attr_no as $attr => $mattr) { if ($module->{$mattr} !== null) { $this->{$attr} = $module->{$mattr}; } } // overridable attributes (tag attributes have priority) $attr_o = array('title' => 'name', 'content' => 'content'); foreach ($attr_o as $attr => $mattr) { if ($this->{$attr} === null) { $this->{$attr} = $module->{$mattr}; } } parent::_initialize(); }
protected function _initialize() { //$this->_kiwi_module = new Kiwi_News_Module($this->mid, $this->name, $this->ngid, $this->newsgroup, $this->size, $this->listmode, $this->pagination, $this->detailpage); $this->_kiwi_module = Kiwi_Object_Manager::load('Kiwi_News_Module', array($this->mid, $this->name, $this->ngid, $this->newsgroup, $this->size, $this->listmode, $this->pagination, $this->detailpage)); // allows caching // non-overridable attributes (module attributes have priority) $attr_no = array('mid' => 'id', 'name' => 'name', 'ngid' => 'ngid', 'mactive' => 'active'); foreach ($attr_no as $attr => $mattr) { if ($this->_kiwi_module->{$mattr} !== null) { $this->{$attr} = $this->_kiwi_module->{$mattr}; } } // overridable attributes (tag attributes have priority) $attr_o = array('size' => 'size', 'listmode' => 'listmode', 'pagination' => 'pagination', 'detailpage' => 'detailpage'); foreach ($attr_o as $attr => $mattr) { if ($this->{$attr} === null) { $this->{$attr} = $this->_kiwi_module->{$mattr}; } } // default values of attributes $defaults = array('size' => 5, 'pagination' => 'both', 'page' => 1, 'ns' => '', 'images' => ''); foreach ($defaults as $attr => $val) { if ($this->{$attr} === null) { $this->{$attr} = $val; } } // default for nsd is value of ns if ($this->nsd === null) { $this->nsd = $this->ns; } if ($this->ngid === null && $this->newsgroup === null) { throw new Data_Insufficient_Exception('ngid or newsgroup'); } parent::_initialize(); }
protected function _initialize() { if ($this->name === null) { throw new Data_Insufficient_Exception('name'); } if ($this->catalogroot !== null && $this->line !== null) { throw new Data_Superfluous_Exception('catalogroot', 'line'); } $pnav = new Project_Navigator(); $this->_catalog_urlbase = $pnav->get($this->name . '_urlbase'); $this->_catalog_href = $pnav->get($this->name); /* // javascript support for catalog menu no longer necessary $match = $this->_view_manager->head->getElementsBy('tag', 'scripts'); if (empty($match)) throw new Template_Invalid_Structure_Exception('scripts tag missing in head template'); $scripts = $match[0]; $js_dir = $pnav->js_dir; $scripts->addUnique(new HTML_JavaScript($js_dir . 'catalog_menu.js')); */ parent::_initialize(); }