diff options
author | Yuchen Pei <me@ypei.me> | 2021-07-29 14:17:20 +1000 |
---|---|---|
committer | Yuchen Pei <me@ypei.me> | 2021-07-29 14:17:20 +1000 |
commit | 3ff03dc4f0a72432b34c00da620272cf011e4ddd (patch) | |
tree | 5746711ba17a91aed56c6529ea8cceb06c3ad16a /h-source/Library/Helper/Menu.php | |
parent | cd4534aa10ba3b122963992741721289fa50d0ab (diff) |
Publishing h-node.org code.
- this is the h-node.org code, except
- removed a js file (3x copies at three different locations) without license / copyright headers
- /Js/linkToForm.js
- /Public/Js/linkToForm.js
- /admin/Public/Js/linkToForm.js
- removed config files containing credentials
- /Application/Include/params.php
- /Config/Config.php
- /admin/Application/Include/params.php
- /admin/Config/Config.php
- added license and copyright header to one php file
- /admin/Library/ErrorReporting.php (almost identical to /Library/ErrorReporting.php which has the headers)
Diffstat (limited to 'h-source/Library/Helper/Menu.php')
-rwxr-xr-x | h-source/Library/Helper/Menu.php | 40 |
1 files changed, 4 insertions, 36 deletions
diff --git a/h-source/Library/Helper/Menu.php b/h-source/Library/Helper/Menu.php index 4b33261..8fd4bf4 100755 --- a/h-source/Library/Helper/Menu.php +++ b/h-source/Library/Helper/Menu.php @@ -2,7 +2,7 @@ // EasyGiant is a PHP framework for creating and managing dynamic content // -// Copyright (C) 2009 - 2014 Antonio Gallo (info@laboratoriolibero.com) +// Copyright (C) 2009 - 2011 Antonio Gallo // See COPYRIGHT.txt and LICENSE.txt. // // This file is part of EasyGiant @@ -25,8 +25,7 @@ if (!defined('EG')) die('Direct access not allowed!'); //class to write the top menĂ¹ of the view files class Helper_Menu extends Helper_Html { - public static $htmlLinks = array(); - + public $panelController; //panel controller public $controller; @@ -50,7 +49,6 @@ class Helper_Menu extends Helper_Html 'text' => $this->strings->gtext('Back'), 'url' => 'main', 'icon' => $baseUrl."left.png", - 'queryString' => null, ), 'add' => array( @@ -59,7 +57,6 @@ class Helper_Menu extends Helper_Html 'text' => $this->strings->gtext('Add'), 'url' => 'form/insert', 'icon' => $baseUrl."add.png", - 'queryString' => null, ), 'panel' => array( @@ -68,25 +65,9 @@ class Helper_Menu extends Helper_Html 'text' => $this->strings->gtext('Panel'), 'url' => 'main', 'icon' => $baseUrl."panel.png", - 'queryString' => null, ) ); - - foreach (self::$htmlLinks as $k => $v) - { - if (!array_key_exists($k, $this->links)) - { - $this->links[$k] = $v; - } - else - { - foreach ($v as $subK => $subV) - { - $this->links[$k][$subK] = $subV; - } - } - } } public function build($controller = null, $panelController = null) @@ -108,11 +89,8 @@ class Helper_Menu extends Helper_Html //check that the text and the ure are defined if (isset($this->links[$linkName]['text']) and isset($this->links[$linkName]['url'])) { - $title = isset($this->links[$linkName]['title']) ? "title=\"".$this->links[$linkName]['title']."\"" : null; - + $title = isset($this->links[$linkName]['title']) ? "title='".$this->links[$linkName]['title']."'" : null; $class = isset($this->links[$linkName]['class']) ? "class='".$this->links[$linkName]['class']."'" : null; - $class = isset(self::$htmlLinks[$linkName]["class"]) ? "class='".self::$htmlLinks[$linkName]["class"]."'" : $class; - $icon = isset($this->links[$linkName]['icon']) ? "<img class='top_menu_icon' src='".$this->links[$linkName]['icon']."'> " : null; //choose the controller (current or panel) @@ -120,18 +98,8 @@ class Helper_Menu extends Helper_Html $viewStatus = (strcmp($linkName,'panel') === 0) ? null : $this->viewStatus; $href = Url::getRoot($controller.$this->links[$linkName]['url'].$viewStatus); - - if (isset($this->links[$linkName]['queryString'])) - { - $href .= $this->links[$linkName]['queryString']; - } - $text = $this->links[$linkName]['text']; - $htmlBefore = isset($this->links[$linkName]["htmlBefore"]) ? $this->links[$linkName]["htmlBefore"] : "<div $class>$icon "; - $htmlAfter = isset($this->links[$linkName]["htmlAfter"]) ? $this->links[$linkName]["htmlAfter"] : "</div>"; - $attributes = isset($this->links[$linkName]["attributes"]) ? $this->links[$linkName]["attributes"] : null; - - $menu .= "$htmlBefore<a $title $attributes href='$href'>$text</a>$htmlAfter\n"; + $menu .= "<div $class>$icon <a $title href='$href'>$text</a></div>\n"; } } } |