From: Michael M Slusarz Date: Fri, 13 Feb 2009 04:39:18 +0000 (-0700) Subject: Convert to new Horde_Serialize constant usage. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e0d5c61901c45e599505d09bb5a7b3f9d3db9783;p=horde.git Convert to new Horde_Serialize constant usage. --- diff --git a/chora/templates/common-header.inc b/chora/templates/common-header.inc index 3be56f2ff..77d81ecda 100644 --- a/chora/templates/common-header.inc +++ b/chora/templates/common-header.inc @@ -13,7 +13,7 @@ if (!empty($refresh_time) && ($refresh_time > 0) && !empty($refresh_url)) { if (Util::nonInputVar('js_vars')) { echo '\n"; + 'var Chora = ' . Horde_Serialize::serialize($js_vars, Horde_Serialize::JSON, NLS::getCharset()) . ";\n//]]>\n"; } Horde::includeScriptFiles(); diff --git a/drag_n_drop_portal/block.php b/drag_n_drop_portal/block.php index d105d908d..c0bca33e3 100644 --- a/drag_n_drop_portal/block.php +++ b/drag_n_drop_portal/block.php @@ -34,4 +34,4 @@ if ($block instanceof PEAR_Error) { } } -echo Horde_Serialize::serialize($block_data, SERIALIZE_JSON, NLS::getCharset()); +echo Horde_Serialize::serialize($block_data, Horde_Serialize::JSON, NLS::getCharset()); diff --git a/drag_n_drop_portal/lib/Block/Layout/View/js.php b/drag_n_drop_portal/lib/Block/Layout/View/js.php index e8f80653e..161b80acb 100644 --- a/drag_n_drop_portal/lib/Block/Layout/View/js.php +++ b/drag_n_drop_portal/lib/Block/Layout/View/js.php @@ -95,9 +95,9 @@ class Horde_Block_Layout_View_Js extends Horde_Block_Layout_View { } } - $content = Horde_Serialize::serialize($content, SERIALIZE_JSON, NLS::getCharset()); - $title = Horde_Serialize::serialize($title, SERIALIZE_JSON, NLS::getCharset()); - $params = Horde_Serialize::serialize($params, SERIALIZE_JSON, NLS::getCharset()); + $content = Horde_Serialize::serialize($content, Horde_Serialize::JSON, NLS::getCharset()); + $title = Horde_Serialize::serialize($title, Horde_Serialize::JSON, NLS::getCharset()); + $params = Horde_Serialize::serialize($params, Horde_Serialize::JSON, NLS::getCharset()); $js_init .= 'portal.add(new Xilinus.Widget().' . 'setTitle(title_' . $js_id .').' diff --git a/framework/Service_Vimeo/doc/vimeo_example.php b/framework/Service_Vimeo/doc/vimeo_example.php index de0be924b..04e5f2d7b 100644 --- a/framework/Service_Vimeo/doc/vimeo_example.php +++ b/framework/Service_Vimeo/doc/vimeo_example.php @@ -27,5 +27,5 @@ $embed = $v->getEmbedJson($latest['url']); // Decode the data and print out the HTML. You could also just output // the json within your page's javascript for use later etc... -$results = Horde_Serialize::unserialize($embed, SERIALIZE_JSON); +$results = Horde_Serialize::unserialize($embed, Horde_Serialize::JSON); echo $results->html; diff --git a/imp/ajax.php b/imp/ajax.php index 6bbf92246..621dc9e3e 100644 --- a/imp/ajax.php +++ b/imp/ajax.php @@ -85,7 +85,7 @@ function _getListMessages($mbox, $change) 'slice_end' => intval($slice_end) ); } else { - $search = Horde_Serialize::unserialize($search, SERIALIZE_JSON); + $search = Horde_Serialize::unserialize($search, Horde_Serialize::JSON); $args += array( 'search_uid' => $search->imapuid, 'search_view' => $search->view, @@ -379,7 +379,7 @@ case 'MarkMessage': if (!$flags || empty($indices)) { break; } - $flags = Horde_Serialize::unserialize($flags, SERIALIZE_JSON); + $flags = Horde_Serialize::unserialize($flags, Horde_Serialize::JSON); $set = $notset = array(); foreach ($flags as $val) { diff --git a/imp/compose-dimp.php b/imp/compose-dimp.php index 5b4f9c777..c375a2365 100644 --- a/imp/compose-dimp.php +++ b/imp/compose-dimp.php @@ -311,7 +311,7 @@ IMP::addInlineScript($compose_result['js']); IMP::addInlineScript(array(DIMP::notify()), 'dom'); /* Javascript to be run on window load. */ -$compose_result['js_onload'][] = 'DimpCompose.fillForm(' . Horde_Serialize::serialize($msg, SERIALIZE_JSON) . ', ' . Horde_Serialize::serialize($header, SERIALIZE_JSON) . ', "' . (($type == 'new' || $type == 'forward') ? 'to' : 'message') . '", true)'; +$compose_result['js_onload'][] = 'DimpCompose.fillForm(' . Horde_Serialize::serialize($msg, Horde_Serialize::JSON) . ', ' . Horde_Serialize::serialize($header, Horde_Serialize::JSON) . ', "' . (($type == 'new' || $type == 'forward') ? 'to' : 'message') . '", true)'; IMP::addInlineScript($compose_result['js_onload'], 'load'); $scripts = array( diff --git a/imp/compose.php b/imp/compose.php index 0d2b70c92..c3e3389af 100644 --- a/imp/compose.php +++ b/imp/compose.php @@ -798,7 +798,7 @@ if (!$redirect) { Horde_Mime_Address::addrArray2String($identity->getBccAddresses($ident)) ); } - $js_code[] = 'ImpCompose.identities = ' . Horde_Serialize::serialize($js_ident, SERIALIZE_JSON, NLS::getCharset()); + $js_code[] = 'ImpCompose.identities = ' . Horde_Serialize::serialize($js_ident, Horde_Serialize::JSON, NLS::getCharset()); } diff --git a/imp/fetchmailprefs.php b/imp/fetchmailprefs.php index ba2d268ea..519124b82 100644 --- a/imp/fetchmailprefs.php +++ b/imp/fetchmailprefs.php @@ -190,8 +190,8 @@ Horde::addScriptFile('fetchmailprefs.js', 'imp', true); $charset = NLS::getCharset(); IMP::addInlineScript(array( - 'ImpFetchmailprefs.fetchurl = ' . Horde_Serialize($fetch_url, SERIALIZE_JSON, $charset), - 'ImpFetchmailprefs.prefsurl = ' . Horde_Serialize($prefs_url, SERIALIZE_JSON, $charset) + 'ImpFetchmailprefs.fetchurl = ' . Horde_Serialize($fetch_url, Horde_Serialize::JSON, $charset), + 'ImpFetchmailprefs.prefsurl = ' . Horde_Serialize($prefs_url, Horde_Serialize::JSON, $charset) )); echo $t->fetch(IMP_TEMPLATES . '/fetchmail/fetchmailprefs.html'); diff --git a/imp/folders.php b/imp/folders.php index 1edef3fd8..a6ec82259 100644 --- a/imp/folders.php +++ b/imp/folders.php @@ -346,8 +346,8 @@ if ($_SESSION['imp']['file_upload'] && ($actionID == 'import_mbox')) { list($raw_rows, $newmsgs, $displayNames) = $imaptree->build(); IMP::addInlineScript(array( - 'ImpFolders.displayNames = ' . Horde_Serialize::serialize($displayNames, SERIALIZE_JSON, $charset), - 'ImpFolders.folders_url = ' . Horde_Serialize::serialize($folders_url, SERIALIZE_JSON, $charset) + 'ImpFolders.displayNames = ' . Horde_Serialize::serialize($displayNames, Horde_Serialize::JSON, $charset), + 'ImpFolders.folders_url = ' . Horde_Serialize::serialize($folders_url, Horde_Serialize::JSON, $charset) )); /* Prepare the header template. */ diff --git a/imp/lib/DIMP.php b/imp/lib/DIMP.php index f2e110772..0229412d8 100644 --- a/imp/lib/DIMP.php +++ b/imp/lib/DIMP.php @@ -257,7 +257,7 @@ class DIMP )); } - return array('var DIMP = ' . Horde_Serialize::serialize($code, SERIALIZE_JSON, NLS::getCharset()) . ';'); + return array('var DIMP = ' . Horde_Serialize::serialize($code, Horde_Serialize::JSON, NLS::getCharset()) . ';'); } /** @@ -281,7 +281,7 @@ class DIMP return ''; } - return 'DimpCore.showNotifications(' . Horde_Serialize::serialize($msgs, SERIALIZE_JSON) . ')'; + return 'DimpCore.showNotifications(' . Horde_Serialize::serialize($msgs, Horde_Serialize::JSON) . ')'; } /** diff --git a/imp/lib/IMP.php b/imp/lib/IMP.php index 9dc917731..1ace89137 100644 --- a/imp/lib/IMP.php +++ b/imp/lib/IMP.php @@ -1363,7 +1363,7 @@ class IMP */ static public function escapeJSON($json) { - return '/*-secure-' . rawurlencode(Horde_Serialize::serialize($json, SERIALIZE_JSON, NLS::getCharset())) . '*/'; + return '/*-secure-' . rawurlencode(Horde_Serialize::serialize($json, Horde_Serialize::JSON, NLS::getCharset())) . '*/'; } /** diff --git a/imp/lib/Imple/ContactAutoCompleter.php b/imp/lib/Imple/ContactAutoCompleter.php index 1208e8527..9f8a39ada 100644 --- a/imp/lib/Imple/ContactAutoCompleter.php +++ b/imp/lib/Imple/ContactAutoCompleter.php @@ -96,7 +96,7 @@ class IMP_Imple_ContactAutoCompleter extends IMP_Imple 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())); + IMP::addInlineScript('if (!IMP) { var IMP = {}; } IMP.ac_list = '. Horde_Serialize::serialize(array_map('htmlspecialchars', $addrlist), Horde_Serialize::JSON, NLS::getCharset())); self::$_listOutput = true; } $func = 'Autocompleter.Local'; diff --git a/imp/lib/Imple/SpellChecker.php b/imp/lib/Imple/SpellChecker.php index b066afc10..f3b20a59f 100644 --- a/imp/lib/Imple/SpellChecker.php +++ b/imp/lib/Imple/SpellChecker.php @@ -36,7 +36,7 @@ class IMP_Imple_SpellChecker extends IMP_Imple if (empty($params['states'])) { $params['states'] = '""'; } else { - $params['states'] = Horde_Serialize::serialize($params['states'], SERIALIZE_JSON, NLS::getCharset()); + $params['states'] = Horde_Serialize::serialize($params['states'], Horde_Serialize::JSON, NLS::getCharset()); } if (empty($params['locales'])) { $params['locales'] = array(); @@ -45,7 +45,7 @@ class IMP_Imple_SpellChecker extends IMP_Imple } } asort($params['locales'], SORT_LOCALE_STRING); - $params['locales'] = Horde_Serialize::serialize($params['locales'], SERIALIZE_JSON, NLS::getCharset()); + $params['locales'] = Horde_Serialize::serialize($params['locales'], Horde_Serialize::JSON, NLS::getCharset()); parent::__construct($params); } diff --git a/imp/lib/Views/Compose.php b/imp/lib/Views/Compose.php index 4122d4728..20fa558b6 100644 --- a/imp/lib/Views/Compose.php +++ b/imp/lib/Views/Compose.php @@ -83,7 +83,7 @@ class IMP_Views_Compose $result['js'] = array( 'DIMP.conf_compose.auto_save_interval_val = ' . intval($GLOBALS['prefs']->getValue('auto_save_drafts')), - 'DIMP.conf_compose.identities = ' . Horde_Serialize::serialize($identities, SERIALIZE_JSON), + 'DIMP.conf_compose.identities = ' . Horde_Serialize::serialize($identities, Horde_Serialize::JSON), 'DIMP.conf_compose.qreply = ' . intval(!empty($args['qreply'])), ); diff --git a/imp/lib/Views/ListMessages.php b/imp/lib/Views/ListMessages.php index a4aade513..c0fe260ba 100644 --- a/imp/lib/Views/ListMessages.php +++ b/imp/lib/Views/ListMessages.php @@ -182,7 +182,7 @@ class IMP_Views_ListMessages $cached = array(); } else { if (isset($md->search)) { - $cached = Horde_Serialize::unserialize($args['cached'], SERIALIZE_JSON); + $cached = Horde_Serialize::unserialize($args['cached'], Horde_Serialize::JSON); } else { $cached = IMP::parseRangeString($args['cached']); $cached = reset($cached); diff --git a/imp/login.php b/imp/login.php index 338708f36..8799007ad 100644 --- a/imp/login.php +++ b/imp/login.php @@ -329,10 +329,10 @@ require IMP_TEMPLATES . '/common-header.inc'; $charset = NLS::getCharset(); IMP::addInlineScript(array( - 'ImpLogin.autologin_url = ' . Horde_Serialize::serialize(Util::addParameter(Horde::selfUrl(), array('autologin' => $autologin, 'server_key' => '')), SERIALIZE_JSON, $charset), + 'ImpLogin.autologin_url = ' . Horde_Serialize::serialize(Util::addParameter(Horde::selfUrl(), array('autologin' => $autologin, 'server_key' => '')), Horde_Serialize::JSON, $charset), 'ImpLogin.ie_clientcaps = ' . intval($t->get('ie_clientcaps')), 'ImpLogin.imp_auth = ' . intval($imp_auth), - 'ImpLogin.lang_url = ' . Horde_Serialize::serialize($lang_url, SERIALIZE_JSON, $charset), + 'ImpLogin.lang_url = ' . Horde_Serialize::serialize($lang_url, Horde_Serialize::JSON, $charset), 'ImpLogin.nomenu = ' . intval(empty($conf['menu']['always'])), 'ImpLogin.reloadmenu = ' . intval($logout_reason && $imp_auth && $conf['menu']['always']), 'ImpLogin.show_list = ' . intval($show_list), diff --git a/imp/mailbox.php b/imp/mailbox.php index ffcec3717..ea1dfa29c 100644 --- a/imp/mailbox.php +++ b/imp/mailbox.php @@ -885,7 +885,7 @@ if (($pageOb['end'] - $pageOb['begin']) >= 20) { } IMP::addInlineScript(array( - 'ImpMessage.messagelist = ' . Horde_Serialize::serialize($ids, SERIALIZE_JSON, NLS::getCharset()), + 'ImpMessage.messagelist = ' . Horde_Serialize::serialize($ids, Horde_Serialize::JSON, NLS::getCharset()), 'ImpMessage.sortlimit = ' . intval($sortpref['limit']), 'ImpMessage.unread = ' . strval($unread) )); diff --git a/imp/message-dimp.php b/imp/message-dimp.php index 111ecd19c..fbe0940fd 100644 --- a/imp/message-dimp.php +++ b/imp/message-dimp.php @@ -60,7 +60,7 @@ $compose_result['js'] = array_merge($compose_result['js'], array( foreach (array('from', 'to', 'cc', 'bcc', 'replyTo') as $val) { if (!empty($show_msg_result[$val])) { - $compose_result['js'][] = 'DimpFullmessage.' . $val . ' = ' . Horde_Serialize::serialize($show_msg_result[$val], SERIALIZE_JSON); + $compose_result['js'][] = 'DimpFullmessage.' . $val . ' = ' . Horde_Serialize::serialize($show_msg_result[$val], Horde_Serialize::JSON); } } IMP::addInlineScript($compose_result['js']); diff --git a/imp/search.php b/imp/search.php index 7529acff0..fb3c88dbe 100644 --- a/imp/search.php +++ b/imp/search.php @@ -341,7 +341,7 @@ IMP::menu(); IMP::status(); IMP::addInlineScript(array( - 'ImpSearch.search_date = ' . Horde_Serialize::serialize(array('m' => date('m'), 'd' => date('d'), 'y' => date('Y')), SERIALIZE_JSON, $charset), + 'ImpSearch.search_date = ' . Horde_Serialize::serialize(array('m' => date('m'), 'd' => date('d'), 'y' => date('Y')), Horde_Serialize::JSON, $charset), 'ImpSearch.not_search = ' . intval(empty($search['mbox'])), 'ImpSearch.inverse_sub = ' . intval($t->get('inverse_subscribe')), )); diff --git a/imp/templates/javascript_defs.php b/imp/templates/javascript_defs.php index a9d67e8a1..3064c9518 100644 --- a/imp/templates/javascript_defs.php +++ b/imp/templates/javascript_defs.php @@ -74,4 +74,4 @@ $code = array( )) ); -echo IMP::wrapInlineScript(array('var IMP = ' . Horde_Serialize::serialize($code, SERIALIZE_JSON, NLS::getCharset()) . ';')); +echo IMP::wrapInlineScript(array('var IMP = ' . Horde_Serialize::serialize($code, Horde_Serialize::JSON, NLS::getCharset()) . ';')); diff --git a/kronolith/imple.php b/kronolith/imple.php index f9b0245a4..c8bb186b8 100644 --- a/kronolith/imple.php +++ b/kronolith/imple.php @@ -48,7 +48,7 @@ if (!empty($_SERVER['Content-Type'])) { switch ($ct) { case 'json': header('Content-Type: application/json'); - echo Horde_Serialize::serialize($result, SERIALIZE_JSON, NLS::getCharset()); + echo Horde_Serialize::serialize($result, Horde_Serialize::JSON, NLS::getCharset()); break; case 'plain': diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index 7f9af7173..1ca778ca6 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -140,7 +140,7 @@ class Kronolith { $code['text']['weekday'][$i] = NLS::getLangInfo(constant('DAY_' . $i)); } - return array('var Kronolith = ' . Horde_Serialize::serialize($code, SERIALIZE_JSON, NLS::getCharset()) . ';'); + return array('var Kronolith = ' . Horde_Serialize::serialize($code, Horde_Serialize::JSON, NLS::getCharset()) . ';'); } /** diff --git a/kronolith/lib/Storage/sql.php b/kronolith/lib/Storage/sql.php index 3bc1c959f..37b351ef4 100644 --- a/kronolith/lib/Storage/sql.php +++ b/kronolith/lib/Storage/sql.php @@ -148,7 +148,7 @@ class Kronolith_Storage_sql extends Kronolith_Storage { /* Retrieve Freebusy object. TODO: check for multiple * results and merge them into one and return. */ require_once 'Horde/Serialize.php'; - $vfb = Horde_Serialize::unserialize($row['vfb_serialized'], SERIALIZE_BASIC); + $vfb = Horde_Serialize::unserialize($row['vfb_serialized'], Horde_Serialize::BASIC); return $vfb; } } @@ -173,7 +173,7 @@ class Kronolith_Storage_sql extends Kronolith_Storage { require_once 'Horde/Serialize.php'; $query = sprintf('INSERT INTO %s (vfb_owner, vfb_email, vfb_serialized) VALUES (?, ?, ?)', $this->_params['table']); - $values = array($owner, $email, Horde_Serialize::serialize($vfb, SERIALIZE_BASIC)); + $values = array($owner, $email, Horde_Serialize::serialize($vfb, Horde_Serialize::BASIC)); /* Log the query at debug level. */ Horde::logMessage(sprintf('SQL insert by %s: query = "%s"', diff --git a/kronolith/templates/javascript_defs.php b/kronolith/templates/javascript_defs.php index 120bb7876..5d2b012f2 100644 --- a/kronolith/templates/javascript_defs.php +++ b/kronolith/templates/javascript_defs.php @@ -22,6 +22,6 @@ $gettext = array_map('addslashes', array( ?>