aboutsummaryrefslogtreecommitdiff
path: root/h-source/Library/Helper/Menu.php
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2012-02-18 00:07:50 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2012-02-18 00:07:50 +0000
commit14691cd854be3e9ee272c9619a6368c83d72267b (patch)
tree89215d53db8d6f01bb24a5c1d30d9dd4c8d7a5b9 /h-source/Library/Helper/Menu.php
parenta2c0b2c4f80463a94e2dd87b59f193ab3aa925eb (diff)
upload new EasyGiant library and added added a new filter for the model name (part 2)
Diffstat (limited to 'h-source/Library/Helper/Menu.php')
-rwxr-xr-xh-source/Library/Helper/Menu.php61
1 files changed, 39 insertions, 22 deletions
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']) ? "<img class='top_menu_icon' src='".$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 .= "<div $class><a $title href='$href'>$text</a></div>\n";
+ $menu .= "<div $class>$icon <a $title href='$href'>$text</a></div>\n";
}
}
}