* @package WB * @subpackage content */ /** * Load base class */ WBClass::load('WBContent' , 'WBContent_LandingPage'); /** * Content component: LandingPage Nav * * @version 0.4.1 * @package WB * @subpackage content */ class WBContent_LandingPage_Nav extends WBContent_LandingPage { /** * My Parameter List * @var array */ protected $config = array( 'tmpl' => 'default', 'urlpath' => '' ); /** * Current Page * @var array */ protected $page = array(); /** * @var WBDatesource_Table */ private $table; /** * 2nd constructor * * Called after configuration was done */ protected function init() { parent::init(); $this->table = WBClass::create('WBDatasource_Table'); $this->mandator = WBClass::create('WBMandator'); } /** * Run Component * * @return array parameter list */ public function run() { $clause = array(); $clause[] = array( 'field' => 'enabled', 'value' => 1 ); $clause[] = array( 'field' => 'urlpath', 'relation' => 'not', 'value' => '' ); $this->mandator->inject2Clause($clause); $list = $this->table->get(WBContent_LandingPage::TABLE_LANDINGPAGE, null, null, $clause); foreach ($list as &$l) { $l['class'] = ''; if ($this->config['urlpath'] == $l['urlpath']) { $l['class'] = 'active'; } } $this->loadTemplates($this->config['tmpl']); $this->tmpl->addGlobalVars($this->mandator->get(), 'MANDATOR_'); $this->list2Template($list); return $this->config; } }