Use copy().
authorJan Schneider <jan@horde.org>
Tue, 8 Dec 2009 22:34:50 +0000 (23:34 +0100)
committerJan Schneider <jan@horde.org>
Tue, 8 Dec 2009 22:34:50 +0000 (23:34 +0100)
13 files changed:
imp/folders-mimp.php
imp/folders.php
imp/lib/Block/summary.php
imp/lib/Compose.php
imp/lib/Ui/Folder.php
imp/lib/Ui/Message.php
imp/mailbox-mimp.php
imp/mailbox.php
imp/message-mimp.php
imp/message.php
imp/pgp.php
imp/smime.php
imp/stationery.php

index fff1d53..4f45e2d 100644 (file)
@@ -57,7 +57,7 @@ foreach ($tree_ob[0] as $val) {
 $selfurl = Horde::applicationUrl('folders-mimp.php');
 if ($subscribe) {
     $sub_text = $showAll ? _("Show Subscribed Folders") : _("Show All Folders");
-    $sub_link = $selfurl->cAdd('ts', 1);
+    $sub_link = $selfurl->copy()->add('ts', 1);
 }
 
 $title = _("Folders");
index e4695f4..fc34674 100644 (file)
@@ -401,14 +401,14 @@ $a_template->set('create_folder', !empty($GLOBALS['conf']['hooks']['permsdenied'
 if ($prefs->getValue('subscribe')) {
     $a_template->set('subscribe', true);
     $subToggleText = ($showAll) ? _("Hide Unsubscribed") : _("Show Unsubscribed");
-    $a_template->set('toggle_subscribe', Horde::widget($folders_url_ob->cAdd(array('actionID' => 'toggle_subscribed_view', 'folders_token' => $folders_token)), $subToggleText, 'widget', '', '', $subToggleText, true));
+    $a_template->set('toggle_subscribe', Horde::widget($folders_url_ob->copy()->add(array('actionID' => 'toggle_subscribed_view', 'folders_token' => $folders_token)), $subToggleText, 'widget', '', '', $subToggleText, true));
 }
 $a_template->set('nav_poll', !$prefs->isLocked('nav_poll') && !$prefs->getValue('nav_poll_all'));
 $a_template->set('notrash', !$prefs->getValue('use_trash'));
 $a_template->set('file_upload', $_SESSION['imp']['file_upload']);
 $a_template->set('help', Horde_Help::link('imp', 'folder-options'));
-$a_template->set('expand_all', Horde::widget($folders_url_ob->cAdd(array('actionID' => 'expand_all_folders', 'folders_token' => $folders_token)), _("Expand All Folders"), 'widget', '', '', _("Expand All"), true));
-$a_template->set('collapse_all', Horde::widget($folders_url_ob->cAdd(array('actionID' => 'collapse_all_folders', 'folders_token' => $folders_token)), _("Collapse All Folders"), 'widget', '', '', _("Collapse All"), true));
+$a_template->set('expand_all', Horde::widget($folders_url_ob->copy()->add(array('actionID' => 'expand_all_folders', 'folders_token' => $folders_token)), _("Expand All Folders"), 'widget', '', '', _("Expand All"), true));
+$a_template->set('collapse_all', Horde::widget($folders_url_ob->copy()->add(array('actionID' => 'collapse_all_folders', 'folders_token' => $folders_token)), _("Collapse All Folders"), 'widget', '', '', _("Collapse All"), true));
 
 /* Check to see if user wants new mail notification */
 if (!empty($newmsgs)) {
@@ -459,7 +459,7 @@ foreach ($raw_rows as $key => $val) {
         if (!empty($val['unseen'])) {
             $val['name'] = '<strong>' . $val['name'] . '</strong>';
         }
-        $val['name'] = Horde::link($name_url->cAdd('mailbox', $val['value']), $val['vfolder'] ? $val['base_elt']['l'] : $val['display']) . $val['name'] . '</a>';
+        $val['name'] = Horde::link($name_url->copy()->add('mailbox', $val['value']), $val['vfolder'] ? $val['base_elt']['l'] : $val['display']) . $val['name'] . '</a>';
     }
 
     $val['line'] = $tree_imgs[$key];
index f9fa1e0..6ea08a7 100644 (file)
@@ -73,7 +73,7 @@ class Horde_Block_imp_summary extends Horde_Block
                         if (!empty($info['recent'])) {
                             $newmsgs[$folder] = $info['recent'];
                         }
-                        $url = $mbox_url->cAdd(array('no_newmail_popup' => 1, 'mailbox' => $folder));
+                        $url = $mbox_url->copy()->add(array('no_newmail_popup' => 1, 'mailbox' => $folder));
                         $html .= '<tr style="cursor:pointer" class="text" onclick="self.location=\'' . $url . '\'"><td>';
                         if (!empty($info['unseen'])) {
                             $html .= '<strong>';
index 178a1e6..d56f90a 100644 (file)
@@ -2232,7 +2232,7 @@ class IMP_Compose
         }
 
         foreach ($this->getAttachments() as $att) {
-            $trailer .= "\n" . $baseurl->cAdd(array('u' => $auth, 't' => $ts, 'f' => $att->getName()));
+            $trailer .= "\n" . $baseurl->copy()->add(array('u' => $auth, 't' => $ts, 'f' => $att->getName()));
             if ($conf['compose']['use_vfs']) {
                 $res = $vfs->rename(self::VFS_ATTACH_PATH, $att->getInformation('temp_filename'), $fullpath, escapeshellcmd($att->getName()));
             } else {
index 3bcea08..a52f971 100644 (file)
@@ -61,7 +61,7 @@ class IMP_Ui_Folder
         $imaptree = IMP_Imap_Tree::singleton();
 
         if ($elt['children'] && isset($options['expand_url'])) {
-            $dir = $options['expand_url']->cAdd('folder', $elt['value']);
+            $dir = $options['expand_url']->copy()->add('folder', $elt['value']);
 
             if ($imaptree->isOpen($elt['base_elt'])) {
                 if (!is_null($dir)) {
index 0c339ce..d1106c2 100644 (file)
@@ -307,7 +307,7 @@ class IMP_Ui_Message
         if (!is_null($addURL) && $link && $prefs->getValue('add_source')) {
             try {
                 $add_link = $registry->hasMethod('contacts/import')
-                    ? $addURL->cAdd('actionID', 'add_address')
+                    ? $addURL->copy()->add('actionID', 'add_address')
                     : null;
             } catch (Horde_Exception $e) {}
         }
@@ -331,7 +331,7 @@ class IMP_Ui_Message
                     /* Append the add address icon to every address if contact
                      * manager is available. */
                     if ($add_link) {
-                        $curr_link = $add_link->cAdd(array('name' => $ad['personal'], 'address' => $ad['inner']));
+                        $curr_link = $add_link->copy()->add(array('name' => $ad['personal'], 'address' => $ad['inner']));
                         $ret .= Horde::link($curr_link, sprintf(_("Add %s to my Address Book"), $ad['inner'])) .
                             Horde::img('addressbook_add.png', sprintf(_("Add %s to my Address Book"), $ad['inner'])) . '</a>';
                     }
@@ -359,7 +359,7 @@ class IMP_Ui_Message
                     /* Append the add address icon to every address if contact
                      * manager is available. */
                     if ($add_link) {
-                        $curr_link = $add_link->cAdd(array('name' => $ob['personal'], 'address' => $ob['inner']));
+                        $curr_link = $add_link->copy()->add(array('name' => $ob['personal'], 'address' => $ob['inner']));
                         $ret .= Horde::link($curr_link, sprintf(_("Add %s to my Address Book"), $ob['inner'])) .
                             Horde::img('addressbook_add.png', sprintf(_("Add %s to my Address Book"), $ob['inner'])) . '</a>';
                     }
index 5baad4a..4342099 100644 (file)
@@ -88,12 +88,12 @@ $pageOb = $imp_mailbox->buildMailboxPage(Horde_Util::getFormData('p'), Horde_Uti
 /* Generate page links. */
 $pages_first = $pages_prev = $pages_last = $pages_next = null;
 if ($pageOb['page'] != 1) {
-    $pages_first = new Horde_Mobile_link(_("First Page"), $mailbox_url->cAdd('p', 1));
-    $pages_prev = new Horde_Mobile_link(_("Previous Page"), $mailbox_url->cAdd('p', $pageOb['page'] - 1));
+    $pages_first = new Horde_Mobile_link(_("First Page"), $mailbox_url->copy()->add('p', 1));
+    $pages_prev = new Horde_Mobile_link(_("Previous Page"), $mailbox_url->copy()->add('p', $pageOb['page'] - 1));
 }
 if ($pageOb['page'] != $pageOb['pagecount']) {
-    $pages_next = new Horde_Mobile_link(_("Next Page"), $mailbox_url->cAdd('p', $pageOb['page'] + 1));
-    $pages_last = new Horde_Mobile_link(_("Last Page"), $mailbox_url->cAdd('p', $pageOb['pagecount']));
+    $pages_next = new Horde_Mobile_link(_("Next Page"), $mailbox_url->copy()->add('p', $pageOb['page'] + 1));
+    $pages_last = new Horde_Mobile_link(_("Last Page"), $mailbox_url->copy()->add('p', $pageOb['pagecount']));
 }
 
 /* Generate mailbox summary string. */
@@ -174,7 +174,7 @@ while (list(,$ob) = each($mbox_info['overview'])) {
     $msgs[] = $msg;
 }
 
-$mailbox = $mailbox_url->cAdd('p', $pageOb['page']);
+$mailbox = $mailbox_url->copy()->add('p', $pageOb['page']);
 $items = array(array(_("Refresh"), $mailbox));
 $search_mbox = $imp_search->isSearchMbox($imp_mbox['mailbox']);
 
@@ -182,7 +182,7 @@ $search_mbox = $imp_search->isSearchMbox($imp_mbox['mailbox']);
 if (!$readonly &&
     !$prefs->getValue('use_trash') &&
     !$imp_search->isVINBOXFolder()) {
-    $items[] = array(_("Purge Deleted"), $mailbox->cAdd('a', 'e'));
+    $items[] = array(_("Purge Deleted"), $mailbox->copy()->add('a', 'e'));
 }
 
 /* Create sorting links. */
@@ -202,24 +202,24 @@ foreach ($sort_list as $key => $val) {
             IMP::threadSortAvailable($mailbox) &&
             !$search_mbox) {
             if (is_null($imp_thread)) {
-                $items[] = array(_("Sort by Thread"), $mailbox->cAdd(array('a' => 'c', 'sb' => Horde_Imap_Client::SORT_THREAD, 'sd' => $sortdir)));
+                $items[] = array(_("Sort by Thread"), $mailbox->copy()->add(array('a' => 'c', 'sb' => Horde_Imap_Client::SORT_THREAD, 'sd' => $sortdir)));
             } else {
                 $sortkey = Horde_Imap_Client::SORT_THREAD;
-                $items[] = array(_("Do Not Sort by Thread"), $mailbox->cAdd(array('a' => 'c', 'sb' => Horde_Imap_Client::SORT_SUBJECT, 'sd' => $sortdir)));
+                $items[] = array(_("Do Not Sort by Thread"), $mailbox->copy()->add(array('a' => 'c', 'sb' => Horde_Imap_Client::SORT_SUBJECT, 'sd' => $sortdir)));
             }
         }
         if ($sortpref['by'] == $key) {
             $val = '*' . $val;
             $sortdir = !$sortdir;
         }
-        $sort[$key] = new Horde_Mobile_link($val, $mailbox->cAdd(array('a' => 'c', 'sb' => $sortkey, 'sd' => $sortdir)));
+        $sort[$key] = new Horde_Mobile_link($val, $mailbox->copy()->add(array('a' => 'c', 'sb' => $sortkey, 'sd' => $sortdir)));
     }
 }
 
 /* Add search link. */
 if (!$search_mbox &&
     ($_SESSION['imp']['protocol'] == 'imap')) {
-    $items[] = array(_("Search"), $mailbox_url->cAdd('a', 's'));
+    $items[] = array(_("Search"), $mailbox_url->copy()->add('a', 's'));
 }
 
 foreach ($items as $val) {
index e27bf87..3cb328a 100644 (file)
@@ -211,7 +211,7 @@ if (!$readonly && !empty($_SESSION['imp']['filteravail'])) {
         $do_filter = true;
     } elseif (($imp_mbox['mailbox'] == 'INBOX') ||
               ($prefs->getValue('filter_any_mailbox') && !$search_mbox)) {
-        $filter_url = $mailbox_imp_url->cAdd(array('actionID' => 'filter', 'mailbox_token' => $mailbox_token));
+        $filter_url = $mailbox_imp_url->copy()->add(array('actionID' => 'filter', 'mailbox_token' => $mailbox_token));
     }
 }
 
@@ -271,9 +271,9 @@ if ($pageOb['pagecount']) {
         $pages_first = Horde::img($rtl ? 'nav/last-grey.png' : 'nav/first-grey.png', null, null, $graphicsdir);
         $pages_prev = Horde::img($rtl ? 'nav/right-grey.png' : 'nav/left-grey.png', null, null, $graphicsdir);
     } else {
-        $first_url = $mailbox_imp_url->cAdd('page', 1);
+        $first_url = $mailbox_imp_url->copy()->add('page', 1);
         $pages_first = Horde::link($first_url, _("First Page")) . Horde::img($rtl ? 'nav/last.png' : 'nav/first.png', $rtl ? '>>' : '<<', null, $graphicsdir) . '</a>';
-        $prev_url = $mailbox_imp_url->cAdd('page', $pageOb['page'] - 1);
+        $prev_url = $mailbox_imp_url->copy()->add('page', $pageOb['page'] - 1);
         $pages_prev = Horde::link($prev_url, _("Previous Page")) . Horde::img($rtl ? 'nav/right.png' : 'nav/left.png', $rtl ? '>' : '<', null, $graphicsdir) . '</a>';
     }
 
@@ -281,9 +281,9 @@ if ($pageOb['pagecount']) {
         $pages_last = Horde::img($rtl ? 'nav/first-grey.png' : 'nav/last-grey.png', null, null, $graphicsdir);
         $pages_next = Horde::img($rtl ? 'nav/left-grey.png' : 'nav/right-grey.png', null, null, $graphicsdir);
     } else {
-        $next_url = $mailbox_imp_url->cAdd('page', $pageOb['page'] + 1);
+        $next_url = $mailbox_imp_url->copy()->add('page', $pageOb['page'] + 1);
         $pages_next = Horde::link($next_url, _("Next Page")) . Horde::img($rtl ? 'nav/left.png' : 'nav/right.png', $rtl ? '<' : '>', null, $graphicsdir) . '</a>';
-        $last_url = $mailbox_imp_url->cAdd('page', $pageOb['pagecount']);
+        $last_url = $mailbox_imp_url->copy()->add('page', $pageOb['pagecount']);
         $pages_last = Horde::link($last_url, _("Last Page")) . Horde::img($rtl ? 'nav/first.png' : 'nav/last.png', $rtl ? '<<' : '>>', null, $graphicsdir) . '</a>';
     }
 }
@@ -312,13 +312,13 @@ if (!is_null($rss_box)) {
 
 /* If user wants the mailbox to be refreshed, set time here. */
 $refresh_time = $prefs->getValue('refresh_time');
-$refresh_url = $mailbox_imp_url->cAdd('page', $pageOb['page']);
+$refresh_url = $mailbox_imp_url->copy()->add('page', $pageOb['page']);
 if (isset($filter_url)) {
     $filter_url->add('page', $pageOb['page']);
 }
 
 /* Set the folder for the sort links. */
-$sort_url = $mailbox_imp_url->cAdd('sortdir', ($sortpref['dir']) ? 0 : 1);
+$sort_url = $mailbox_imp_url->copy()->add('sortdir', ($sortpref['dir']) ? 0 : 1);
 
 /* Determine if we are showing previews. */
 $preview_tooltip = $show_preview
@@ -424,7 +424,7 @@ if ($_SESSION['imp']['protocol'] != 'pop') {
     if (!$search_mbox) {
         $hdr_template->set('search', Horde::link(Horde::applicationUrl('search-basic.php')->add('search_mailbox', $imp_mbox['mailbox']), sprintf(_("Search %s"), $rawtitle)) . Horde::img('search.png', _("Search")) . '</a>');
         if (!$readonly) {
-            $hdr_template->set('empty', Horde::link($mailbox_imp_url->cAdd(array('actionID' => 'empty_mailbox', 'mailbox' => $imp_mbox['mailbox'], 'mailbox_token' => $mailbox_token)), _("Empty folder"), '', '', "ImpMailbox.confirmDialog(this.href, '" . addslashes(_("Are you sure you wish to delete all mail in this folder?")) . "'); return false;") . Horde::img('empty_spam.png', _("Empty folder")) . '</a>');
+            $hdr_template->set('empty', Horde::link($mailbox_imp_url->copy()->add(array('actionID' => 'empty_mailbox', 'mailbox' => $imp_mbox['mailbox'], 'mailbox_token' => $mailbox_token)), _("Empty folder"), '', '', "ImpMailbox.confirmDialog(this.href, '" . addslashes(_("Are you sure you wish to delete all mail in this folder?")) . "'); return false;") . Horde::img('empty_spam.png', _("Empty folder")) . '</a>');
         }
     } else {
         if ($imp_search->isEditableVFolder()) {
@@ -457,9 +457,9 @@ if (empty($pageOb['end'])) {
         /* Show 'Show Deleted' prompt if mailbox has no viewable message but
            has hidden, deleted messages. */
         $del_template = new Horde_Template();
-        $del_template->set('hide', Horde::widget($refresh_url->cAdd(array('actionID' => 'hide_deleted', 'mailbox_token' => $mailbox_token)), $deleted_prompt, 'widget hideAction', '', '', $deleted_prompt));
+        $del_template->set('hide', Horde::widget($refresh_url->copy()->add(array('actionID' => 'hide_deleted', 'mailbox_token' => $mailbox_token)), $deleted_prompt, 'widget hideAction', '', '', $deleted_prompt));
         if (!$readonly) {
-            $del_template->set('purge', Horde::widget($refresh_url->cAdd(array('actionID' => 'expunge_mailbox', 'mailbox_token' => $mailbox_token)), _("Purge Deleted"), 'widget purgeAction', '', '', _("Pur_ge Deleted")));
+            $del_template->set('purge', Horde::widget($refresh_url->copy()->add(array('actionID' => 'expunge_mailbox', 'mailbox_token' => $mailbox_token)), _("Purge Deleted"), 'widget purgeAction', '', '', _("Pur_ge Deleted")));
         }
         echo $del_template->fetch(IMP_TEMPLATES . '/mailbox/actions_deleted.html');
     }
@@ -525,11 +525,11 @@ if ($pageOb['msgcount']) {
     }
 
     if ($showdelete['purge']) {
-        $mailbox_link = $mailbox_imp_url->cAdd('page', $pageOb['page']);
+        $mailbox_link = $mailbox_imp_url->copy()->add('page', $pageOb['page']);
         if (isset($deleted_prompt)) {
-            $a_template->set('hide_deleted', Horde::widget($mailbox_link->cAdd(array('actionID' => 'hide_deleted', 'mailbox_token' => $mailbox_token)), $deleted_prompt, 'widget hideAction', '', '', $deleted_prompt));
+            $a_template->set('hide_deleted', Horde::widget($mailbox_link->copy()->add(array('actionID' => 'hide_deleted', 'mailbox_token' => $mailbox_token)), $deleted_prompt, 'widget hideAction', '', '', $deleted_prompt));
         }
-        $a_template->set('purge_deleted', Horde::widget($mailbox_link->cAdd(array('actionID' => 'expunge_mailbox', 'mailbox_token' => $mailbox_token)), _("Purge Deleted"), 'widget purgeAction', '', '', _("Pur_ge Deleted")));
+        $a_template->set('purge_deleted', Horde::widget($mailbox_link->copy()->add(array('actionID' => 'expunge_mailbox', 'mailbox_token' => $mailbox_token)), _("Purge Deleted"), 'widget purgeAction', '', '', _("Pur_ge Deleted")));
     }
 
     if ($registry->hasMethod('mail/blacklistFrom')) {
@@ -634,7 +634,7 @@ if ($pageOb['msgcount']) {
             $extra = Horde_Imap_Client::SORT_SUBJECT;
             $standard = Horde_Imap_Client::SORT_THREAD;
         }
-        $headers[$standard]['extra'] = '&nbsp;<span style="toggleSubject">[' . Horde::widget($mailbox_imp_url->cAdd(array('sortby' => $extra, 'actionID' => 'change_sort', 'mailbox_token' => $mailbox_token)), $headers[$extra]['stext'], 'widget', null, 'if (window.event) window.event.cancelBubble = true; else if (event) event.stopPropagation();', $headers[$extra]['text']) . ']</span>';
+        $headers[$standard]['extra'] = '&nbsp;<span style="toggleSubject">[' . Horde::widget($mailbox_imp_url->copy()->add(array('sortby' => $extra, 'actionID' => 'change_sort', 'mailbox_token' => $mailbox_token)), $headers[$extra]['stext'], 'widget', null, 'if (window.event) window.event.cancelBubble = true; else if (event) event.stopPropagation();', $headers[$extra]['text']) . ']</span>';
         unset($headers[$extra]);
     }
 
@@ -642,7 +642,7 @@ if ($pageOb['msgcount']) {
         $ptr = &$headers[$key];
         $ptr['class'] = ($sortpref['by'] == $key) ? 'selected' : 'item';
         if ($sortpref['by'] == $key) {
-            $ptr['change_sort_link'] = Horde::link($sort_url->cAdd(array('sortby' => $key, 'actionID' => 'change_sort', 'mailbox_token' => $mailbox_token)), $val['stext'], null, null, null, $val['stext']) . Horde::img($sortImg, $sortText, '', $graphicsdir) . '</a>';
+            $ptr['change_sort_link'] = Horde::link($sort_url->copy()->add(array('sortby' => $key, 'actionID' => 'change_sort', 'mailbox_token' => $mailbox_token)), $val['stext'], null, null, null, $val['stext']) . Horde::img($sortImg, $sortText, '', $graphicsdir) . '</a>';
         } else {
             $ptr['change_sort_link'] = null;
         }
@@ -650,8 +650,8 @@ if ($pageOb['msgcount']) {
             $ptr['sortlimit_text'] = Horde::stripAccessKey($val['text']);
         } else {
             $tmp = ($sortpref['by'] == $key) ? $sort_url : $mailbox_imp_url;
-            $ptr['change_sort'] = addslashes($tmp->cAdd(array('sortby' => $key, 'actionID' => 'change_sort', 'mailbox_token' => $mailbox_token)));
-            $ptr['change_sort_widget'] = Horde::widget($tmp->cAdd(array('sortby' => $key, 'actionID' => 'change_sort', 'mailbox_token' => $mailbox_token)), $val['stext'], 'widget', null, null, $val['text']);
+            $ptr['change_sort'] = addslashes($tmp->copy()->add(array('sortby' => $key, 'actionID' => 'change_sort', 'mailbox_token' => $mailbox_token)));
+            $ptr['change_sort_widget'] = Horde::widget($tmp->copy()->add(array('sortby' => $key, 'actionID' => 'change_sort', 'mailbox_token' => $mailbox_token)), $val['stext'], 'widget', null, null, $val['text']);
             if (!isset($val['extra'])) {
                 $ptr['extra'] = null;
             }
index b00d694..6c60fe1 100644 (file)
@@ -295,7 +295,7 @@ if ($prefs->getValue('mimp_preview_msg') &&
     !Horde_Util::getFormData('fullmsg') &&
     (strlen($msg_text) > 250)) {
     $msg_text = Horde_String::substr(trim($msg_text), 0, 250) . " [...]\n";
-    $fullmsg_link = new Horde_Mobile_link(_("View Full Message"), $self_link->cAdd('fullmsg', 1));
+    $fullmsg_link = new Horde_Mobile_link(_("View Full Message"), $self_link->copy()->add('fullmsg', 1));
 } else {
     $fullmsg_link = null;
 }
@@ -306,9 +306,9 @@ $mset = $menu->add(new Horde_Mobile_linkset());
 
 if (!$readonly) {
     if (in_array('\\deleted', $flags)) {
-        $mset->add(new Horde_Mobile_link(_("Undelete"), $self_link->cAdd('a', 'u')));
+        $mset->add(new Horde_Mobile_link(_("Undelete"), $self_link->copy()->add('a', 'u')));
     } else {
-        $mset->add(new Horde_Mobile_link(_("Delete"), $self_link->cAdd(array('a' => 'd', 'mt' => Horde::getRequestToken('imp.message-mimp')))));
+        $mset->add(new Horde_Mobile_link(_("Delete"), $self_link->copy()->add(array('a' => 'd', 'mt' => Horde::getRequestToken('imp.message-mimp')))));
     }
 }
 
@@ -350,13 +350,13 @@ $mset->add(new Horde_Mobile_link(sprintf(_("To %s"), IMP::getLabel($imp_mbox['ma
 if ($conf['spam']['reporting'] &&
     ($conf['spam']['spamfolder'] ||
      ($mailbox_name != IMP::folderPref($prefs->getValue('spam_folder'), true)))) {
-    $mset->add(new Horde_Mobile_link(_("Report as Spam"), $self_link->cAdd(array('a' => 'rs', 'mt' => Horde::getRequestToken('imp.message-mimp')))));
+    $mset->add(new Horde_Mobile_link(_("Report as Spam"), $self_link->copy()->add(array('a' => 'rs', 'mt' => Horde::getRequestToken('imp.message-mimp')))));
 }
 
 if ($conf['notspam']['reporting'] &&
     (!$conf['notspam']['spamfolder'] ||
      ($mailbox_name == IMP::folderPref($prefs->getValue('spam_folder'), true)))) {
-    $mset->add(new Horde_Mobile_link(_("Report as Innocent"), $self_link->cAdd(array('a' => 'ri', 'mt' => Horde::getRequestToken('imp.message-mimp')))));
+    $mset->add(new Horde_Mobile_link(_("Report as Innocent"), $self_link->copy()->add(array('a' => 'ri', 'mt' => Horde::getRequestToken('imp.message-mimp')))));
 }
 
 IMP_Mimp::addMIMPMenu($mset, 'message');
@@ -385,7 +385,7 @@ foreach ($display_headers as $head => $val) {
     }
     $t = $hb->add(new Horde_Mobile_text($val . (($all_to) ? ' ' : "\n")));
     if ($all_to) {
-        $hb->add(new Horde_Mobile_link('[' . _("Show All") . ']', $self_link->cAdd('allto', 1)));
+        $hb->add(new Horde_Mobile_link('[' . _("Show All") . ']', $self_link->copy()->add('allto', 1)));
         $t = $hb->add(new Horde_Mobile_text("\n"));
     }
     $t->set('linebreaks', true);
@@ -400,7 +400,7 @@ foreach ($atc_parts as $key) {
         /* Preference: if set, only show download confirmation screen if
          * attachment over a certain size. */
         $download_link = ($summary['bytes'] > $prefs->getValue('mimp_download_confirm'))
-            ? $self_link->cAdd(array('a' => 'c', 'atc' => $key))
+            ? $self_link->copy()->add(array('a' => 'c', 'atc' => $key))
             : $summary['download'];
         $hb->add(new Horde_Mobile_link($summary['description'], $download_link));
     }
index a20c02e..1c53eb9 100644 (file)
@@ -356,7 +356,7 @@ ksort($full_headers);
  * stuff in the query string, so we need to do an add/remove of 'uid'. */
 $selfURL = new Horde_Url(true);
 IMP::$newUrl = $selfURL = IMP::generateIMPUrl($selfURL->remove(array('actionID', 'mailbox', 'thismailbox', 'uid')), $imp_mbox['mailbox'], $uid, $mailbox_name)->add('message_token', $message_token);
-$headersURL = $selfURL->cRemove(array('show_all_headers', 'show_list_headers'));
+$headersURL = $selfURL->copy()->remove(array('show_all_headers', 'show_list_headers'));
 
 /* Generate previous/next links. */
 $prev_msg = $imp_mailbox->getIMAPIndex(-1);
@@ -467,9 +467,9 @@ if (!$prefs->getValue('compose_popup')) {
 
 if (!$readonly) {
     if (in_array('\\deleted', $flags)) {
-        $a_template->set('delete', Horde::widget($self_link->cAdd('actionID', 'undelete_message'), _("Undelete"), 'widget', '', '', _("Undelete"), true));
+        $a_template->set('delete', Horde::widget($self_link->copy()->add('actionID', 'undelete_message'), _("Undelete"), 'widget', '', '', _("Undelete"), true));
     } else {
-        $a_template->set('delete', Horde::widget($self_link->cAdd('actionID', 'delete_message'), _("Delete"), 'widget', '', ($use_pop) ? "return window.confirm('" . addslashes(_("Are you sure you wish to PERMANENTLY delete these messages?")) . "');" : '', _("_Delete"), true));
+        $a_template->set('delete', Horde::widget($self_link->copy()->add('actionID', 'delete_message'), _("Delete"), 'widget', '', ($use_pop) ? "return window.confirm('" . addslashes(_("Are you sure you wish to PERMANENTLY delete these messages?")) . "');" : '', _("_Delete"), true));
     }
 }
 
@@ -497,11 +497,11 @@ if (IMP::threadSortAvailable($imp_mbox['mailbox'])) {
 }
 
 if ($registry->hasMethod('mail/blacklistFrom')) {
-    $a_template->set('blacklist', Horde::widget($self_link->cAdd('actionID', 'blacklist'), _("Blacklist"), 'widget', '', '', _("_Blacklist"), true));
+    $a_template->set('blacklist', Horde::widget($self_link->copy()->add('actionID', 'blacklist'), _("Blacklist"), 'widget', '', '', _("_Blacklist"), true));
 }
 
 if ($registry->hasMethod('mail/whitelistFrom')) {
-    $a_template->set('whitelist', Horde::widget($self_link->cAdd('actionID', 'whitelist'), _("Whitelist"), 'widget', '', '', _("_Whitelist"), true));
+    $a_template->set('whitelist', Horde::widget($self_link->copy()->add('actionID', 'whitelist'), _("Whitelist"), 'widget', '', '', _("_Whitelist"), true));
 }
 
 if (!empty($conf['user']['allow_view_source'])) {
@@ -540,10 +540,10 @@ if ($all_headers || $list_headers) {
     $a_template->set('common_headers', Horde::widget($headersURL, _("Show Common Headers"), 'widget', '', '', _("Show Common Headers"), true));
 }
 if (!$all_headers) {
-    $a_template->set('all_headers', Horde::widget($headersURL->cAdd('show_all_headers', 1), _("Show All Headers"), 'widget', '', '', _("Show All Headers"), true));
+    $a_template->set('all_headers', Horde::widget($headersURL->copy()->add('show_all_headers', 1), _("Show All Headers"), 'widget', '', '', _("Show All Headers"), true));
 }
 if ($list_info['exists'] && !$list_headers) {
-    $a_template->set('list_headers', Horde::widget($headersURL->cAdd('show_list_headers', 1), _("Show Mailing List Information"), 'widget', '', '', _("Show Mailing List Information"), true));
+    $a_template->set('list_headers', Horde::widget($headersURL->copy()->add('show_list_headers', 1), _("Show Mailing List Information"), 'widget', '', '', _("Show Mailing List Information"), true));
 }
 
 $hdrs = array();
@@ -587,7 +587,7 @@ if (!$readonly && $strip_atc) {
 /* Do MDN processing now. */
 $mdntext = '';
 if ($imp_ui->MDNCheck($imp_mbox['mailbox'], $uid, $mime_headers, Horde_Util::getFormData('mdn_confirm'))) {
-    $mdntext .= $imp_ui->formatStatusMsg(array(array('text' => array(_("The sender of this message is requesting a Message Disposition Notification from you when you have read this message."), sprintf(_("Click %s to send the notification message."), Horde::link(htmlspecialchars($selfURL->cAdd('mdn_confirm', 1))) . _("HERE") . '</a>')))));
+    $mdntext .= $imp_ui->formatStatusMsg(array(array('text' => array(_("The sender of this message is requesting a Message Disposition Notification from you when you have read this message."), sprintf(_("Click %s to send the notification message."), Horde::link(htmlspecialchars($selfURL->copy()->add('mdn_confirm', 1))) . _("HERE") . '</a>')))));
 }
 
 /* Build body text. This needs to be done before we build the attachment list
@@ -597,10 +597,10 @@ $inlineout = $imp_ui->getInlineOutput($imp_contents, $contents_mask, $part_info_
 /* Build the Attachments menu. */
 $a_template->set('atc', Horde::widget('#', _("Attachments"), 'widget hasmenu', '', '', _("Attachments"), true));
 if ($show_parts == 'atc') {
-    $a_template->set('show_parts_all', Horde::widget($headersURL->cAdd(array('show_parts' => 'all')), _("Show All Message Parts"), 'widget', '', '', _("Show All Message Parts"), true));
+    $a_template->set('show_parts_all', Horde::widget($headersURL->copy()->add(array('show_parts' => 'all')), _("Show All Message Parts"), 'widget', '', '', _("Show All Message Parts"), true));
 }
 if ($show_parts == 'all') {
-    $a_template->set('show_parts_atc', Horde::widget($headersURL->cAdd(array('show_parts' => 'atc')), _("Show Attachments Only"), 'widget', '', '', _("Show Attachments Only"), true));
+    $a_template->set('show_parts_atc', Horde::widget($headersURL->copy()->add(array('show_parts' => 'atc')), _("Show Attachments Only"), 'widget', '', '', _("Show Attachments Only"), true));
 }
 if (count($inlineout['display_ids']) > 2) {
     $a_template->set('download_all', Horde::widget($imp_contents->urlView($imp_contents->getMIMEMessage(), 'download_all'), _("Download All Attachments (in .zip file)"), 'widget', '', '', _("Download All Attachments (in .zip file)"), true));
index 68a5e78..0f54a32 100644 (file)
@@ -333,13 +333,13 @@ if ($prefs->getValue('use_pgp')) {
     if (!$t->get('empty_pubkey_list')) {
         $plist = array();
         foreach ($pubkey_list as $val) {
-            $linkurl = $selfURL->cAdd('email', $val['email']);
+            $linkurl = $selfURL->copy()->add('email', $val['email']);
             $plist[] = array(
                 'name' => $val['name'],
                 'email' => $val['email'],
-                'view' => Horde::link($linkurl->cAdd('actionID', 'view_public_key'), sprintf(_("View %s Public Key"), $val['name']), null, 'view_key'),
-                'info' => Horde::link($linkurl->cAdd('actionID', 'info_public_key'), sprintf(_("Information on %s Public Key"), $val['name']), null, 'info_key'),
-                'delete' => Horde::link($linkurl->cAdd('actionID', 'delete_public_key'), sprintf(_("Delete %s Public Key"), $val['name']), null, null, "if (confirm('" . addslashes(_("Are you sure you want to delete this public key?")) . "')) { return true; } else { return false; }")
+                'view' => Horde::link($linkurl->copy()->add('actionID', 'view_public_key'), sprintf(_("View %s Public Key"), $val['name']), null, 'view_key'),
+                'info' => Horde::link($linkurl->copy()->add('actionID', 'info_public_key'), sprintf(_("Information on %s Public Key"), $val['name']), null, 'info_key'),
+                'delete' => Horde::link($linkurl->copy()->add('actionID', 'delete_public_key'), sprintf(_("Delete %s Public Key"), $val['name']), null, null, "if (confirm('" . addslashes(_("Are you sure you want to delete this public key?")) . "')) { return true; } else { return false; }")
             );
         }
         $t->set('pubkey_list', $plist);
@@ -360,14 +360,14 @@ if ($prefs->getValue('use_pgp')) {
     if ($secure_check) {
         $t->set('has_key', $prefs->getValue('pgp_public_key') && $prefs->getValue('pgp_private_key'));
         if ($t->get('has_key')) {
-            $t->set('viewpublic', Horde::link($selfURL->cAdd('actionID', 'view_personal_public_key'), _("View Personal Public Key"), null, 'view_key'));
-            $t->set('infopublic', Horde::link($selfURL->cAdd('actionID', 'info_personal_public_key'), _("Information on Personal Public Key"), null, 'info_key'));
-            $t->set('sendkey', Horde::link($selfURL->cAdd('actionID', 'send_public_key'), _("Send Key to Public Keyserver")));
+            $t->set('viewpublic', Horde::link($selfURL->copy()->add('actionID', 'view_personal_public_key'), _("View Personal Public Key"), null, 'view_key'));
+            $t->set('infopublic', Horde::link($selfURL->copy()->add('actionID', 'info_personal_public_key'), _("Information on Personal Public Key"), null, 'info_key'));
+            $t->set('sendkey', Horde::link($selfURL->copy()->add('actionID', 'send_public_key'), _("Send Key to Public Keyserver")));
             $t->set('personalkey-public-help', Horde_Help::link('imp', 'pgp-personalkey-public'));
             $passphrase = $imp_pgp->getPassphrase('personal');
-            $t->set('passphrase', (empty($passphrase)) ? Horde::link('#', _("Enter Passphrase"), null, null, IMP::passphraseDialogJS('PGPPersonal') . ';return false;') . _("Enter Passphrase") : Horde::link($selfURL->cAdd('actionID', 'unset_passphrase'), _("Unload Passphrase")) . _("Unload Passphrase"));
-            $t->set('viewprivate', Horde::link($selfURL->cAdd('actionID', 'view_personal_private_key'), _("View Personal Private Key"), null, 'view_key'));
-            $t->set('infoprivate', Horde::link($selfURL->cAdd('actionID', 'info_personal_private_key'), _("Information on Personal Private Key"), null, 'info_key'));
+            $t->set('passphrase', (empty($passphrase)) ? Horde::link('#', _("Enter Passphrase"), null, null, IMP::passphraseDialogJS('PGPPersonal') . ';return false;') . _("Enter Passphrase") : Horde::link($selfURL->copy()->add('actionID', 'unset_passphrase'), _("Unload Passphrase")) . _("Unload Passphrase"));
+            $t->set('viewprivate', Horde::link($selfURL->copy()->add('actionID', 'view_personal_private_key'), _("View Personal Private Key"), null, 'view_key'));
+            $t->set('infoprivate', Horde::link($selfURL->copy()->add('actionID', 'info_personal_private_key'), _("Information on Personal Private Key"), null, 'info_key'));
             $t->set('personalkey-private-help', Horde_Help::link('imp', 'pgp-personalkey-private'));
             $t->set('deletekeypair', addslashes(_("Are you sure you want to delete your keypair? (This is NOT recommended!)")));
             $t->set('personalkey-delete-help', Horde_Help::link('imp', 'pgp-personalkey-delete'));
index 41c7549..46f8f65 100644 (file)
@@ -254,13 +254,13 @@ if ($openssl_check && $prefs->getValue('use_smime')) {
     if (!$t->get('empty_pubkey_list')) {
         $plist = array();
         foreach ($pubkey_list as $val) {
-            $linkurl = $selfURL->cAdd('email', $val['email']);
+            $linkurl = $selfURL->copy()->add('email', $val['email']);
             $plist[] = array(
                 'name' => $val['name'],
                 'email' => $val['email'],
-                'view' => Horde::link($linkurl->cAdd('actionID', 'view_public_key'), sprintf(_("View %s Public Key"), $val['name']), null, 'view_key'),
-                'info' => Horde::link($linkurl->cAdd('actionID', 'info_public_key'), sprintf(_("Information on %s Public Key"), $val['name']), null, 'info_key'),
-                'delete' => Horde::link($linkurl->cAdd('actionID', 'delete_public_key'), sprintf(_("Delete %s Public Key"), $val['name']), null, null, "if (confirm('" . addslashes(_("Are you sure you want to delete this public key?")) . "')) { return true; } else { return false; }")
+                'view' => Horde::link($linkurl->copy()->add('actionID', 'view_public_key'), sprintf(_("View %s Public Key"), $val['name']), null, 'view_key'),
+                'info' => Horde::link($linkurl->copy()->add('actionID', 'info_public_key'), sprintf(_("Information on %s Public Key"), $val['name']), null, 'info_key'),
+                'delete' => Horde::link($linkurl->copy()->add('actionID', 'delete_public_key'), sprintf(_("Delete %s Public Key"), $val['name']), null, null, "if (confirm('" . addslashes(_("Are you sure you want to delete this public key?")) . "')) { return true; } else { return false; }")
             );
         }
         $t->set('pubkey_list', $plist);
@@ -281,11 +281,11 @@ if ($openssl_check && $prefs->getValue('use_smime')) {
     if (!$t->get('secure_check')) {
         $t->set('has_key', $prefs->getValue('smime_public_key') && $prefs->getValue('smime_private_key'));
         if ($t->get('has_key')) {
-            $t->set('viewpublic', Horde::link($selfURL->cAdd('actionID', 'view_personal_public_key'), _("View Personal Public Key"), null, 'view_key'));
-            $t->set('infopublic', Horde::link($selfURL->cAdd('actionID', 'info_personal_public_key'), _("Information on Personal Public Key"), null, 'info_key'));
+            $t->set('viewpublic', Horde::link($selfURL->copy()->add('actionID', 'view_personal_public_key'), _("View Personal Public Key"), null, 'view_key'));
+            $t->set('infopublic', Horde::link($selfURL->copy()->add('actionID', 'info_personal_public_key'), _("Information on Personal Public Key"), null, 'info_key'));
             $passphrase = $imp_smime->getPassphrase();
-            $t->set('passphrase', empty($passphrase) ? Horde::link('#', _("Enter Passphrase"), null, null, IMP::passphraseDialogJS('SMIMEPersonal') . ';return false;') . _("Enter Passphrase") : Horde::link($selfURL->cAdd('actionID', 'unset_passphrase'), _("Unload Passphrase")) . _("Unload Passphrase"));
-            $t->set('viewprivate', Horde::link($selfURL->cAdd('actionID', 'view_personal_private_key'), _("View Personal Private Key"), null, 'view_key'));
+            $t->set('passphrase', empty($passphrase) ? Horde::link('#', _("Enter Passphrase"), null, null, IMP::passphraseDialogJS('SMIMEPersonal') . ';return false;') . _("Enter Passphrase") : Horde::link($selfURL->copy()->add('actionID', 'unset_passphrase'), _("Unload Passphrase")) . _("Unload Passphrase"));
+            $t->set('viewprivate', Horde::link($selfURL->copy()->add('actionID', 'view_personal_private_key'), _("View Personal Private Key"), null, 'view_key'));
             $t->set('deletekeypair', addslashes(_("Are you sure you want to delete your keypair? (This is NOT recommended!)")));
             $t->set('personalkey-delete-help', Horde_Help::link('imp', 'smime-delete-personal-certs'));
         } else {
index 53d352e..8ecb793 100644 (file)
@@ -128,7 +128,7 @@ $t->set('plain', $stationery['t'] == 'plain');
 $t->set('html', $stationery['t'] == 'html');
 $t->set('content_label', Horde::label('content', _("Stationery:")));
 $t->set('content', $stationery['c']);
-$t->set('button_href', $compose_url->cAdd('group', 'compose'));
+$t->set('button_href', $compose_url->copy()->add('group', 'compose'));
 $t->set('button_val', htmlspecialchars(_("Return to Message Composition"), ENT_COMPAT, Horde_Nls::getCharset()));
 
 echo $t->fetch(IMP_TEMPLATES . '/stationery/stationery.html');