Source for file LPageMenu.php
Documentation is available at LPageMenu.php
* @license http://opensource.org/licenses/mozilla1.1.php Mozilla Public License
* @copyright 2005, diemeisterei GmbH. All rights reserved.
* @author $Author: schmunk $
* @version $Revision: 603 $ $Date: 2007-02-25 01:22:18 +0100 (So, 25 Feb 2007) $
* @package Phundament.Packages
* @subpackage LVirtualNodes
* Displays and manages the CSS menu (sitemap tree)
* @package System.Web.UI.WebControls
* @param boolean: show menu horizontal / vertical
$this->_horizontal= $value;
* @return Menu orientation settings,
return TPropertyValue :: ensureBoolean($this->_horizontal);
$this->setViewState("RootNodeId", $value);
return $this->getViewState("RootNodeId", 1);
$this->setViewState("RootNodeAlias", $value);
return $this->getViewState("RootNodeAlias", false);
$this->setViewState("DescentLimit", $value);
return $this->getViewState("DescentLimit", null);
$this->setViewState("EnableLocalization", TPropertyValue :: ensureBoolean($value));
return $this->getViewState("EnableLocalization", false);
* Maps nodes from LPageService
parent :: onLoad($param);
* Adds automatic menu init
parent :: onPreRender($param);
if ($this->Service->areNodesAvailable() && $this->findControl("MenuPlaceholder") !== null)
$this->initMenu($this->MenuPlaceholder);
Prado :: log("Can not render menu (node tree status:" . $this->Service->areNodesAvailable() . ")", 4, 'Lithron.LPageMenu');
* Builds menu with data from sitemap tree and implements caching
if (!$_nodes instanceof LVirtualNodesSiteNode)
Prado :: trace("Menu rendered", 'Lithron.LPageMenu');
$parent->Controls[]= $menu;
* Recursive function for walk through sitemap tree
#Prado :: trace("Creating menu node...", 'Lithron.LPageMenu');
$child= $nodeTree->getFirstChildNode();
$menuNode= Prado :: createComponent('LCssDropDownMenuNode');
$parent->Controls[]= $menuNode;
if ($this->Service->CurrentNode)
$ancestors= $this->Service->CurrentNode->getAncestors();
foreach ($ancestors AS $ancestor)
if ($ancestor->getId() == $child->getId())
$menuNode->setSelectedPath(true);
$_name= $child->getDescriptiveName();
$_alias= $child->getAlias();
$name= (!empty ($_name)) ? $_name : $_alias;
$name= Prado :: localize($name);
$menuNode->setText($name); // TODO
$menuNode->setLinkUrl($this->Service->constructUrl($child->getAlias()));
$dclass = $child->getDynmenuClass();
$dmethod = $child->getDynmenuMethod();
$sn = $this->Application->singleton($dclass);
$sn-> $dmethod ($menuNode, $child, $new_uri);
#Prado :: trace("Created menu node [$name]", 'Lithron.LPageMenu');
$child= $child->getSiblingNode();
|