From 11972639df8315753123ebccdadee1f596807ad0 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Tue, 16 Sep 2014 08:03:29 +0000 Subject: Integrated new EasyGiant Library --- h-source/Library/Helper/Popup.php | 44 ++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 15 deletions(-) (limited to 'h-source/Library/Helper/Popup.php') diff --git a/h-source/Library/Helper/Popup.php b/h-source/Library/Helper/Popup.php index 4f67a5c..f3e6058 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 - 2011 Antonio Gallo +// Copyright (C) 2009 - 2014 Antonio Gallo (info@laboratoriolibero.com) // See COPYRIGHT.txt and LICENSE.txt. // // This file is part of EasyGiant @@ -25,6 +25,15 @@ 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" => "
\n", + "bottom" => "
", + "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 @@ -85,9 +94,17 @@ 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 = null; + $returnString = self::$popupHtml["before_loop"]; if ($this->checkViewArgs()) { if (isset($this->viewArgs[$this->pageArg])) @@ -104,11 +121,12 @@ class Helper_Popup extends Helper_Html { $tempArg = $this->viewArgs[$field]; $this->legend[$field] = $tempArg; - $returnString .= "\n"; + $returnString .= self::$popupHtml["middle"]; $this->viewArgs[$field] = $tempArg; - } - if ($this->printLegend) - { - $returnString .= "\n"; - } - if (count($this->popupArray)>0) { - $returnString .= "\n"; + + $returnString .= self::$popupHtml["bottom"]; } } + $returnString .= self::$popupHtml["after_loop"]; return $returnString; } -- cgit v1.2.3