From 308611d60031547c257598e8eaad30d6c1d4cba0 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Sat, 17 Jan 2009 16:46:32 -0700 Subject: [PATCH] Better PHP 5 static usage. --- imp/lib/Imple/ContactAutoCompleter.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/imp/lib/Imple/ContactAutoCompleter.php b/imp/lib/Imple/ContactAutoCompleter.php index 64ef9ee33..ef24175f6 100644 --- a/imp/lib/Imple/ContactAutoCompleter.php +++ b/imp/lib/Imple/ContactAutoCompleter.php @@ -18,6 +18,13 @@ class IMP_Imple_ContactAutoCompleter extends IMP_Imple protected $_url; /** + * Has the address book been output to the browser? + * + * @var boolean + */ + static protected $_listOutput = false; + + /** * Constructor. * * @param array $params Configuration parameters. @@ -43,8 +50,6 @@ class IMP_Imple_ContactAutoCompleter extends IMP_Imple */ public function attach() { - static $list_output = false; - parent::attach(); Horde::addScriptFile('autocomplete.js', 'imp', true); @@ -87,12 +92,12 @@ class IMP_Imple_ContactAutoCompleter extends IMP_Imple $js_params[] = 'minChars: ' . intval($GLOBALS['conf']['compose']['ac_threshold'] ? $GLOBALS['conf']['compose']['ac_threshold'] : 1); } else { - if (!$list_output) { + if (!self::$_listOutput) { if (!isset($addrlist)) { $addrlist = IMP_Compose::getAddressList(); } IMP::addInlineScript('if (!IMP) { var IMP = {}; } IMP.ac_list = '. Horde_Serialize::serialize(array_map('htmlspecialchars', $addrlist), SERIALIZE_JSON, NLS::getCharset())); - $list_output = true; + self::$_listOutput = true; } $func = 'Autocompleter.Local'; $params[] = 'IMP.ac_list'; -- 2.11.0