本文整理汇总了PHP中Varien_Data_Tree_Node::setData方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Data_Tree_Node::setData方法的具体用法?PHP Varien_Data_Tree_Node::setData怎么用?PHP Varien_Data_Tree_Node::setData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Data_Tree_Node
的用法示例。
在下文中一共展示了Varien_Data_Tree_Node::setData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addToTopmenu
public function addToTopmenu(Varien_Event_Observer $observer)
{
$parseCurentUrl = parse_url(Mage::helper('core/url')->getCurrentUrl());
$menu = $observer->getMenu();
$tree = $menu->getTree();
/*******************************************************************/
// level zero
$nodePath = 'conturifurnizori/furnizori/';
$node = new Varien_Data_Tree_Node(array('name' => 'Furnizori', 'id' => 'furnizori', 'url' => Mage::getUrl($nodePath)), 'id', $tree, $menu);
if (strpos($parseCurentUrl['path'], $nodePath) !== false) {
$node->setData('class', 'active');
}
$menu->addChild($node);
// level one child of furnizori
$data = array('name' => 'Servicii Foto', 'id' => 'foto', 'url' => Mage::getUrl('conturifurnizori/furnizori/foto/'));
$subNode = new Varien_Data_Tree_Node($data, 'id', $tree, $node);
$node->addChild($subNode);
// level one child of portofoliu
$data = array('name' => 'Servicii Video', 'id' => 'video', 'url' => Mage::getUrl('conturifurnizori/furnizori/video/'));
$subNode = new Varien_Data_Tree_Node($data, 'id', $tree, $node);
$node->addChild($subNode);
// level one child of portofoliu
$data = array('name' => 'Servicii Foto-Video', 'id' => 'foto-video', 'url' => Mage::getUrl('conturifurnizori/furnizori/fotovideo/'));
$subNode = new Varien_Data_Tree_Node($data, 'id', $tree, $node);
$node->addChild($subNode);
/*******************************************************************/
// level zero
$nodePath = 'portofoliu';
$node = new Varien_Data_Tree_Node(array('name' => 'Portofolii', 'id' => 'portofolii', 'url' => 'javascript:void(0)'), 'id', $tree, $menu);
if (strpos($parseCurentUrl['path'], $nodePath) !== false) {
$node->setData('class', 'active');
}
$menu->addChild($node);
// level one child of portofoliu
/*
$data = array(
'name' => 'Disponibile in curand',
'id' => 'albume-foto',
'url' =>'javascript:void(0)',
);
$subNode = new Varien_Data_Tree_Node($data, 'id', $tree, $node);
$node->addChild($subNode);
*/
// level one child of portofoliu
$data = array('name' => 'Albume Foto', 'id' => 'albume-foto', 'url' => Mage::getUrl('portofoliu/foto'));
$subNode = new Varien_Data_Tree_Node($data, 'id', $tree, $node);
$node->addChild($subNode);
// level one child of portofoliu
$data = array('name' => 'Videoclipuri', 'id' => 'videoclipuri', 'url' => Mage::getUrl('portofoliu/video'));
$subNode = new Varien_Data_Tree_Node($data, 'id', $tree, $node);
$node->addChild($subNode);
/*******************************************************************/
// level zero
$nodePath = 'articole-utile';
$node = new Varien_Data_Tree_Node(array('name' => 'Articole Utile', 'id' => 'articole-utile', 'url' => Mage::getUrl($nodePath)), 'id', $tree, $menu);
if (strpos($parseCurentUrl['path'], $nodePath) !== false) {
$node->setData('class', 'active');
}
$menu->addChild($node);
// level zero
$nodePath = 'search';
$node = new Varien_Data_Tree_Node(array('name' => 'Search', 'id' => 'search', 'url' => 'javascript:void(0)', 'class' => 'fa fa-search top-search'), 'id', $tree, $menu);
$menu->addChild($node);
/*******************************************************************/
return $this;
}