| // +---------------------------------------------------------------------------+ // $Id: OutputAddon.php,v 0.1 2006/01/29 23:28:37 /** * OutputAddon class * * Gets additional navigation tree from app controller output. * * @package navigation * @author Andrey Podshivalov * @version 0.2 * @access public * @since PHP 4.4.2 */ class OutputAddon { var $sectionId; function init(&$output, &$section, &$aParams) { SGL::logMessage(null, PEAR_LOG_DEBUG); if (!$section->is_enabled) { return false; } $navAddon = @$aParams['navAddon']; if (empty($navAddon)) { $navAddon = 'navAddon'; } if (isset($output->$navAddon)) { $this->sectionId = $section->section_id; $aSections = $output->$navAddon; $this->_setSectionId($aSections); return $aSections; } else { return false; } } /** * Sets section_id for all nodes. * * @access private * @param array $aSections * @param int $sectionId; * @return array */ function _setSectionId(&$aSections) { foreach ($aSections as $key => $section) { $section->section_id = $this->sectionId; if ($section->children) { $this->_setSectionId($section->children); } $aSections[$key] = $section; } } } ?>