Source for file layersmenu.inc.php
Documentation is available at layersmenu.inc.php
// PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/
* This file contains the code of the LayersMenu class.
* This is the LayersMenu class of the PHP Layers Menu library.
* This class depends on the LayersMenuCommon class and on the PEAR conforming version of the PHPLib Template class, i.e. on HTML_Template_PHPLIB
* The template to be used for the first level menu of a horizontal menu.
* The value of this variable is significant only when preparing
* The template to be used for the first level menu of a vertical menu.
* The value of this variable is significant only when preparing
* The template to be used for submenu layers
* A string containing the header needed to use the menu(s) in the page
* This var tells if the header has been made or not
var $_headerHasBeenMade = false;
* The JS vector to list layers
* The JS vector of keys to know the father of each layer
* The JS vector of vals to know the father of each layer
* The JS function to set initial positions of all layers
* An array containing the code related to the first level menu of each menu
* A string containing the footer needed to use the menu(s) in the page
* This var tells if the footer has been made or not
var $_footerHasBeenMade = false;
* The image used for forward arrows.
* The image used for down arrows.
* A 1x1 transparent icon.
* An array to keep trace of layers containing / not containing icons
* Top offset for positioning of sub menu layers
* Right offset for positioning of sub menu layers
* Left offset for positioning of sub menu layers
* Threshold for vertical repositioning of a layer
* Step for the left boundaries of layers
* The constructor method; it initializates the menu system
$menuTopShift = 6, // Gtk2-like
$menuRightShift = 7, // Gtk2-like
$menuLeftShift = 2, // Gtk2-like
$this->horizontalMenuTpl = $this->tpldir . 'layersmenu-horizontal_menu.ihtml';
$this->verticalMenuTpl = $this->tpldir . 'layersmenu-vertical_menu.ihtml';
$this->subMenuTpl = $this->tpldir . 'layersmenu-sub_menu.ihtml';
$this->_firstLevelMenu = array();
$this->transparentIcon = 'transparent.png';
$this->_hasIcons = array();
$this->forwardArrowImg['src'] = 'forward-arrow.png';
$this->forwardArrowImg['width'] = 4;
$this->forwardArrowImg['height'] = 7;
$this->downArrowImg['src'] = 'down-arrow.png';
$this->downArrowImg['width'] = 9;
$this->downArrowImg['height'] = 5;
$this->menuTopShift = $menuTopShift;
$this->menuRightShift = $menuRightShift;
$this->menuLeftShift = $menuLeftShift;
$this->thresholdY = $thresholdY;
$this->abscissaStep = $abscissaStep;
* The method to set the value of menuTopShift
$this->menuTopShift = $menuTopShift;
* The method to set the value of menuRightShift
$this->menuRightShift = $menuRightShift;
* The method to set the value of menuLeftShift
$this->menuLeftShift = $menuLeftShift;
* The method to set the value of thresholdY
$this->thresholdY = $thresholdY;
* The method to set the value of abscissaStep
$this->abscissaStep = $abscissaStep;
* The method to set the dirroot directory
$oldtpldir = $this->tpldir;
$this->updateTpldir($oldtpldir);
* The method to set the tpldir directory
$oldtpldir = $this->tpldir;
$this->updateTpldir($oldtpldir);
* The method to update the templates directory path to the new tpldir
function updateTpldir($oldtpldir)
$oldlength = strlen($oldtpldir);
$foobar = strpos($this->horizontalMenuTpl, $oldtpldir);
if (!($foobar === false || $foobar != 0)) {
$this->horizontalMenuTpl = $this->tpldir . substr($this->horizontalMenuTpl, $oldlength);
$foobar = strpos($this->verticalMenuTpl, $oldtpldir);
if (!($foobar === false || $foobar != 0)) {
$this->verticalMenuTpl = $this->tpldir . substr($this->verticalMenuTpl, $oldlength);
$foobar = strpos($this->subMenuTpl, $oldtpldir);
if (!($foobar === false || $foobar != 0)) {
$this->subMenuTpl = $this->tpldir . substr($this->subMenuTpl, $oldlength);
* The method to set horizontalMenuTpl
if (str_replace('/', '', $horizontalMenuTpl) == $horizontalMenuTpl) {
$horizontalMenuTpl = $this->tpldir . $horizontalMenuTpl;
$this->error("setHorizontalMenuTpl: file $horizontalMenuTpl does not exist.");
$this->horizontalMenuTpl = $horizontalMenuTpl;
* The method to set verticalMenuTpl
if (str_replace('/', '', $verticalMenuTpl) == $verticalMenuTpl) {
$verticalMenuTpl = $this->tpldir . $verticalMenuTpl;
$this->error("setVerticalMenuTpl: file $verticalMenuTpl does not exist.");
$this->verticalMenuTpl = $verticalMenuTpl;
* The method to set subMenuTpl
if (str_replace('/', '', $subMenuTpl) == $subMenuTpl) {
$subMenuTpl = $this->tpldir . $subMenuTpl;
$this->error("setSubMenuTpl: file $subMenuTpl does not exist.");
$this->subMenuTpl = $subMenuTpl;
* A method to set transparentIcon
* @param string $transparentIcon a transparentIcon filename (without the path)
$this->transparentIcon = $transparentIcon;
* The method to set an image to be used for the forward arrow
* @param string $forwardArrowImg the forward arrow image filename
$this->error('setForwardArrowImg: file ' . $this->imgdir . $forwardArrowImg . ' does not exist.');
$this->forwardArrowImg['src'] = $forwardArrowImg;
$this->forwardArrowImg['width'] = $foobar[0];
$this->forwardArrowImg['height'] = $foobar[1];
* The method to set an image to be used for the down arrow
* @param string $downArrowImg the down arrow image filename
$this->error('setDownArrowImg: file ' . $this->imgdir . $downArrowImg . ' does not exist.');
$this->downArrowImg['src'] = $downArrowImg;
$this->downArrowImg['width'] = $foobar[0];
$this->downArrowImg['height'] = $foobar[1];
* A method providing parsing needed both for horizontal and vertical menus; it can be useful also with the ProcessLayersMenu extended class
* @param string $menu_name the name of the menu for which the parsing
$menu_name = '' // non consistent default...
$this->_hasIcons[$menu_name] = false;
for ($cnt= $this->_firstItem[$menu_name]; $cnt<= $this->_lastItem[$menu_name]; $cnt++ ) { // this counter scans all nodes of the new menu
$this->_hasIcons[$cnt] = false;
$this->tree[$cnt]['layer_label'] = "L$cnt";
$current_node[$this->tree[$cnt]['level']] = $cnt;
if (!$this->tree[$cnt]['child_of_root_node']) {
$this->tree[$cnt]['father_node'] = $current_node[$this->tree[$cnt]['level']- 1];
$this->father_keys .= ",'L$cnt'";
$this->father_vals .= ",'" . $this->tree[$this->tree[$cnt]['father_node']]['layer_label'] . "'";
$this->tree[$cnt]['not_a_leaf'] = ($this->tree[$cnt+ 1]['level']> $this->tree[$cnt]['level'] && $cnt< $this->_lastItem[$menu_name]);
// if the above condition is true, the node is not a leaf,
// hence it has at least a child; if it is false, the node is a leaf
if ($this->tree[$cnt]['not_a_leaf']) {
// initialize the corresponding layer content trought a void string
$this->tree[$cnt]['layer_content'] = '';
// the new layer is accounted for in the layers list
$this->listl .= ",'" . $this->tree[$cnt]['layer_label'] . "'";
if ($this->tree[$cnt]['not_a_leaf']) {
$this->tree[$cnt]['parsed_href'] = '#';
if ($this->tree[$cnt]['parsed_icon'] == '') {
$this->tree[$cnt]['iconsrc'] = $this->imgwww . $this->transparentIcon;
$this->tree[$cnt]['iconwidth'] = 16;
$this->tree[$cnt]['iconheight'] = 16;
$this->tree[$cnt]['iconalt'] = ' ';
if ($this->tree[$cnt]['level'] > 1) {
$this->_hasIcons[$this->tree[$cnt]['father_node']] = true;
$this->_hasIcons[$menu_name] = true;
$this->tree[$cnt]['iconsrc'] = $this->tree[$cnt]['parsed_icon'];
$this->tree[$cnt]['iconalt'] = 'O';
* A method needed to update the footer both for horizontal and vertical menus
* @param string $menu_name the name of the menu for which the updating
$menu_name = '' // non consistent default...
$t = new Template_PHPLIB();
$t->setFile('tplfile', $this->subMenuTpl);
$t->setBlock('tplfile', 'template', 'template_blck');
$t->setBlock('template', 'sub_menu_cell', 'sub_menu_cell_blck');
$t->setVar('sub_menu_cell_blck', '');
$t->setBlock('template', 'separator', 'separator_blck');
$t->setVar('separator_blck', '');
$t->setVar('abscissaStep', $this->abscissaStep);
for ($cnt= $this->_firstItem[$menu_name]; $cnt<= $this->_lastItem[$menu_name]; $cnt++ ) {
if ($this->tree[$cnt]['not_a_leaf']) {
'layer_label' => $this->tree[$cnt]['layer_label'],
'layer_title' => $this->tree[$cnt]['text'],
'sub_menu_cell_blck' => $this->tree[$cnt]['layer_content']
$this->footer .= $t->parse('template_blck', 'template');
* Method to preparare a horizontal menu.
* This method processes items of a menu to prepare the corresponding
* horizontal menu code updating many variables; it returns the code
* of the corresponding _firstLevelMenu
* @param string $menu_name the name of the menu whose items have to be processed
$menu_name = '' // non consistent default...
if (!isset ($this->_firstItem[$menu_name]) || !isset ($this->_lastItem[$menu_name])) {
$this->error("newHorizontalMenu: the first/last item of the menu ' $menu_name' is not defined; please check if you have parsed its menu data. ");
$this->parseCommon($menu_name);
$t = new Template_PHPLIB();
$t->setFile('tplfile', $this->horizontalMenuTpl);
$t->setBlock('tplfile', 'template', 'template_blck');
$t->setBlock('template', 'horizontal_menu_cell', 'horizontal_menu_cell_blck');
$t->setVar('horizontal_menu_cell_blck', '');
$t->setBlock('horizontal_menu_cell', 'cell_link', 'cell_link_blck');
$t->setVar('cell_link_blck', '');
$t->setBlock('cell_link', 'cell_icon', 'cell_icon_blck');
$t->setVar('cell_icon_blck', '');
$t->setBlock('cell_link', 'cell_arrow', 'cell_arrow_blck');
$t->setVar('cell_arrow_blck', '');
$t_sub = new <a href="../Zikula 1.0.1/Template_PHPLIB.html">Template_PHPLIB</a>();
$t_sub->setFile('tplfile', $this->subMenuTpl);
$t_sub->setBlock('tplfile', 'sub_menu_cell', 'sub_menu_cell_blck');
$t_sub->setVar('sub_menu_cell_blck', '');
$t_sub->setBlock('sub_menu_cell', 'cell_icon', 'cell_icon_blck');
$t_sub->setVar('cell_icon_blck', '');
$t_sub->setBlock('sub_menu_cell', 'cell_arrow', 'cell_arrow_blck');
$t_sub->setVar('cell_arrow_blck', '');
$t_sub->setBlock('tplfile', 'separator', 'separator_blck');
$t_sub->setVar('separator_blck', '');
$this->_firstLevelMenu[$menu_name] = '';
$foobar = $this->_firstItem[$menu_name];
$this->moveLayers .= "\tvar " . $menu_name . "TOP = getOffsetTop('" . $menu_name . "L" . $foobar . "');\n";
$this->moveLayers .= "\tvar " . $menu_name . "HEIGHT = getOffsetHeight('" . $menu_name . "L" . $foobar . "');\n";
for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) { // this counter scans all nodes of the new menu
if ($this->tree[$cnt]['not_a_leaf']) {
// geometrical parameters are assigned to the new layer, related to the above mentioned children
if ($this->tree[$cnt]['child_of_root_node']) {
$this->moveLayers .= "\tsetTop('" . $this->tree[$cnt]['layer_label'] . "', " . $menu_name . "TOP + " . $menu_name . "HEIGHT);\n";
$this->moveLayers .= "\tmoveLayerX1('" . $this->tree[$cnt]['layer_label'] . "', '" . $menu_name . "');\n";
if ($this->tree[$cnt]['child_of_root_node']) {
if ($this->tree[$cnt]['text'] == '---') {
if ($this->tree[$cnt]['not_a_leaf']) {
$this->tree[$cnt]['onmouseover'] = ' onmouseover="moveLayerX1(' . "'" . $this->tree[$cnt]['layer_label'] . "', '" . $menu_name . "') ; LMPopUp('" . $this->tree[$cnt]['layer_label'] . "'" . ', false);"';
$this->tree[$cnt]['onmouseover'] = ' onmouseover="shutdown();"';
'menu_layer_label' => $menu_name . $this->tree[$cnt]['layer_label'],
'imgwww' => $this->imgwww,
'transparent' => $this->transparentIcon,
'href' => $this->tree[$cnt]['parsed_href'],
'onmouseover' => $this->tree[$cnt]['onmouseover'],
'title' => $this->tree[$cnt]['parsed_title'],
'target' => $this->tree[$cnt]['parsed_target'],
'text' => $this->tree[$cnt]['text'],
'downsrc' => $this->downArrowImg['src'],
'downwidth' => $this->downArrowImg['width'],
'downheight' => $this->downArrowImg['height']
if ($this->tree[$cnt]['parsed_icon'] != '') {
'iconsrc' => $this->tree[$cnt]['iconsrc'],
'iconwidth' => $this->tree[$cnt]['iconwidth'],
'iconheight' => $this->tree[$cnt]['iconheight'],
'iconalt' => $this->tree[$cnt]['iconalt'],
$t->parse('cell_icon_blck', 'cell_icon');
$t->setVar('cell_icon_blck', '');
if ($this->tree[$cnt]['not_a_leaf']) {
$t->parse('cell_arrow_blck', 'cell_arrow');
$t->setVar('cell_arrow_blck', '');
$foobar = $t->parse('cell_link_blck', 'cell_link');
'cellwidth' => $this->abscissaStep,
'cell_link_blck' => $foobar
$t->parse('horizontal_menu_cell_blck', 'horizontal_menu_cell', true);
if ($this->tree[$cnt]['text'] == '---') {
$this->tree[$this->tree[$cnt]['father_node']]['layer_content'] .= $t_sub->parse('separator_blck', 'separator');
if ($this->tree[$cnt]['not_a_leaf']) {
$this->tree[$cnt]['onmouseover'] = ' onmouseover="moveLayerX(' . "'" . $this->tree[$cnt]['layer_label'] . "') ; moveLayerY('" . $this->tree[$cnt]['layer_label'] . "') ; LMPopUp('" . $this->tree[$cnt]['layer_label'] . "'". ', false);"';
$this->tree[$cnt]['onmouseover'] = ' onmouseover="LMPopUp(' . "'" . $this->tree[$this->tree[$cnt]['father_node']]['layer_label'] . "'" . ', true);"';
'imgwww' => $this->imgwww,
'transparent' => $this->transparentIcon,
'href' => $this->tree[$cnt]['parsed_href'],
'refid' => 'ref' . $this->tree[$cnt]['layer_label'],
'onmouseover' => $this->tree[$cnt]['onmouseover'],
'title' => $this->tree[$cnt]['parsed_title'],
'target' => $this->tree[$cnt]['parsed_target'],
'text' => $this->tree[$cnt]['text'],
'arrowsrc' => $this->forwardArrowImg['src'],
'arrowwidth' => $this->forwardArrowImg['width'],
'arrowheight' => $this->forwardArrowImg['height']
if ($this->_hasIcons[$this->tree[$cnt]['father_node']]) {
'iconsrc' => $this->tree[$cnt]['iconsrc'],
'iconwidth' => $this->tree[$cnt]['iconwidth'],
'iconheight' => $this->tree[$cnt]['iconheight'],
'iconalt' => $this->tree[$cnt]['iconalt']
$t_sub->parse('cell_icon_blck', 'cell_icon');
$t_sub->setVar('cell_icon_blck', '');
if ($this->tree[$cnt]['not_a_leaf']) {
$t_sub->parse('cell_arrow_blck', 'cell_arrow');
$t_sub->setVar('cell_arrow_blck', '');
$this->tree[$this->tree[$cnt]['father_node']]['layer_content'] .= $t_sub->parse('sub_menu_cell_blck', 'sub_menu_cell');
} // end of the "for" cycle scanning all nodes
$foobar = $this->_firstLevelCnt[$menu_name] * $this->abscissaStep;
$t->setVar('menuwidth', $foobar);
'layer_label' => $menu_name,
'menubody' => $this->_firstLevelMenu[$menu_name]
$this->_firstLevelMenu[$menu_name] = $t->parse('template_blck', 'template');
$this->_updateFooter($menu_name);
return $this->_firstLevelMenu[$menu_name];
* Method to preparare a vertical menu.
* This method processes items of a menu to prepare the corresponding
* vertical menu code updating many variables; it returns the code
* of the corresponding _firstLevelMenu
* @param string $menu_name the name of the menu whose items have to be processed
$menu_name = '' // non consistent default...
if (!isset($this->_firstItem[$menu_name]) || !isset($this->_lastItem[$menu_name])) {
$this->error("newVerticalMenu: the first/last item of the menu ' $menu_name' is not defined; please check if you have parsed its menu data. ");
$this->parseCommon($menu_name);
$t = new Template_PHPLIB();
$t->setFile('tplfile', $this->verticalMenuTpl);
$t->setBlock('tplfile', 'template', 'template_blck');
$t->setBlock('template', 'vertical_menu_box', 'vertical_menu_box_blck');
$t->setVar('vertical_menu_box_blck', '');
$t->setBlock('vertical_menu_box', 'vertical_menu_cell', 'vertical_menu_cell_blck');
$t->setVar('vertical_menu_cell_blck', '');
$t->setBlock('vertical_menu_cell', 'cell_icon', 'cell_icon_blck');
$t->setVar('cell_icon_blck', '');
$t->setBlock('vertical_menu_cell', 'cell_arrow', 'cell_arrow_blck');
$t->setVar('cell_arrow_blck', '');
$t->setBlock('vertical_menu_box', 'separator', 'separator_blck');
$t->setVar('separator_blck', '');
$t_sub = new <a href="../Zikula 1.0.1/Template_PHPLIB.html">Template_PHPLIB</a>();
$t_sub->setFile('tplfile', $this->subMenuTpl);
$t_sub->setBlock('tplfile', 'sub_menu_cell', 'sub_menu_cell_blck');
$t_sub->setVar('sub_menu_cell_blck', '');
$t_sub->setBlock('sub_menu_cell', 'cell_icon', 'cell_icon_blck');
$t_sub->setVar('cell_icon_blck', '');
$t_sub->setBlock('sub_menu_cell', 'cell_arrow', 'cell_arrow_blck');
$t_sub->setVar('cell_arrow_blck', '');
$t_sub->setBlock('tplfile', 'separator', 'separator_blck');
$t_sub->setVar('separator_blck', '');
$this->_firstLevelMenu[$menu_name] = '';
$this->moveLayers .= "\tvar " . $menu_name . "TOP = getOffsetTop('" . $menu_name . "');\n";
$this->moveLayers .= "\tvar " . $menu_name . "LEFT = getOffsetLeft('" . $menu_name . "');\n";
$this->moveLayers .= "\tvar " . $menu_name . "WIDTH = getOffsetWidth('" . $menu_name . "');\n";
for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) { // this counter scans all nodes of the new menu
if ($this->tree[$cnt]['not_a_leaf']) {
// geometrical parameters are assigned to the new layer, related to the above mentioned children
if ($this->tree[$cnt]['child_of_root_node']) {
$this->moveLayers .= "\tsetLeft('" . $this->tree[$cnt]['layer_label'] . "', " . $menu_name . "LEFT + " . $menu_name . "WIDTH - menuRightShift);\n";
if ($this->tree[$cnt]['child_of_root_node']) {
if ($this->tree[$cnt]['text'] == '---') {
$this->_firstLevelMenu[$menu_name] .= $t->parse('separator_blck', 'separator');
if ($this->tree[$cnt]['not_a_leaf']) {
$this->tree[$cnt]['onmouseover'] = ' onmouseover="moveLayerX(' . "'" . $this->tree[$cnt]['layer_label'] . "') ; moveLayerY('" . $this->tree[$cnt]['layer_label'] . "') ; LMPopUp('" . $this->tree[$cnt]['layer_label'] . "'" . ', false);"';
$this->tree[$cnt]['onmouseover'] = ' onmouseover="shutdown();"';
'imgwww' => $this->imgwww,
'transparent' => $this->transparentIcon,
'href' => $this->tree[$cnt]['parsed_href'],
'refid' => 'ref' . $this->tree[$cnt]['layer_label'],
'onmouseover' => $this->tree[$cnt]['onmouseover'],
'title' => $this->tree[$cnt]['parsed_title'],
'target' => $this->tree[$cnt]['parsed_target'],
'text' => $this->tree[$cnt]['text'],
'arrowsrc' => $this->forwardArrowImg['src'],
'arrowwidth' => $this->forwardArrowImg['width'],
'arrowheight' => $this->forwardArrowImg['height']
if ($this->_hasIcons[$menu_name]) {
'iconsrc' => $this->tree[$cnt]['iconsrc'],
'iconwidth' => $this->tree[$cnt]['iconwidth'],
'iconheight' => $this->tree[$cnt]['iconheight'],
'iconalt' => $this->tree[$cnt]['iconalt']
$t->parse('cell_icon_blck', 'cell_icon');
$t->setVar('cell_icon_blck', '');
if ($this->tree[$cnt]['not_a_leaf']) {
$t->parse('cell_arrow_blck', 'cell_arrow');
$t->setVar('cell_arrow_blck', '');
$this->_firstLevelMenu[$menu_name] .= $t->parse('vertical_menu_cell_blck', 'vertical_menu_cell');
if ($this->tree[$cnt]['text'] == '---') {
$this->tree[$this->tree[$cnt]['father_node']]['layer_content'] .= $t_sub->parse('separator_blck', 'separator');
if ($this->tree[$cnt]['not_a_leaf']) {
$this->tree[$cnt]['onmouseover'] = ' onmouseover="moveLayerX(' . "'" . $this->tree[$cnt]['layer_label'] . "') ; moveLayerY('" . $this->tree[$cnt]['layer_label'] . "') ; LMPopUp('" . $this->tree[$cnt]['layer_label'] . "'" . ', false);"';
$this->tree[$cnt]['onmouseover'] = ' onmouseover="LMPopUp(' . "'" . $this->tree[$this->tree[$cnt]['father_node']]['layer_label'] . "'" . ', true);"';
'imgwww' => $this->imgwww,
'transparent' => $this->transparentIcon,
'href' => $this->tree[$cnt]['parsed_href'],
'refid' => 'ref' . $this->tree[$cnt]['layer_label'],
'onmouseover' => $this->tree[$cnt]['onmouseover'],
'title' => $this->tree[$cnt]['parsed_title'],
'target' => $this->tree[$cnt]['parsed_target'],
'text' => $this->tree[$cnt]['text'],
'arrowsrc' => $this->forwardArrowImg['src'],
'arrowwidth' => $this->forwardArrowImg['width'],
'arrowheight' => $this->forwardArrowImg['height']
if ($this->_hasIcons[$this->tree[$cnt]['father_node']]) {
'iconsrc' => $this->tree[$cnt]['iconsrc'],
'iconwidth' => $this->tree[$cnt]['iconwidth'],
'iconheight' => $this->tree[$cnt]['iconheight'],
'iconalt' => $this->tree[$cnt]['iconalt']
$t_sub->parse('cell_icon_blck', 'cell_icon');
$t_sub->setVar('cell_icon_blck', '');
if ($this->tree[$cnt]['not_a_leaf']) {
$t_sub->parse('cell_arrow_blck', 'cell_arrow');
$t_sub->setVar('cell_arrow_blck', '');
$this->tree[$this->tree[$cnt]['father_node']]['layer_content'] .= $t_sub->parse('sub_menu_cell_blck', 'sub_menu_cell');
} // end of the "for" cycle scanning all nodes
'menu_name' => $menu_name,
'vertical_menu_cell_blck' => $this->_firstLevelMenu[$menu_name],
$this->_firstLevelMenu[$menu_name] = $t->parse('vertical_menu_box_blck', 'vertical_menu_box');
$t->setVar('abscissaStep', $this->abscissaStep);
'layer_label' => $menu_name,
'vertical_menu_box_blck' => $this->_firstLevelMenu[$menu_name]
$this->_firstLevelMenu[$menu_name] = $t->parse('template_blck', 'template');
$this->_updateFooter($menu_name);
return $this->_firstLevelMenu[$menu_name];
* Method to prepare the header.
* This method obtains the header using collected informations
* and the suited JavaScript template; it returns the code of the header
$t = new <a href="../Zikula 1.0.1/Template_PHPLIB.html">Template_PHPLIB</a>();
$this->listl = 'listl = [' . substr($this->listl, 1) . '];';
$this->father_keys = 'father_keys = [' . substr($this->father_keys, 1) . '];';
$this->father_vals = 'father_vals = [' . substr($this->father_vals, 1) . '];';
$t->setFile('tplfile', $this->libjsdir . 'layersmenu-header.ijs');
'packageName' => $this->_packageName,
'version' => $this->version,
'copyright' => $this->copyright,
'author' => $this->author,
'menuTopShift' => $this->menuTopShift,
'menuRightShift'=> $this->menuRightShift,
'menuLeftShift' => $this->menuLeftShift,
'thresholdY' => $this->thresholdY,
'abscissaStep' => $this->abscissaStep,
'nodesCount' => $this->_nodesCount,
'father_keys' => $this->father_keys,
'father_vals' => $this->father_vals,
'moveLayers' => $this->moveLayers
$this->header = $t->parse('out', 'tplfile');
$this->_headerHasBeenMade = true;
* Method that returns the code of the header
if (!$this->_headerHasBeenMade) {
* Method that prints the code of the header
* Method that returns the code of the requested _firstLevelMenu
* @param string $menu_name the name of the menu whose _firstLevelMenu
return $this->_firstLevelMenu[$menu_name];
* Method that prints the code of the requested _firstLevelMenu
* @param string $menu_name the name of the menu whose _firstLevelMenu
print $this->_firstLevelMenu[$menu_name];
* Method to prepare the footer.
* This method obtains the footer using collected informations
* and the suited JavaScript template; it returns the code of the footer
$t = new <a href="../Zikula 1.0.1/Template_PHPLIB.html">Template_PHPLIB</a>();
$t->setFile('tplfile', $this->libjsdir . 'layersmenu-footer.ijs');
'packageName' => $this->_packageName,
'version' => $this->version,
'copyright' => $this->copyright,
'author' => $this->author,
'footer' => $this->footer
$this->footer = $t->parse('out', 'tplfile');
$this->_footerHasBeenMade = true;
* Method that returns the code of the footer
if (!$this->_footerHasBeenMade) {
* Method that prints the code of the footer
|