From dff8807158189c87bbde0e474d1e776943b76a4a Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 31 Jul 2009 15:14:44 -0600 Subject: [PATCH] Need to add popup localized text in here so it is always included, even if popup.js is directly included --- framework/Core/lib/Horde.php | 13 +------------ framework/Core/lib/Horde/Script/Files.php | 5 +++++ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/framework/Core/lib/Horde.php b/framework/Core/lib/Horde.php index d20745d01..7d479eced 100644 --- a/framework/Core/lib/Horde.php +++ b/framework/Core/lib/Horde.php @@ -64,13 +64,6 @@ class Horde static protected $_inlineScript = array(); /** - * Has popupJs been called? - * - * @var boolean - */ - static protected $_popupjscalled = false; - - /** * Logs a message to the global Horde log backend. * * @param mixed $message Either a string or an object with a @@ -2176,11 +2169,7 @@ HTML; */ static public function popupJs($url, $options = array()) { - if (!self::$_popupjscalled) { - Horde::addScriptFile('popup.js', 'horde', true); - Horde::addInlineScript('Horde.popup_block_text=' . Horde_Serialize::serialize(_("A popup window could not be opened. Your browser may be blocking popups."), Horde_Serialize::JSON), 'dom'); - self::$_popupjscalled = true; - } + Horde::addScriptFile('popup.js', 'horde', true); $params = new stdClass; $pos = strpos($url, '?'); diff --git a/framework/Core/lib/Horde/Script/Files.php b/framework/Core/lib/Horde/Script/Files.php index 821ef8351..6f77f6e5e 100644 --- a/framework/Core/lib/Horde/Script/Files.php +++ b/framework/Core/lib/Horde/Script/Files.php @@ -125,6 +125,11 @@ class Horde_Script_Files $this->add('prototype.js', 'horde', true); } + // Add localized string for popup.js + if (($file == 'popup.js') && ($app = 'horde')) { + Horde::addInlineScript('Horde.popup_block_text=' . Horde_Serialize::serialize(_("A popup window could not be opened. Your browser may be blocking popups."), Horde_Serialize::JSON), 'dom'); + } + // Explicitly check for a directly serve-able version of the script. $path = $registry->get('fileroot', $app); if (!$direct && -- 2.11.0