Horde::link -> Horde_Url#link()
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 9 Aug 2010 20:24:32 +0000 (14:24 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 10 Aug 2010 20:08:48 +0000 (14:08 -0600)
imp/compose.php
imp/folders.php
imp/templates/imp/compose/redirect.html

index f3aa9ef..d724f2f 100644 (file)
@@ -696,6 +696,8 @@ $t->setOption('gettext', true);
 $t->set('post_action', Horde::applicationUrl('compose.php')->unique());
 $t->set('allow_compose', !$compose_disable);
 
+$blank_url = new Horde_Url('#');
+
 if ($redirect) {
     /* Prepare the redirect template. */
     $t->set('cacheid', $composeCacheID);
@@ -707,8 +709,11 @@ if ($redirect) {
     $t->set('status', Horde::endBuffer());
 
     if ($registry->hasMethod('contacts/search')) {
-        $t->set('has_search', true);
-        $t->set('abook', Horde::link('#', _("Address Book"), 'widget', null, 'window.open(\'' . Horde::applicationUrl('contacts.php')->add(array('formname' => 'redirect', 'to_only' => 1)) . '\', \'contacts\', \'toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes,width=550,height=300,left=100,top=100\'); return false;') . Horde::img('addressbook_browse.png') . '<br />' . _("Address Book") . '</a>');
+        $t->set('abook', $blank_url->copy()->link(array(
+            'class' => 'widget',
+            'onclick.raw' => 'window.open("' . Horde::applicationUrl('contacts.php')->add(array('formname' => 'redirect', 'to_only' => 1)) . '", "contacts", "toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes,width=550,height=300,left=100,top=100"); return false;',
+            'title' => _("Address Book")
+        )) . Horde::img('addressbook_browse.png') . '<br />' . _("Address Book") . '</a>');
     }
 
     $t->set('to', Horde::label('to', _("To")));
@@ -856,20 +861,28 @@ if ($redirect) {
     $compose_options = array();
     if ($registry->hasMethod('contacts/search')) {
         $compose_options[] = array(
-            'url' => Horde::link('#', '', 'widget', null, 'window.open(\'' . Horde::applicationUrl('contacts.php') . '\', \'contacts\', \'toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes,width=550,height=300,left=100,top=100\'); return false;'),
+            'url' => $blank_url->copy()->link(array(
+                'class' => 'widget',
+                'onclick.raw' => 'window.open("' . Horde::applicationUrl('contacts.php') . '","contacts","toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes,width=550,height=300,left=100,top=100"); return false;'
+            )),
             'img' => Horde::img('addressbook_browse.png'),
             'label' => $show_text ? _("Address Book") : ''
         );
     }
     if ($spellcheck) {
         $compose_options[] = array(
-            'url' => Horde::link('#', '', 'widget', '', 'return false', '', '',
-                                 array('id' => 'spellcheck')),
-            'img' => '', 'label' => '');
+            'url' => $blank_url->copy()->link(array(
+                'class' => 'widget',
+                'id' => 'spellcheck'
+            )),
+            'img' => '',
+            'label' => ''
+        );
     }
     if ($_SESSION['imp']['file_upload']) {
+        $url = new Horde_Url('#attachments');
         $compose_options[] = array(
-            'url' => Horde::link('#attachments', '', 'widget'),
+            'url' => $url->link(array('class' => 'widget')),
             'img' => Horde::img('manage_attachments.png'),
             'label' => $show_text ? _("Attachments") : ''
         );
@@ -922,7 +935,10 @@ if ($redirect) {
     $t->set('compose_html', (!is_null($rtemode) && !$prefs->isLocked('compose_html')));
     if ($t->get('compose_html')) {
         $t->set('html_img', Horde::img('compose.png', _("Switch Composition Method")));
-        $t->set('html_switch', Horde::link('#', _("Switch Composition Method"), '', '', "$('rtemode').value='" . ($rtemode ? 0 : 1) . "';ImpCompose.uniqSubmit('toggle_editor');return false;"));
+        $t->set('html_switch', $blank_url->copy()->link(array(
+            'onclick.raw' => "$('rtemode').value='" . ($rtemode ? 0 : 1) . "';ImpCompose.uniqSubmit('toggle_editor');return false;",
+            'title' => _("Switch Composition Method")
+        )));
         $t->set('rtemode', $rtemode);
     }
 
@@ -1006,7 +1022,11 @@ if ($redirect) {
                         'composeCache' => $composeCacheID,
                         'id' => $atc_num
                     ));
-                    $entry['name'] = Horde::link($preview_url, _("Preview") . ' ' . $entry['name'], 'link', 'compose_preview_window') . $entry['name'] . '</a>';
+                    $entry['name'] = $preview_url->link(array(
+                        'class' => 'link',
+                        'target' => 'compose_preview_window',
+                        'title' => _("Preview")
+                    )) . $entry['name'] . '</a>';
                 }
 
                 $atc[] = $entry;
index 698a68d..d1310b9 100644 (file)
@@ -387,7 +387,10 @@ $refresh_title = Horde::stripAccessKey($refresh_title);
 if (!empty($refresh_ak)) {
     $refresh_title .= sprintf(_(" (Accesskey %s)"), $refresh_ak);
 }
-$head_template->set('refresh', Horde::link($folders_url_ob, $refresh_title, '', '', '', $refresh_title, $refresh_ak));
+$head_template->set('refresh', $folder_url_ob->link(array(
+    'accesskey' => $refresh_ak,
+    'title' => $refresh_title
+)));
 $head_template->set('folders_token', $folders_token);
 
 /* Prepare the actions template. */
@@ -439,8 +442,8 @@ foreach ($raw_rows as $key => $val) {
     $val['nocheckbox'] = !empty($val['vfolder']);
     if (!empty($val['vfolder']) && $val['editvfolder']) {
         $imp_search = $injector->getInstance('IMP_Search');
-        $val['delvfolder'] = Horde::link($imp_search->deleteUrl($val['value']), _("Delete Virtual Folder")) . _("Delete") . '</a>';
-        $val['editvfolder'] = Horde::link($imp_search->editUrl($val['value']), _("Edit Virtual Folder")) . _("Edit") . '</a>';
+        $val['delvfolder'] = $imp_search->deleteUrl($val['value'])->link(array('title' => _("Delete Virtual Folder"))) . _("Delete") . '</a>';
+        $val['editvfolder'] = $imp_search->editUrl($val['value'])->link(array('title' => _("Edit Virtual Folder"))) . _("Edit") . '</a>';
     }
 
     $val['cname'] = (++$rowct % 2) ? 'item0' : 'item1';
@@ -457,7 +460,7 @@ foreach ($raw_rows as $key => $val) {
         if (!empty($val['unseen'])) {
             $val['name'] = '<strong>' . $val['name'] . '</strong>';
         }
-        $val['name'] = Horde::link($name_url->copy()->add('mailbox', $val['value']), $val['vfolder'] ? $val['base_elt']['l'] : $val['display']) . $val['name'] . '</a>';
+        $val['name'] = $name_url->copy()->add('mailbox', $val['value'])->link(array('title' => $val['vfolder'] ? $val['base_elt']['l'] : $val['display'])) . $val['name'] . '</a>';
     }
 
     $val['line'] = $tree_imgs[$key];
index 230dca0..c3dccf4 100644 (file)
@@ -9,7 +9,7 @@
  <tag:title />
 </h1>
 <table width="100%" border="0" cellpadding="0" cellspacing="0">
-<if:has_search>
+<if:abook>
  <tr>
   <td>&nbsp;</td>
   <td class="item">
@@ -20,7 +20,7 @@
    </table>
   </td>
  </tr>
-</if:has_search>
+</if:abook>
 
  <tr>
   <td class="light rightAlign"><strong><tag:to />&nbsp;</strong></td>