From 14691cd854be3e9ee272c9619a6368c83d72267b Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Sat, 18 Feb 2012 00:07:50 +0000 Subject: upload new EasyGiant library and added added a new filter for the model name (part 2) --- h-source/Library/Helper/Menu.php | 61 +++++++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 22 deletions(-) (limited to 'h-source/Library/Helper/Menu.php') diff --git a/h-source/Library/Helper/Menu.php b/h-source/Library/Helper/Menu.php index 608795f..8fd4bf4 100755 --- a/h-source/Library/Helper/Menu.php +++ b/h-source/Library/Helper/Menu.php @@ -29,30 +29,46 @@ class Helper_Menu extends Helper_Html public $panelController; //panel controller public $controller; - public $links = array( + public $links = array(); + + //instance of Lang_{language}_Generic + public $strings = null; - 'back' => array( - 'title' => 'back', - 'class' => 'mainMenuItem', - 'text' => 'Back', - 'url' => 'main' - ), - - 'add' => array( - 'title' => 'add a new record', - 'class' => 'mainMenuItem', - 'text' => 'Add', - 'url' => 'form/insert' - ), + public function __construct() + { + $baseUrl = "http://".DOMAIN_NAME.'/Public/Img/Icons/elementary_2_5/'; - 'panel' => array( - 'title' => 'back to the Panel', - 'class' => 'mainMenuItem', - 'text' => 'Panel', - 'url' => 'main' - ) + //get the generic language class + $this->strings = Factory_Strings::generic(Params::$language); - ); + $this->links = array( + + 'back' => array( + 'title' => $this->strings->gtext('back'), + 'class' => 'mainMenuItem', + 'text' => $this->strings->gtext('Back'), + 'url' => 'main', + 'icon' => $baseUrl."left.png", + ), + + 'add' => array( + 'title' => $this->strings->gtext('add a new record'), + 'class' => 'mainMenuItem', + 'text' => $this->strings->gtext('Add'), + 'url' => 'form/insert', + 'icon' => $baseUrl."add.png", + ), + + 'panel' => array( + 'title' => $this->strings->gtext('back to the Panel'), + 'class' => 'mainMenuItem', + 'text' => $this->strings->gtext('Panel'), + 'url' => 'main', + 'icon' => $baseUrl."panel.png", + ) + + ); + } public function build($controller = null, $panelController = null) { @@ -75,6 +91,7 @@ class Helper_Menu extends Helper_Html { $title = isset($this->links[$linkName]['title']) ? "title='".$this->links[$linkName]['title']."'" : null; $class = isset($this->links[$linkName]['class']) ? "class='".$this->links[$linkName]['class']."'" : null; + $icon = isset($this->links[$linkName]['icon']) ? " " : null; //choose the controller (current or panel) $controller = (strcmp($linkName,'panel') === 0) ? $this->panelController.'/' : $this->controller.'/'; @@ -82,7 +99,7 @@ class Helper_Menu extends Helper_Html $href = Url::getRoot($controller.$this->links[$linkName]['url'].$viewStatus); $text = $this->links[$linkName]['text']; - $menu .= "
$text
\n"; + $menu .= "
$icon $text
\n"; } } } -- cgit v1.2.3