protected function _initialize() { //$this->_do = new Kiwi_Slide; $this->_do = Kiwi_Object_Manager::load('Kiwi_Slide'); // allows caching parent::_initialize(); }
public function __construct(View_Manager $view_manager) { parent::__construct($view_manager); $this->_attributes->register('current'); // currently active menuitem $this->_attributes->register('autodetect'); // automatic detection of current menuitem (overrides the current attribute) $this->template = 'navmenu/default'; // default template }
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 _render(Text_Renderer $renderer, $view_case) { switch ($view_case) { case 'top': case 'bottom': parent::_render($renderer, 'default'); break; default: parent::_render($renderer, $view_case); } }
protected function updateTemplate() { Template_Based_View::updateTemplate(); if ($this->_shouldValidate()) { $this->detectSpam(); if ($this->_status != self::SPAM) { $this->_noSpamDetected(); $this->validate(); if ($this->_validation['failed'] == 0) { $this->_validationSuccess(); } else { $this->_validationFailure(); } } else { $this->_spamDetected(); } } $this->applyValidationResults(); $this->_restoreSubmitValues(); }
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 cleanupTemplate() { $this->_enumerations = null; parent::cleanupTemplate(); }
public function __construct(View_Manager $view_manager) { parent::__construct($view_manager); $this->template = 'newsletterresubscriber/default'; // default template }
protected function updateTemplate() { parent::updateTemplate(); if ($this->_shouldValidate()) { $this->validate(); if ($this->_validation['failed'] == 0) { $this->_validationSuccess(); } else { $this->_validationFailure(); } } $this->applyValidationResults(); $this->_restoreSubmitValues(); }
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(); }