aboutsummaryrefslogtreecommitdiff
path: root/h-source/Library/Helper/Popup.php
diff options
context:
space:
mode:
Diffstat (limited to 'h-source/Library/Helper/Popup.php')
-rwxr-xr-xh-source/Library/Helper/Popup.php46
1 files changed, 16 insertions, 30 deletions
diff --git a/h-source/Library/Helper/Popup.php b/h-source/Library/Helper/Popup.php
index f3e6058..18bb00d 100755
--- a/h-source/Library/Helper/Popup.php
+++ b/h-source/Library/Helper/Popup.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,15 +25,6 @@ if (!defined('EG')) die('Direct access not allowed!');
//class to create the popup menu
class Helper_Popup extends Helper_Html {
- //the HTML of the popup
- public static $popupHtml = array(
- "before_loop" => "",
- "top" => "<div class='row col-md-2 ext_menu_block ext_menu_block_[[field]]'><ul class='menuBlock'><li class='innerItem inner_item_[[field]]'>[[name]]<ul class='innerList'>\n",
- "middle" => "</ul>\n</li>\n</ul>\n",
- "bottom" => "</div>",
- "after_loop" => "",
- );
-
public $popupArray = array(); //array of popup objects (see popup.php)
public $url = null; //the url (controller/action) to link by means of the popup menĂ¹
// public $fieldArg = null; //the key of the viewArgs array to set to the field in the where clause
@@ -94,17 +85,9 @@ class Helper_Popup extends Helper_Html {
}
}
- public function replacePlaceholders($string, $field, $name)
- {
- $string = str_replace("[[field]]",$field,$string);
- $string = str_replace("[[name]]",$name,$string);
-
- return $string;
- }
-
//create the HTML of the popup
public function render() {
- $returnString = self::$popupHtml["before_loop"];
+ $returnString = null;
if ($this->checkViewArgs())
{
if (isset($this->viewArgs[$this->pageArg]))
@@ -121,12 +104,11 @@ class Helper_Popup extends Helper_Html {
$tempArg = $this->viewArgs[$field];
$this->legend[$field] = $tempArg;
- $returnString .= $this->replacePlaceholders(self::$popupHtml["top"],$field,$popup->name);
-
+ $returnString .= "<ul onMouseOver='DisplayTag(this,\"block\");' onMouseOut='DisplayTag(this,\"none\");' id='menuBlock'><li class='innerItem'>".$popup->name."<ul class='innerList'>\n";
for ($i = 0; $i < count($popup->itemsValue); $i++)
{
$this->viewArgs[$field] = $popup->itemsValue[$i];
- $viewStatus = Url::createUrl($this->viewArgs);
+ $viewStatus = Url::createUrl(array_values($this->viewArgs));
$returnString .= "<li><a href='".Url::getRoot($this->url).$viewStatus."'>".$popup->itemsName[$i]."</a></li>\n";
//set the legend
@@ -136,20 +118,24 @@ class Helper_Popup extends Helper_Html {
}
}
$this->viewArgs[$field] = Params::$nullQueryValue;
- $viewStatus = Url::createUrl($this->viewArgs);
+ $viewStatus = Url::createUrl(array_values($this->viewArgs));
$returnString .= "<li><a href='".Url::getRoot($this->url).$viewStatus."'>".$this->allString."</a></li>\n";
- $returnString .= self::$popupHtml["middle"];
+ $returnString .= "</ul>\n</li>\n</ul>\n";
$this->viewArgs[$field] = $tempArg;
-
- if ($this->printLegend)
+ }
+ if ($this->printLegend)
+ {
+ $returnString .= "<div class='popup_legend'>\n";
+ foreach ($this->popupArray as $field => $popup)
{
- $returnString .= "<div class='popup_legend_item popup_legend_item_$field'>".$this->legend[$field]."</div>";
+ $returnString .= "<div class='popup_legend_item'>".$this->legend[$field]."</div>";
}
-
- $returnString .= self::$popupHtml["bottom"];
+ $returnString .= "</div>\n";
+ }
+ if (count($this->popupArray)>0) {
+ $returnString .= "<script type=\"text/javascript\" src=\"http://".DOMAIN_NAME."/Public/Js/DisplayTag.js\"></script>\n";
}
}
- $returnString .= self::$popupHtml["after_loop"];
return $returnString;
}