sTitle = $title; } function setPlugin(&$oPlugin) { global $default; $default->log->debug('portlet regging plugin: ' . $oPlugin->sNamespace); $this->oPlugin =& $oPlugin; } // this should multiplex i18n_title function getTitle() { return $this->sTitle; } function render() { return '
Warning: Abstract Portlet created.
'; } function setDispatcher(&$oDispatcher) { $this->oDispatcher =& $oDispatcher; } function getActive() { return $this->bActive; } } /* Encapsulates the logic for showing navigation items. * */ class KTNavPortlet extends KTPortlet { // list of dict {url:'',label:''} var $navItems = Array(); function setOldNavItems($aNavLinks) { $this->navItems = array_map(array(&$this, "_oldNavZip"), $aNavLinks["descriptions"], $aNavLinks["links"]); } // legacy support helper function _oldNavZip($d, $u) { $aZip = array( "label" => $d, "url" => $u, ); return $aZip; } function render() { $oTemplating =& KTTemplating::getSingleton(); $oTemplate = $oTemplating->loadTemplate("kt3/portlets/nav_portlet"); $aTemplateData = array( "context" => $this, ); return $oTemplate->render($aTemplateData); } } class KTActionPortlet extends KTPortlet { var $actions = array(); var $bActive = true; // current action is the one we are currently on. function setActions($actions, $currentaction) { foreach ($actions as $action) { $aInfo = $action->getInfo(); if ($aInfo !== null) { if ($aInfo["ns"] == $currentaction) { unset($aInfo["url"]); $aInfo['active'] = true; } $this->actions[$aInfo['name']] = $aInfo; } } ksort($this->actions); } function render() { if (empty($this->actions)) { return null; } $oTemplating =& KTTemplating::getSingleton(); $oTemplate = $oTemplating->loadTemplate("kt3/portlets/actions_portlet"); $aTemplateData = array( "context" => $this, ); return $oTemplate->render($aTemplateData); } } ?>