Convert to new Horde_Serialize constant usage.
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 13 Feb 2009 04:39:18 +0000 (21:39 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 13 Feb 2009 04:39:18 +0000 (21:39 -0700)
24 files changed:
chora/templates/common-header.inc
drag_n_drop_portal/block.php
drag_n_drop_portal/lib/Block/Layout/View/js.php
framework/Service_Vimeo/doc/vimeo_example.php
imp/ajax.php
imp/compose-dimp.php
imp/compose.php
imp/fetchmailprefs.php
imp/folders.php
imp/lib/DIMP.php
imp/lib/IMP.php
imp/lib/Imple/ContactAutoCompleter.php
imp/lib/Imple/SpellChecker.php
imp/lib/Views/Compose.php
imp/lib/Views/ListMessages.php
imp/login.php
imp/mailbox.php
imp/message-dimp.php
imp/search.php
imp/templates/javascript_defs.php
kronolith/imple.php
kronolith/lib/Kronolith.php
kronolith/lib/Storage/sql.php
kronolith/templates/javascript_defs.php

index 3be56f2..77d81ec 100644 (file)
@@ -13,7 +13,7 @@ if (!empty($refresh_time) && ($refresh_time > 0) && !empty($refresh_url)) {
 
 if (Util::nonInputVar('js_vars')) {
     echo '<script type="text/javascript">//<![CDATA[' . "\n" .
-       'var Chora = ' . Horde_Serialize::serialize($js_vars, SERIALIZE_JSON, NLS::getCharset()) . ";\n//]]></script>\n";
+       'var Chora = ' . Horde_Serialize::serialize($js_vars, Horde_Serialize::JSON, NLS::getCharset()) . ";\n//]]></script>\n";
 }
 Horde::includeScriptFiles();
 
index d105d90..c0bca33 100644 (file)
@@ -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());
index e8f8065..161b80a 100644 (file)
@@ -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 .').'
index de0be92..04e5f2d 100644 (file)
@@ -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;
index 6bbf922..621dc9e 100644 (file)
@@ -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) {
index 5b4f9c7..c375a23 100644 (file)
@@ -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(
index 0d2b70c..c3e3389 100644 (file)
@@ -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());
 }
 
 
index ba2d268..519124b 100644 (file)
@@ -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');
index 1edef3f..a6ec822 100644 (file)
@@ -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. */
index f2e1107..0229412 100644 (file)
@@ -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) . ')';
     }
 
     /**
index 9dc9177..1ace891 100644 (file)
@@ -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())) . '*/';
     }
 
     /**
index 1208e85..9f8a39a 100644 (file)
@@ -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';
index b066afc..f3b20a5 100644 (file)
@@ -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);
     }
index 4122d47..20fa558 100644 (file)
@@ -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'])),
         );
 
index a4aade5..c0fe260 100644 (file)
@@ -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);
index 338708f..8799007 100644 (file)
@@ -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),
index ffcec37..ea1dfa2 100644 (file)
@@ -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)
 ));
index 111ecd1..fbe0940 100644 (file)
@@ -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']);
index 7529acf..fb3c88d 100644 (file)
@@ -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')),
 ));
index a9d67e8..3064c95 100644 (file)
@@ -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()) . ';'));
index f9b0245..c8bb186 100644 (file)
@@ -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':
index 7f9af71..1ca778c 100644 (file)
@@ -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()) . ';');
     }
 
     /**
index 3bc1c95..37b351e 100644 (file)
@@ -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"',
index 120bb78..5d2b012 100644 (file)
@@ -22,6 +22,6 @@ $gettext = array_map('addslashes', array(
 
 ?>
 <script type="text/javascript">//<![CDATA[
-var KronolithVar = <?php echo Horde_Serialize::serialize($var, SERIALIZE_JSON, $charset) ?>;
-var KronolithText = <?php echo Horde_Serialize::serialize($gettext, SERIALIZE_JSON, $charset) ?>;
+var KronolithVar = <?php echo Horde_Serialize::serialize($var, Horde_Serialize::JSON, $charset) ?>;
+var KronolithText = <?php echo Horde_Serialize::serialize($gettext, Horde_Serialize::JSON, $charset) ?>;
 //]]></script>