Use Horde_Url style links, parameter adding etc...
authorMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 2 Jun 2010 17:34:43 +0000 (13:34 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 2 Jun 2010 17:35:18 +0000 (13:35 -0400)
54 files changed:
ansel/faces/claim.php
ansel/faces/custom.php
ansel/faces/gallery.php
ansel/faces/report.php
ansel/faces/savecustom.php
ansel/gallery.php
ansel/group.php
ansel/image.php
ansel/lib/Ajax/Imple/ImageSaveGeotag.php
ansel/lib/Ajax/Imple/TagActions.php
ansel/lib/Ansel.php
ansel/lib/Api.php
ansel/lib/Block/gallery.php
ansel/lib/Block/my_galleries.php
ansel/lib/Block/random_photo.php
ansel/lib/Block/recent_comments.php
ansel/lib/Block/recently_added.php
ansel/lib/Block/recently_added_geodata.php
ansel/lib/Faces.php
ansel/lib/Faces/Base.php
ansel/lib/Tags.php
ansel/lib/Tile/DateGallery.php
ansel/lib/Tile/Gallery.php
ansel/lib/Tile/Image.php
ansel/lib/View/Gallery.php
ansel/lib/View/GalleryRenderer/Gallery.php
ansel/lib/View/GalleryRenderer/GalleryLightbox.php
ansel/lib/View/Image.php
ansel/lib/View/List.php
ansel/lib/View/Results.php
ansel/lib/Widget/Actions.php
ansel/lib/Widget/GalleryFaces.php
ansel/lib/Widget/Geotag.php
ansel/lib/Widget/ImageFaces.php
ansel/lib/Widget/Links.php
ansel/lib/Widget/OtherGalleries.php
ansel/lib/Widget/OwnerFaces.php
ansel/lib/Widget/SimilarPhotos.php
ansel/lib/Widget/Tags.php
ansel/protect.php
ansel/rss.php
ansel/templates/faces/face.inc
ansel/templates/faces/gallery.inc
ansel/templates/faces/image.inc
ansel/templates/faces/search.inc
ansel/templates/image/preview_image.inc
ansel/templates/image/upload.inc
ansel/templates/tile/face.inc
ansel/templates/tile/image.inc
ansel/templates/view/gallery.inc
ansel/templates/view/gallerylightbox.inc
ansel/templates/view/list.inc
ansel/templates/view/results.inc
ansel/xppublish.php

index 35273d1..f32f16c 100644 (file)
@@ -37,13 +37,10 @@ if ($form->validate()) {
         $report = Ansel_Report::factory();
         $gallery = $ansel_storage->getGallery($face['gallery_id']);
 
-        $face_link = Horde_Util::addParameter(
-            Horde::applicationUrl('faces/custom.php', true),
+        $face_link = Horde::applicationUrl('faces/custom.php', true)->add(
             array('name' => $vars->get('person'),
                   'face' => $face_id,
-                  'image' => $face['image_id']),
-            null,
-            false);
+                  'image' => $face['image_id']))->setRaw(true);
 
         $title = _("I know who is on one of your photos");
         $body = _("Gallery Name") . ': ' . $gallery->get('name') . "\n"
index 09465ef..21db99f 100644 (file)
@@ -21,7 +21,7 @@ $urlparams = array('page' => $page);
 if (!empty($url)) {
     $urlparams['url'] = $url;
 }
-$form_post = Horde_Util::addParameter(Horde::applicationUrl('faces/savecustom.php'), $urlparams);
+$form_post = Horde::applicationUrl('faces/savecustom.php')->add($urlparams);
 
 try {
     $image = $ansel_storage->getImage($image_id);
index 1d20b14..a93faf9 100644 (file)
@@ -40,7 +40,7 @@ $images = $gallery->getImages($page * $perpage, $perpage);
 
 $reloadimage = Horde::img('reload.png');
 $customimage = Horde::img('layout.png');
-$customurl = Horde_Util::addParameter(Horde::applicationUrl('faces/custom.php'), 'page', $page);
+$customurl = Horde::applicationUrl('faces/custom.php')->add('page', $page);
 $face = $GLOBALS['injector']->getInstance('Ansel_Faces');
 $autogenerate = $face->canAutogenerate();
 
@@ -56,7 +56,7 @@ $pager = new Horde_Ui_Pager(
 );
 $pager->preserve('gallery',  $gallery_id);
 
-$title = sprintf(_("Searching for faces in %s"), Horde::link(Ansel::getUrlFor('view', array('gallery' => $gallery_id, 'view' => 'Gallery'))) . $gallery->get('name') . '</a>');
+$title = sprintf(_("Searching for faces in %s"),Ansel::getUrlFor('view', array('gallery' => $gallery_id, 'view' => 'Gallery'))->link() . $gallery->get('name') . '</a>');
 Horde::addScriptFile('stripe.js', 'horde');
 Horde::addScriptFile('popup.js', 'horde');
 require ANSEL_TEMPLATES . '/common-header.inc';
index cecd1bd..bd1456c 100644 (file)
@@ -41,10 +41,10 @@ if ($form->validate()) {
         $report = Ansel_Report::factory();
         $gallery = $ansel_storage->getGallery($face['gallery_id']);
 
-        $face_link = Horde_Util::addParameter(Horde::applicationUrl('faces/face.php', true),
-                        array('name' => $vars->get('person'),
-                              'face' => $face_id,
-                                'image' => $face['image_id']), null, false);
+        $face_link = Horde::applicationUrl('faces/face.php', true)->add(
+                array('name' => $vars->get('person'),
+                      'face' => $face_id,
+                      'image' => $face['image_id']))->setRaw(true);
 
         $body = _("Gallery Name") . ': ' . $gallery->get('name') . "\n"
                 . _("Gallery Description") . ': ' . $gallery->get('desc') . "\n\n"
index 79a88bc..b2a0e0f 100644 (file)
@@ -19,11 +19,11 @@ $face_id = (int)Horde_Util::getFormData('face_id');
 $url = Horde_Util::getFormData('url');
 $page = Horde_Util::getFormData('page', 0);
 
-$back_url = empty($url) ?
-    Horde_Util::addParameter(Horde::applicationUrl('faces/gallery.php'),
-                             array('gallery' => $gallery_id,
-                                   'page' => $page), null, false) :
-    $url;
+$back_url = empty($url)
+    ? Horde::applicationUrl('faces/gallery.php')->add(
+            array('gallery' => $gallery_id,
+                  'page' => $page))->setRaw(true)
+    $url;
 
 if (Horde_Util::getPost('submit') == _("Cancel")) {
     $notification->push(_("Changes cancelled."), 'horde.warning');
index 768121e..8b0d919 100644 (file)
@@ -280,7 +280,7 @@ case 'save':
     $url = Horde_Util::getFormData('url');
     if (empty($url) && empty($exists)) {
         // Redirect to the images upload page for newly creted galleries
-        $url = Horde_Util::addParameter(Horde::applicationUrl('img/upload.php'), 'gallery', $galleryId);
+        $url = Horde::applicationUrl('img/upload.php')->add('gallery', $galleryId);
     } elseif (empty($url)) {
         $url = Horde::applicationUrl('index.php', true);
     }
@@ -315,7 +315,7 @@ case 'generateDefault':
         $gallery = $ansel_storage->getGallery($galleryId);
         $gallery->clearStacks();
         $notification->push(_("The gallery's default photo has successfully been reset."), 'horde.success');
-        header('Location: ' . Horde::applicationUrl(Horde_Util::addParameter('view.php', 'gallery', $galleryId), true));
+        header('Location: ' . Horde::applicationUrl('view.php', true)->add('gallery', $galleryId));
         exit;
     } catch (Ansel_Exception $e) {
         $notification->push($e->getMessage(), 'horde.error');
@@ -335,7 +335,7 @@ case 'generateThumbs':
     }
     $gallery->clearThumbs();
     $notification->push(_("The gallery's thumbnails have successfully been reset."), 'horde.success');
-    header('Location: ' . Horde::applicationUrl(Horde_Util::addParameter('view.php', 'gallery', $galleryId), true));
+    header('Location: ' . Horde::applicationUrl('view.php', true)->add('gallery', $galleryId));
     exit;
 
 case 'deleteCache':
@@ -350,7 +350,7 @@ case 'deleteCache':
     }
     $gallery->clearViews();
     $notification->push(_("The gallery's views have successfully been reset."), 'horde.success');
-    header('Location: ' . Horde::applicationUrl(Horde_Util::addParameter('view.php', 'gallery', $galleryId), true));
+    header('Location: ' . Horde::applicationUrl('view.php', true)->add('gallery', $galleryId));
     exit;
 
 default:
index efc110a..accc8a1 100644 (file)
@@ -93,12 +93,12 @@ $end = min($num_groups, $min + $groups_perpage);
 $count = 0;
 $groupby_links = array();
 if ($groupby !== 'owner') {
-    $groupby_links[] = Horde::link(Ansel::getUrlFor('group', array('actionID' => 'groupby', 'groupby' => 'owner'))) . _("owner") . '</a>';
+    $groupby_links[] = Ansel::getUrlFor('group', array('actionID' => 'groupby', 'groupby' => 'owner'))->link() . _("owner") . '</a>';
 } elseif ($groupby !== 'category') {
-    $groupby_links[] = Horde::link(Ansel::getUrlFor('group', array('actionID' => 'groupby', 'groupby' => 'category'))) . _("category") . '</a>';
+    $groupby_links[] = Ansel::getUrlFor('group', array('actionID' => 'groupby', 'groupby' => 'category'))->link() . _("category") . '</a>';
 }
 if ($groupby !== 'none') {
-    $groupby_links[] = Horde::link(Ansel::getUrlFor('group', array('actionID' => 'groupby', 'groupby' => 'none'))) . _("none") . '</a>';
+    $groupby_links[] = Ansel::getUrlFor('group', array('actionID' => 'groupby', 'groupby' => 'none'))->link() . _("none") . '</a>';
 }
 
 require ANSEL_TEMPLATES . '/common-header.inc';
index fc297e6..b468aa6 100644 (file)
@@ -284,8 +284,8 @@ case 'resizeedit':
                                            'page' => $page),
                                      $date),
                                      true);
-    $imageurl = Horde::applicationUrl('image.php');
-    $imageurl->add(array_merge(
+    $imageurl = Horde::applicationUrl('image.php')->add(
+            array_merge(
                     array('gallery' => $gallery_id,
                           'slug' => $gallery->get('slug'),
                           'image' => $image_id,
@@ -309,7 +309,7 @@ case 'resizeedit':
     }
 
     /* Retrieve image details. */
-    $image = &$ansel_storage->getImage($image_id);
+    $image = $ansel_storage->getImage($image_id);
     $title = sprintf(_("Edit %s :: %s"), $gallery->get('name'),
                      $image->filename);
 
@@ -371,8 +371,8 @@ case 'watermark':
         $image->watermark('screen', $watermark, $watermark_halign,
                                 $watermark_valign, $watermark_font);
         $image->updateData($image->raw('screen'), 'screen');
-        $imageurl = Horde::applicationUrl('image.php', true);
-        $imageurl->add(array_merge(
+        $imageurl = Horde::applicationUrl('image.php', true)->add(
+                array_merge(
                        array('gallery' => $gallery_id,
                              'image' => $image_id,
                              'actionID' => 'editimage',
@@ -447,8 +447,8 @@ case 'resize':
         }
     }
 
-    $imageurl = Horde::applicationUrl('image.php', true);
-    $imageurl->add(array_merge(
+    $imageurl = Horde::applicationUrl('image.php', true)->add(
+            array_merge(
                     array('gallery' => $gallery_id,
                           'image' => $image_id,
                           'actionID' => 'editimage',
@@ -478,17 +478,17 @@ case 'setwatermark':
     exit;
 
 case 'previewcustomwatermark':
-    $imageurl = Horde::applicationUrl('image.php', true);
-    $imageurl->add(array_merge(
-                       array('gallery' => $gallery_id,
-                             'image' => $image_id,
-                             'page' => $page,
-                             'watermark' => $watermark,
-                             'font' => $watermark_font,
-                             'whalign' => $watermark_halign,
-                             'wvalign' => $watermark_valign,
-                             'actionID' => 'previewwatermark'),
-                       $date));
+    $imageurl = Horde::applicationUrl('image.php', true)->add(
+            array_merge(
+               array('gallery' => $gallery_id,
+                     'image' => $image_id,
+                     'page' => $page,
+                     'watermark' => $watermark,
+                     'font' => $watermark_font,
+                     'whalign' => $watermark_halign,
+                     'wvalign' => $watermark_valign,
+                     'actionID' => 'previewwatermark'),
+               $date));
 
     echo Horde::wrapInlineScript(array(
         'window.opener.location.href = "' . $imageurl . '";',
index c2ecd12..153c97a 100644 (file)
@@ -62,8 +62,8 @@ class Ansel_Ajax_Imple_ImageSaveGeotag extends Horde_Ajax_Imple_Base
         case 'untag':
             $image->geotag('', '', '');
             // Now get the "add geotag" stuff
-            $addurl = Horde_Util::addParameter(Horde::applicationUrl('map_edit.php'), 'image', $img);
-            $addLink = Horde::link($addurl, '', '', '', Horde::popupJs(Horde::applicationUrl('map_edit.php'), array('params' => array('image' => $img), 'urlencode' => true, 'width' => '750', 'height' => '600')) . 'return false;');
+            $addurl = Horde::applicationUrl('map_edit.php')->add('image', $img);
+            $addLink = $addurl->link(array('onclick' => Horde::popupJs(Horde::applicationUrl('map_edit.php'), array('params' => array('image' => $img), 'urlencode' => true, 'width' => '750', 'height' => '600')) . 'return false;'));
             $imgs = $GLOBALS['ansel_storage']->getRecentImagesGeodata(Horde_Auth::getAuth());
             if (count($imgs) > 0) {
                 $imgsrc = '<div class="ansel_location_sameas">';
@@ -73,7 +73,10 @@ class Ansel_Ajax_Imple_ImageSaveGeotag extends Horde_Ajax_Imple_Base
                     } else {
                         $title = $this->_point2Deg($data['image_latitude'], true) . ' ' . $this->_point2Deg($data['image_longitude']);
                     }
-                    $imgsrc .= Horde::link($addurl, $title, '', '', "Ansel.widgets.geotag.setLocation('" . $data['image_latitude'] . "', '" . $data['image_longitude'] . "');return false") . '<img src="' . Ansel::getImageUrl($id, 'mini', true) . '" alt="[image]" /></a>';
+                    $imgsrc .= $addurl->link(
+                            array('title' => $title,
+                                  'onclick' => "Ansel.widgets.geotag.setLocation('" . $data['image_latitude'] . "', '" . $data['image_longitude'] . "');return false"))
+                        . '<img src="' . Ansel::getImageUrl($id, 'mini', true) . '" alt="[image]" /></a>';
                 }
                 $imgsrc .= '</div>';
                 $content = sprintf(_("No location data present. Place using %smap%s or click on image to place at the same location."), $addLink, '</a>') . $imgsrc;
index b914ee0..6e6152c 100644 (file)
@@ -108,7 +108,7 @@ class Ansel_Ajax_Imple_TagActions extends Horde_Ajax_Imple_Base
         $links = Ansel_Tags::getTagLinks($tags, 'add');
         $html = '<ul>';
         foreach ($tags as $tag_id => $taginfo) {
-            $html .= '<li>' . Horde::link($links[$tag_id], sprintf(ngettext("%d photo", "%d photos", $taginfo['total']), $taginfo['total'])) . htmlspecialchars($taginfo['tag_name']) . '</a>' . ($hasEdit ? '<a href="#" onclick="removeTag(' . $tag_id . ');">' . Horde::img('delete-small.png', _("Remove Tag")) . '</a>' : '') . '</li>';
+            $html .= '<li>' . $links[$tag_id]->link(array('title' => sprintf(ngettext("%d photo", "%d photos", $taginfo['total']), $taginfo['total']))) . htmlspecialchars($taginfo['tag_name']) . '</a>' . ($hasEdit ? '<a href="#" onclick="removeTag(' . $tag_id . ');">' . Horde::img('delete-small.png', _("Remove Tag")) . '</a>' : '') . '</li>';
         }
         $html .= '</ul>';
         return $html;
index 933a90c..686ef7d 100644 (file)
@@ -185,13 +185,13 @@ class Ansel
                     } elseif ($groupby == 'none') {
                        $url = 'all/';
                     }
-                    $url = new Horde_Url($url);
+                    $url = Horde::applicationUrl($url, $full, $append_session);
                     // Keep the URL as clean as possible - don't append the page
                     // number if it's zero, which would be the default.
                     if (!empty($data['page'])) {
                         $url->add('page', $data['page']);
                     }
-                    return Horde::applicationUrl($url, $full, $append_session);
+                    return $url;
                 }
 
                 /* Viewing a Gallery or Image */
@@ -251,7 +251,7 @@ class Ansel
 
                     $url = new Horde_Url($url);
                     if (count($extras)) {
-                        $url = $url->add($extras);
+                        $url->add($extras);
                     }
 
                 } elseif ($data['view'] == 'Results')  {
@@ -260,24 +260,24 @@ class Ansel
                                      : ''));
 
                     if (!empty($data['actionID'])) {
-                        $url = $url->add(array('actionID' => $data['actionID']));
+                        $url->add(array('actionID' => $data['actionID']));
                     }
 
                     if (!empty($data['owner'])) {
-                        $url = $url->add('owner', $data['owner']);
+                        $url->add('owner', $data['owner']);
                     }
                 }
 
                 // Keep the URL as clean as possible - don't append the page
                 // number if it's zero, which would be the default.
                 if (!empty($data['page'])) {
-                    $url = $url->add('page', $data['page']);
+                    $url->add('page', $data['page']);
                 }
 
                 if (!empty($data['year'])) {
-                    $url = $url->add(array('year' => $data['year'],
-                                           'month' => (empty($data['month']) ? 0 : $data['month']),
-                                           'day' => (empty($data['day']) ? 0 : $data['day'])));
+                    $url->add(array('year' => $data['year'],
+                                    'month' => (empty($data['month']) ? 0 : $data['month']),
+                                    'day' => (empty($data['day']) ? 0 : $data['day'])));
                 }
 
                 // If we are using GalleryLightbox, AND we are linking to an
@@ -294,15 +294,13 @@ class Ansel
 
                 return Horde::applicationUrl($url, $full, $append_session);
             } else {
-                $url = new Horde_Url('view.php');
-                $url->add($data);
-                $url = Horde::applicationUrl($url, $full, $append_session);
-                $url->setRaw(true);
+                $url = Horde::applicationUrl('view.php', $full, $append_session);
+                $url->add($data)->setRaw(true);
                 if ($data['view'] == 'Image' &&
                     !empty($data['gallery_view']) &&
                     $data['gallery_view'] == 'GalleryLightbox') {
 
-                    $url = '#' . $data['image'];
+                    $url .= '#' . $data['image'];
                 }
 
                 return $url;
@@ -324,26 +322,21 @@ class Ansel
                     $url = 'all/';
                 }
                 unset($data['groupby']);
-                $url = new Horde_Url($url);
+                Horde::applicationUrl($url, $full, $append_session);
                 if (count($data)) {
-                    $url = $url->add($data);
+                    $url->add($data);
                 }
-                return Horde::applicationUrl($url, $full, $append_session);
-            } else {
-                $url = new Horde_Url('group.php');
-                $url = Horde::applicationUrl($url, $full, $append_session);
-                $url->add($data);
                 return $url;
+            } else {
+                return Horde::applicationUrl('group.php', $full, $append_session)->add($data);
             }
 
         case 'rss_user':
             if ($rewrite) {
-                $url = new Horde_Url('user/' . urlencode($data['owner']) . '/rss');
-                return Horde::applicationUrl($url, $full, $append_session);
+                return Horde::applicationUrl('user/' . urlencode($data['owner']) . '/rss', $full, $append_session);
             } else {
                 $url = Horde::applicationUrl(new Horde_Url('rss.php'), $full, $append_session);
-                $url->add(array('stream_type' => 'user', 'id' => $data['owner']));
-                return $url;
+                return $url->add(array('stream_type' => 'user', 'id' => $data['owner']));
             }
 
         case 'rss_gallery':
@@ -351,11 +344,9 @@ class Ansel
                 $id = (!empty($data['slug'])) ? $data['slug'] : 'id/' . (int)$data['gallery'];
                 return Horde::applicationUrl(new Horde_Url('gallery/' . $id . '/rss'), $full, $append_session);
             } else {
-                $url = new Horde_Url('rss.php');
-                $url->add(array('stream_type' => 'gallery',
-                                'id' => (int)$data['gallery']));
-
-                return Horde::applicationUrl($url, $full, $append_session);
+                return Horde::applicationUrl('rss.php', $full, $append_session)->add(
+                            array('stream_type' => 'gallery',
+                                  'id' => (int)$data['gallery']));
             }
 
         case 'default_view':
@@ -448,7 +439,7 @@ class Ansel
             if (!is_null($style)) {
                 $params['style'] = $style;
             }
-            return Horde::applicationUrl(Horde_Util::addParameter('img/' . $view . '.php', $params), $full);
+            return Horde::applicationUrl('img/' . $view . '.php', $full)->add($params);
         }
 
         // Using vfs-direct
@@ -594,7 +585,7 @@ class Ansel
         if ($GLOBALS['registry']->isAdmin() ||
             (!$GLOBALS['injector']->getInstance('Horde_Perms')->exists('ansel') && Horde_Auth::getAuth()) ||
             $GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('ansel', Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
-            $menu->add(Horde::applicationUrl(Horde_Util::addParameter('gallery.php', 'actionID', 'add')),
+            $menu->add(Horde::applicationUrl('gallery.php')->add('actionID', 'add'),
                        _("_New Gallery"), 'add.png', null, null, null,
                        (basename($_SERVER['PHP_SELF']) == 'gallery.php' &&
                         Horde_Util::getFormData('actionID') == 'add')
@@ -710,7 +701,7 @@ class Ansel
                     } else {
                         $urlParameters = $urlFlags;
                     }
-                    $nav = $separator . Horde::link(Ansel::getUrlFor('view', array_merge($navdata, $urlParameters))) . $title . '</a>' . $nav;
+                    $nav = $separator . Ansel::getUrlFor('view', array_merge($navdata, $urlParameters))->link() . $title . '</a>' . $nav;
                 } else {
                     $nav = $separator . '<span class="thiscrumb">' . $title . '</span>' . $nav;
                 }
@@ -721,7 +712,7 @@ class Ansel
             $owner_title = htmlspecialchars($owner_title, ENT_COMPAT, Horde_Nls::getCharset());
             $levels++;
             if ($gallery) {
-                $nav = $separator . Horde::link(Ansel::getUrlFor('view', array('view' => 'List', 'groupby' => 'owner', 'owner' => $owner, 'havesearch' => $haveSearch))) . $owner_title . '</a>' . $nav;
+                $nav = $separator . Ansel::getUrlFor('view', array('view' => 'List', 'groupby' => 'owner', 'owner' => $owner, 'havesearch' => $haveSearch))->link() . $owner_title . '</a>' . $nav;
             } else {
                 $nav = $separator . $owner_title . $nav;
             }
@@ -729,10 +720,10 @@ class Ansel
 
         if ($haveSearch == 0) {
             $text = _("Galleries");
-            $link = Horde::link(Ansel::getUrlFor('view', array('view' => 'List')));
+            $link = Ansel::getUrlFor('view', array('view' => 'List'))->link();
         } else {
             $text = _("Browse Tags");
-            $link = Horde::link(Ansel::getUrlFor('view', array('view' => 'Results'), true));
+            $link = Ansel::getUrlFor('view', array('view' => 'Results'), true)->link();
         }
         if ($levels > 0) {
             $nav = $link . $text . '</a>' . $nav;
index da35f35..6de9e1b 100644 (file)
@@ -787,8 +787,7 @@ class Ansel_Api extends Horde_Registry_Api
             $imagelist[$id]['original_date'] = $image->originalDate;
             $imagelist[$id]['url'] = Ansel::getImageUrl($id, $view, $full, $style);
             if (!is_null($app) && $GLOBALS['conf']['vfs']['src'] != 'direct') {
-                $imagelist[$id]['url'] = Horde_Util::addParameter($imagelist[$id]['url'],
-                    'app', $app);
+                $imagelist[$id]['url']->add('app', $app);
             }
         }
         return $imagelist;
@@ -832,8 +831,7 @@ class Ansel_Api extends Horde_Registry_Api
             $imagelist[$id]['original_date'] = $image->originalDate;
 
             if (!is_null($app) && $GLOBALS['conf']['vfs']['src'] != 'direct') {
-                $imagelist[$id]['url'] = Horde_Util::addParameter($imagelist[$id]['url'],
-                    'app', $app);
+                $imagelist[$id]['url']->add('app', $app);
             }
         }
         return $imagelist;
@@ -944,13 +942,13 @@ class Ansel_Api extends Horde_Registry_Api
         if (!empty($results['galleries'])) {
             foreach ($results['galleries'] as $gallery) {
                 $gal = $GLOBALS['ansel_storage']->getGallery($gallery);
-                $view_url = Horde_Util::addParameter(Horde::applicationUrl('view.php'), array('gallery' => $gallery,
-                    'view' => 'Gallery'));
+                $view_url = Horde::applicationUrl('view.php')->add(
+                        array('gallery' => $gallery,
+                              'view' => 'Gallery'));
                 $return[] = array('title' => $gal->get('name'),
-                    'desc' => $gal->get('desc'),
-                    'view_url' => $view_url,
-                    'app' => $app);
-
+                                  'desc' => $gal->get('desc'),
+                                  'view_url' => $view_url,
+                                  'app' => $app);
             }
         }
 
index 02ede55..4ffd086 100644 (file)
@@ -50,8 +50,7 @@ class Horde_Block_ansel_gallery extends Horde_Block {
         try {
             $gallery = $this->_getGallery();
         } catch (Horde_Exception $e) {
-            return Horde::link(Ansel::getUrlFor('view', array('view' => 'List'),
-                                                true)) . _("Gallery") . '</a>';
+            return Ansel::getUrlFor('view', array('view' => 'List'), true)->link() . _("Gallery") . '</a>';
         }
 
         // Build the gallery name.
@@ -68,7 +67,7 @@ class Horde_Block_ansel_gallery extends Horde_Block {
                   'gallery' => $gallery->id,
                   'slug' => $gallery->get('slug')),
             true);
-        return Horde::link($viewurl)
+        return $viewurl->link()
                . @htmlspecialchars($name, ENT_COMPAT, Horde_Nls::getCharset())
                . '</a>';
 
@@ -96,9 +95,7 @@ class Horde_Block_ansel_gallery extends Horde_Block {
                                                   'slug' => $gallery->get('slug')),
                                     true);
         $html .= '<noscript>';
-        $html .= Horde::link($viewurl, sprintf(_("View %s"),
-                            $gallery->get('name')));
-
+        $html .= $viewurl->link(array('title' => sprintf(_("View %s"), $gallery->get('name'))));
         if ($iid = $gallery->getDefaultImage('ansel_default') &&
             $gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
 
index 70e620c..91e4d4c 100644 (file)
@@ -28,10 +28,10 @@ class Horde_Block_ansel_my_galleries extends Horde_Block {
 
     function _title()
     {
-        return Horde::link(
-            Ansel::getUrlFor('view',array('groupby' => 'owner',
-                                          'owner' => Horde_Auth::getAuth(),
-                                          'view' => 'List')))
+        return Ansel::getUrlFor('view',
+                                array('groupby' => 'owner',
+                                      'owner' => Horde_Auth::getAuth(),
+                                      'view' => 'List'))->link()
             . _("My Galleries") . '</a>';
     }
 
@@ -77,7 +77,8 @@ HEADER;
                                                   'gallery' => $gallery->id),
                                     true);
             $html .= '<tr><td>'
-                . Horde::link($url, '', '', '', '', '', '', array('onmouseout' => '$("ansel_preview").hide();$("ansel_preview").update("");', 'onmouseover' => 'previewImageMg(event, ' . $gallery->getDefaultImage('ansel_default') . ');'))
+                . $url->link(array('onmouseout' => '$("ansel_preview").hide();$("ansel_preview").update("");',
+                                   'onmouseover' => 'previewImageMg(event, ' . $gallery->getDefaultImage('ansel_default') . ');'))
                 . @htmlspecialchars($gallery->get('name'), ENT_COMPAT, Horde_Nls::getCharset()) . '</a></td><td>'
                 . strftime($GLOBALS['prefs']->getValue('date_format'), $gallery->get('last_modified'))
                 . '</td><td>' . (int)$gallery->countImages(true) . '</td></tr>';
index 3ab6d54..d17f53f 100644 (file)
@@ -47,7 +47,7 @@ class Horde_Block_ansel_random_photo extends Horde_Block {
         } else {
             $img = Horde::img('thumb-error.png');
         }
-        return Horde::link($viewurl, _("View Photo")) . $img . '</a>';
+        return $viewurl->link(array('title' => _("View Photo"))) . $img . '</a>';
     }
 
 }
index 78d528a..532b5b2 100644 (file)
@@ -63,7 +63,7 @@ class Horde_Block_ansel_recent_comments extends Horde_Block {
             $name = _("All Galleries");
         }
 
-        return sprintf(_("Recent Comments In %s"), Horde::link($viewurl) . $name . '</a>');
+        return sprintf(_("Recent Comments In %s"), $viewurl->link() . $name . '</a>');
     }
 
     function _content()
@@ -116,7 +116,8 @@ class Horde_Block_ansel_recent_comments extends Horde_Block {
                 $html .= '<tr><td>'
                     . strftime('%x', $comment['message_timestamp'])
                     . '</td><td class="nowrap">'
-                    . Horde::link($url, '', '', '', '', '', '', array('onmouseout' => '$("ansel_preview").hide();$("ansel_preview").update("");', 'onmouseover' => 'previewImage(event, ' . $comment['image_id'] . ');'))
+                    . $url->link(array('onmouseout' => '$("ansel_preview").hide();$("ansel_preview").update("");',
+                                       'onmouseover' => 'previewImage(event, ' . $comment['image_id'] . ');'))
                     . ($image->caption == '' ? $image->filename : $caption)
                     . '</a></td><td class="nowrap">'
                     . $comment['message_subject'] . '</td><td class="nowrap">'
index f205b78..189b5ae 100644 (file)
@@ -48,9 +48,7 @@ class Horde_Block_ansel_recently_added extends Horde_Block {
             try {
                 $gallery = $this->_getGallery();
             } catch (Exception $e) {
-                return Horde::link(
-                    Ansel::getUrlFor('view', array('view' => 'List'), true))
-                    . _("Gallery") . '</a>';
+                return Ansel::getUrlFor('view', array('view' => 'List'), true)->link() . _("Gallery") . '</a>';
             }
 
             // Build the gallery name.
@@ -69,8 +67,7 @@ class Horde_Block_ansel_recently_added extends Horde_Block {
             $viewurl = Ansel::getUrlFor('view', array('view' => 'List'), true);
             $name = _("All Galleries");
         }
-        return sprintf(_("Recently Added Photos From %s"),
-                       Horde::link($viewurl) . $name . '</a>');
+        return sprintf(_("Recently Added Photos From %s"), $viewurl->link() . $name . '</a>');
     }
 
     function _content()
@@ -131,7 +128,7 @@ HEADER;
                               'gallery' => $gallery->id,
                               'view' => 'Gallery'),
                 true);
-            $galleryLink = Horde::link($galleryLink)
+            $galleryLink = $galleryLink->link()
                 . @htmlspecialchars($gallery->get('name'), ENT_COMPAT,
                                     Horde_Nls::getCharset())
                 . '</a>';
@@ -151,8 +148,7 @@ HEADER;
                       'gallery_view' => $style['gallery_view']));
             $html .= '<tr><td>' . strftime('%x', $image->uploaded)
                 . '</td><td class="nowrap">'
-                . Horde::link(
-                    $url, '', '', '', '', '', '',
+                . $url->link(
                     array('onmouseout' => '$("ansel_preview").hide();$("ansel_preview").update("");',
                           'onmouseover' => 'previewImage(event, ' . $image->id . ');'))
                 . @htmlspecialchars(
index d911b47..c7649f9 100644 (file)
@@ -55,8 +55,7 @@ class Horde_Block_ansel_recently_added_geodata extends Horde_Block {
             try {
                 $gallery = $this->_getGallery();
             } catch (Exception $e) {
-                return Horde::link(Ansel::getUrlFor('view', array('view' => 'List'), true))
-                    . _("Gallery") . '</a>';
+                return Ansel::getUrlFor('view', array('view' => 'List'), true)->link() . _("Gallery") . '</a>';
             }
 
             // Build the gallery name.
@@ -74,8 +73,7 @@ class Horde_Block_ansel_recently_added_geodata extends Horde_Block {
             $viewurl = Ansel::getUrlFor('view', array('view' => 'List'), true);
             $name = _("All Galleries");
         }
-        return sprintf(_("Recently Geotagged Photos From %s"),
-                       Horde::link($viewurl) . $name . '</a>');
+        return sprintf(_("Recently Geotagged Photos From %s"), $viewurl->link() . $name . '</a>');
     }
 
     function _content()
index 1185b2e..42c17ef 100644 (file)
@@ -103,10 +103,7 @@ class Ansel_Faces
         if (!is_array($face)) {
             $face = $faces->getFaceById($face, true);
         }
-
-        $face_id = $face['face_id'];
-        $claim_url = Horde::applicationUrl('faces/claim.php');
-       
+        $face_id = $face['face_id'];      
 
         // The HTML to display the face image.
         $imghtml = sprintf("<img src=\"%s\" class=\"bordered-facethumb\" id=\"%s\" alt=\"%s\" />",
@@ -121,21 +118,19 @@ class Ansel_Faces
                   'havesearch' => false));
 
         // Build the actual html
-        $html = '<div id="face' . $face_id . '"><table><tr><td>'
-                . ' <a href="' . $img_view_url . '">' . $imghtml . '</a></td><td>';
+        $html = '<div id="face' . $face_id . '"><table><tr><td>' . $img_view_url->link() . $imghtml . '</a></td><td>';
         if (!empty($face['face_name'])) {
             $html .= Horde::applicationUrl('faces/face.php')->add('face', $face['face_id'])->link() . $face['face_name'] . '</a><br />';
         }
 
         // Display the face name or a link to claim the face.
         if (empty($face['face_name']) && $GLOBALS['conf']['report_content']['driver']) {
-            $html .= ' <a href="' . $claim_url->add('face', $face_id)->link(array('title' => _("Do you know someone in this photo?"))) . _("Claim") . '</a>';
+            $html .= Horde::applicationUrl('faces/claim.php')->add('face', $face_id)->link(array('title' => _("Do you know someone in this photo?"))) . _("Claim") . '</a>';
         }
 
         // Link for searching for similar faces.
         if (Horde_Util::loadExtension('libpuzzle') !== false) {
-            $search_url = Horde::applicationUrl('faces/search/image_search.php');
-            $html .= $search_url->add('face_id', $face_id)->link() . _("Find similar") . '</a>';
+            $html .= Horde::applicationUrl('faces/search/image_search.php')->add('face_id', $face_id)->link() . _("Find similar") . '</a>';
         }
         $html .= '</div></td></tr></table>';
 
index 258ff24..e2b2857 100644 (file)
@@ -7,7 +7,9 @@
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  * @author  Duck <duck@obala.net>
- * @package Ansel
+ * @category Horde
+ * @license  http://www.fsf.org/copyleft/gpl.html GPL
+ * @package  Ansel
  */
 class Ansel_Faces_Base
 {
@@ -419,8 +421,7 @@ class Ansel_Faces_Base
 
         // If not viewing directly out of the VFS, hand off to img.php
         if ($conf['vfs']['src'] != 'direct') {
-            return Horde::applicationUrl(
-                Horde_Util::addParameter('faces/img.php', 'face', $face_id), $full);
+            return Horde::applicationUrl('faces/img.php', $full)->add('face', $face_id);
         } else {
             $path = substr(str_pad($image_id, 2, 0, STR_PAD_LEFT), -2) . '/faces';
             return $GLOBALS['conf']['vfs']['path'] . htmlspecialchars($path . '/' . $face_id . Ansel_Faces::getExtension());
index 64c28a1..b2f9507 100644 (file)
@@ -13,7 +13,9 @@
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  *
  * @author  Michael J. Rubinsky <mrubinsk@horde.org>
- * @package Ansel
+ * @category Horde
+ * @license  http://www.fsf.org/copyleft/gpl.html GPL
+ * @package  Ansel
  */
 
 /**
@@ -457,8 +459,6 @@ class Ansel_Tags
  * Class that represents a slice of a tag search
  *
  * @TODO: Move this to Ansel_Search_Tags
- *
- *
  */
 class Ansel_Tags_Search {
 
@@ -593,16 +593,15 @@ class Ansel_Tags_Search {
         /* Use the local cache to preserve the order */
         $count = 0;
         foreach ($this->_tags as $tagid) {
-            $remove_url = Horde_Util::addParameter('view.php', array('view' => 'Results',
-                                                               'tag' => $tags[$tagid],
-                                                               'actionID' => 'remove'));
-
+            $remove_url = Horde::applicationUrl('view.php', true)->add(
+                    array('view' => 'Results',
+                          'tag' => $tags[$tagid],
+                          'actionID' => 'remove'));
             if (!empty($this->_owner)) {
-                $remove_url = Horde_Util::addParameter($remove_url, 'owner', $this->_owner);
+                $remove_url->add('owner', $this->_owner);
             }
-            $remove_url = Horde::applicationUrl($remove_url, true);
             $delete_label = sprintf(_("Remove %s from search"), htmlspecialchars($tags[$tagid]));
-            $html .= '<li>' . htmlspecialchars($tags[$tagid]) . Horde::link($remove_url, $delete_label) . Horde::img('delete-small.png', $delete_label) . '</a></li>';
+            $html .= '<li>' . htmlspecialchars($tags[$tagid]) . $remove_url->link(array('title' => $delete_label)) . Horde::img('delete-small.png', $delete_label) . '</a></li>';
         }
 
         return $html . '</ul>';
index 16baccc..cedc2e9 100644 (file)
@@ -4,10 +4,12 @@
  * DateGallery psuedo gallery.
  *
  * @author Michael Rubinsky <mrubinsk@horde.org>
- * @package Ansel
+ * @category Horde
+ * @license  http://www.fsf.org/copyleft/gpl.html GPL
+ * @package  Ansel
  */
-class Ansel_Tile_DateGallery {
-
+class Ansel_Tile_DateGallery
+{
     /**
      * Outputs the html for a DateGallery tile.
      *
@@ -25,8 +27,7 @@ class Ansel_Tile_DateGallery {
      *
      * @return  Outputs the HTML for the tile.
      */
-    function getTile($dgallery, $style = null, $mini = false,
-                     $params = array())
+    public function getTile($dgallery, $style = null, $mini = false, $params = array())
     {
         /* User's preferred date format */
         $date_format = $GLOBALS['prefs']->getValue('date_format');
@@ -94,15 +95,12 @@ class Ansel_Tile_DateGallery {
                             'view' => 'Gallery',
                             'slug' => $dgallery->get('slug'));
             $params = array_merge($params, $next_date);
-            $view_link = Ansel::getUrlFor('view', $params);
-            $view_link = Horde::link($view_link);
+            $view_link = Ansel::getUrlFor('view', $params)->link();
         } else {
-            $url = str_replace(array('%g', '%s'),
-                array($dgallery->id, $dgallery->get('slug')),
-                urldecode($params['gallery_view_url']));
-
-            $url = Horde_Util::addParameter($url, $next_date);
-            $view_link = Horde::link($url);
+            $view_link = new Horde_Url(str_replace(array('%g', '%s'),
+                                             array($dgallery->id, $dgallery->get('slug')),
+                                             urldecode($params['gallery_view_url'])));
+            $view_link->add($next_date)->link();
         }
 
         /* Variables used in the template file */
index e32e653..656cc97 100644 (file)
@@ -4,10 +4,12 @@
  * for a gallery on the Ansel_View_Gallery view.
  *
  * @author Michael Rubinsky <mrubinsk@horde.org>
- * @package Ansel
+ * @category Horde
+ * @license  http://www.fsf.org/copyleft/gpl.html GPL
+ * @package  Ansel
  */
-class Ansel_Tile_Gallery {
-
+class Ansel_Tile_Gallery
+{
     /**
      * Outputs the html for a gallery tile.
      *
@@ -23,8 +25,7 @@ class Ansel_Tile_Gallery {
      *
      * @return  Outputs the HTML for the tile.
      */
-    function getTile($gallery, $style = null, $mini = false,
-                     $params = array())
+    public function getTile($gallery, $style = null, $mini = false, $params = array())
     {
         /*
          * See what view we are being displayed in to see if we need to show
@@ -70,14 +71,13 @@ class Ansel_Tile_Gallery {
                                           array('gallery' => $gallery->id,
                                                 'view' => 'Gallery',
                                                 'havesearch' => $haveSearch,
-                                                'slug' => $gallery->get('slug')));
-
-            $view_link = Horde::link($view_link);
+                                                'slug' => $gallery->get('slug')))->link();
         } else {
-            $view_link = Horde::link(
+            $view_link = new Horde_Url(
                 str_replace(array('%g', '%s'),
                             array($gallery->id, $gallery->get('slug')),
                             urldecode($params['gallery_view_url'])));
+            $view_link = $view_link->link();
         }
 
         $image_link = $view_link . $gallery_image . '</a>';
@@ -85,14 +85,12 @@ class Ansel_Tile_Gallery {
                      . '</a>';
 
         if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT) && !$mini) {
-            $properties_link = Horde_Util::addParameter(
-                    Horde::applicationUrl('gallery.php', true),
+            $properties_link = Horde::applicationUrl('gallery.php', true)->add(
                         array('gallery' => $gallery->id,
                               'actionID' => 'modify',
                               'havesearch' => $haveSearch,
                               'url' => Horde::selfUrl(true, false, true)));
-            $properties_link = Horde::link($properties_link)
-                               . _("Gallery Properties") . '</a>';
+            $properties_link = $properties_link->link() . _("Gallery Properties") . '</a>';
         }
 
         if ($showOwner && !$mini &&
@@ -101,14 +99,13 @@ class Ansel_Tile_Gallery {
                                             array('view' => 'List',
                                                   'owner' => $gallery->get('owner'),
                                                   'groupby' => 'owner'),
-                                            true);
-            $owner_link = Horde::link($owner_link);
+                                            true)->link();
             $gallery_owner = $gallery->getOwner();
             $owner_string = $gallery_owner->getValue('fullname');
             if (empty($owner_string)) {
                 $owner_string = $gallery->get('owner');
             }
-            $owner_link = $owner_link . htmlspecialchars($owner_string, ENT_COMPAT, Horde_Nls::getCharset()) . '</a>';
+            $owner_link .= htmlspecialchars($owner_string, ENT_COMPAT, Horde_Nls::getCharset()) . '</a>';
         }
 
         $gallery_count = $gallery->countImages(true);
@@ -122,6 +119,7 @@ class Ansel_Tile_Gallery {
 
         Horde::startBuffer();
         include ANSEL_TEMPLATES . '/tile/gallery' . ($mini ? 'mini' : '') . '.inc';
+
         return Horde::endBuffer();
     }
 
index 2abe5ea..4619671 100644 (file)
@@ -4,10 +4,12 @@
  * for a image on the Ansel_View_Gallery view.
  *
  * @author Michael Rubinsky <mrubinsk@horde.org>
- * @package Ansel
+ * @category Horde
+ * @license  http://www.fsf.org/copyleft/gpl.html GPL
+ * @package  Ansel
  */
-class Ansel_Tile_Image {
-
+class Ansel_Tile_Image
+{
     /**
      * Outputs the HTML for an image thumbnail 'tile'.
      *
@@ -21,8 +23,7 @@ class Ansel_Tile_Image {
      *
      * @return  Outputs the HTML for the image tile.
      */
-    function getTile($image, $style = null, $mini = false,
-                     $params = array())
+    public function getTile($image, $style = null, $mini = false, $params = array())
     {
         global $conf, $registry;
 
@@ -45,12 +46,13 @@ class Ansel_Tile_Image {
         $thumbstyle = $mini ? 'mini' : $style['thumbstyle'];
 
         /* URL for image properties/actions etc... */
-        $image_url = Horde_Util::addParameter('image.php', array_merge(
-             array('gallery' => $image->gallery,
-                   'page' => $page,
-                   'image' => $image->id,
-                   'havesearch' => $haveSearch),
-             $date));
+        $image_url = Horde::applicationUrl('image.php')->add(
+             array_merge(
+               array('gallery' => $image->gallery,
+                     'page' => $page,
+                     'image' => $image->id,
+                     'havesearch' => $haveSearch),
+               $date));
 
         /* URL to view the image. This is the link for the Tile.
          * $view_url is the link for the thumbnail and since this might not
@@ -75,8 +77,7 @@ class Ansel_Tile_Image {
                                     array($image->id, $image->gallery, $parent->get('slug')),
                                     urldecode($params['image_view_url']));
 
-            // If we override the view_url, assume we want to override this
-            // as well.
+            // If we override the view_url, assume we want to override this also
             $img_view_url = $view_url;
         }
 
@@ -94,11 +95,11 @@ class Ansel_Tile_Image {
         $thumb_url = Ansel::getImageUrl($image->id, $thumbstyle, true, $style['name']);
         $option_select = $parent->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE);
         $option_edit = $parent->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT);
-        $imgAttributes = (!empty($params['image_view_attributes'])
-                         ? $params['image_view_attributes'] : array());
+        $imgAttributes = (!empty($params['image_view_attributes']) ? $params['image_view_attributes'] : array());
 
         $imgOnClick = (!empty($params['image_onclick'])
-                      ? str_replace('%i', $image->id, $params['image_onclick']) : '');
+                ? str_replace('%i', $image->id, $params['image_onclick'])
+                : '');
 
         $imageCaption = Horde_Text_Filter::filter(
             $image->caption, 'text2html',
@@ -119,8 +120,8 @@ class Ansel_Tile_Image {
                                                      'domid' => $image->id . 'caption'));
             $imple->attach();
         }
-        
         include ANSEL_BASE . '/templates/tile/image.inc';
+
         return Horde::endBuffer();
     }
 
index 356e2ff..0dd53d2 100644 (file)
@@ -55,7 +55,7 @@ class Ansel_View_Gallery extends Ansel_View_Base
                                    true);
 
             $params = array('gallery' => $this->gallery->id, 'url' => $galleryurl);
-            header('Location: ' . Horde_Util::addParameter(Horde::applicationUrl('disclamer.php'), $params, null, false));
+            header('Location: ' . Horde::applicationUrl('disclamer.php')->add($params)->setRaw(true));
             exit;
         }
 
@@ -77,7 +77,7 @@ class Ansel_View_Gallery extends Ansel_View_Base
                                    true);
 
             $params = array('gallery' => $this->gallery->id, 'url' => $galleryurl);
-            header('Location: ' . Horde_Util::addParameter(Horde::applicationUrl('protect.php'), $params, null, false));
+            header('Location: ' . Horde::applicationUrl('protect.php')->add($params)->setRaw(true));
             exit;
         }
 
index feb47d5..b699e03 100644 (file)
@@ -61,8 +61,8 @@ class Ansel_View_GalleryRenderer_Gallery extends Ansel_View_GalleryRenderer_Base
             $vars->add('page', $this->view->page);
         }
         if (!empty($this->view->gallery_view_url)) {
-            $pagerurl = str_replace(array('%g', '%s'), array($this->galleryId, $this->gallerySlug), urldecode($this->view->gallery_view_url));
-            $pagerurl = Horde_Util::addParameter($pagerurl, $date_params);
+            $pagerurl = new Horde_Url(str_replace(array('%g', '%s'), array($this->galleryId, $this->gallerySlug), urldecode($this->view->gallery_view_url)));
+            $pagerurl->add($date_params);
         } else {
             /*
              * Build the pager url. Add the needed variables directly to the
index 9851ad7..92d45a9 100644 (file)
@@ -88,8 +88,8 @@ class Ansel_View_GalleryRenderer_GalleryLightbox extends Ansel_View_GalleryRende
             $page = 0;
         }
         if (!empty($this->view->gallery_view_url)) {
-            $pagerurl = str_replace(array('%g', '%s'), array($this->galleryId, $this->gallerySlug), urldecode($this->view->gallery_view_url));
-            $pagerurl = Horde_Util::addParameter($pagerurl, $date_params, null, false);
+            $pagerurl = new Horde_Url(str_replace(array('%g', '%s'), array($this->galleryId, $this->gallerySlug), urldecode($this->view->gallery_view_url)));
+            $pagerurl->add($date_params)->setRaw(true);
         } else {
             /*
              * Build the pager url. Add the needed variables directly to the
index dc509d0..d9416d1 100644 (file)
@@ -61,7 +61,7 @@ class Ansel_View_Image extends Ansel_View_Base
 
             $params = array('gallery' => $this->gallery->id, 'url' => $url);
 
-            header('Location: ' . Horde_Util::addParameter(Horde::applicationUrl('disclamer.php'), $params, null, false));
+            header('Location: ' . Horde::applicationUrl('disclamer.php')->add($params)->setRaw(true));
             exit;
         }
 
@@ -86,7 +86,7 @@ class Ansel_View_Image extends Ansel_View_Base
 
             $params = array('gallery' => $this->gallery->id, 'url' => $url);
 
-            header('Location: ' . Horde_Util::addParameter(Horde::applicationUrl('protect.php'), $params, null, false));
+            header('Location: ' . Horde::applicationUrl('protect.php')->add($params)->setRaw(true));
             exit;
         }
 
@@ -156,24 +156,21 @@ class Ansel_View_Image extends Ansel_View_Base
 
         /* Not needed when being called via api */
         if (empty($this->_params['api'])) {
-            $this->_urls['ecard'] = Horde::applicationUrl(
-                Horde_Util::addParameter('img/ecard.php', array_merge(
-                                   array('gallery' => $this->gallery->id,
-                                         'image' => $this->resource->id),
-                                   $this->_date)),
-                true);
+            $this->_urls['ecard'] = Horde::applicationUrl('img/ecard.php')->add(
+                array_merge(array('gallery' => $this->gallery->id,
+                                  'image' => $this->resource->id),
+                            $this->_date));
 
             /* Build the various urls */
-            $imageActionUrl = Horde_Util::addParameter(
-                'image.php', array_merge(
-                array('gallery' => $this->gallery->id,
-                      'image' => $this->resource->id,
-                      'page' => $this->_page),
-                $this->_date));
+            $imageActionUrl = Horde::applicationUrl('image.php')->add(
+                array_merge(array('gallery' => $this->gallery->id,
+                                  'image' => $this->resource->id,
+                                  'page' => $this->_page),
+                            $this->_date));
 
             /* Create the popup code seperately to avoid encoding issues */
             $this->_urls['prop_popup'] = Horde::popupJs(
-              Horde::applicationUrl($imageActionUrl),
+              $imageActionUrl,
               array('params' => array('actionID' => 'modify',
                                       'ret' => 'image',
                                       'gallery' => $this->gallery->id,
@@ -181,20 +178,18 @@ class Ansel_View_Image extends Ansel_View_Base
                                       'page' => $this->_page),
                     'urlencode' => true));
 
-            $this->_urls['edit'] = Horde::applicationUrl(Horde_Util::addParameter($imageActionUrl, 'actionID', 'editimage'));
-            $this->_urls['delete'] = Horde::applicationUrl(Horde_Util::addParameter($imageActionUrl, 'actionID', 'delete'));
-            $this->_urls['download'] = Horde::applicationUrl(Horde_Util::addParameter('img/download.php', 'image', $this->resource->id), true);
-            $this->_urls['report'] = Horde_Util::addParameter( Horde::applicationUrl('report.php'),
-                                                               array('gallery' =>  $this->gallery->id,
-                                                                     'image' => $this->resource->id));
+            $this->_urls['edit'] = $imageActionUrl->copy()->add('actionID', 'editimage');
+            $this->_urls['delete'] = $imageActionUrl->copy()->add('actionID', 'delete');
+            $this->_urls['download'] = Horde::applicationUrl('img/download.php', true)->add('image', $this->resource->id);
+            $this->_urls['report'] = Horde::applicationUrl('report.php')->add(
+                    array('gallery' =>  $this->gallery->id,
+                          'image' => $this->resource->id));
         }
 
         /* Check for an explicit gallery view url to use */
         if (!empty($this->_params['gallery_view_url'])) {
-            $this->_urls['gallery'] = Horde_Util::addParameter(
-                str_replace(array('%g', '%s'),
-                            array($this->gallery->id, $this->_slug),
-                            urldecode($this->_params['gallery_view_url'])), $this->_date);
+            $this->_urls['gallery'] = new Horde_Url(str_replace(array('%g', '%s'), array($this->gallery->id, $this->_slug), urldecode($this->_params['gallery_view_url'])));
+            $this->_urls['gallery']->add($this->_date);
         } else {
             $this->_urls['gallery'] = Ansel::getUrlFor('view', array_merge(
                                            array('gallery' => $this->gallery->id,
@@ -319,12 +314,11 @@ class Ansel_View_Image extends Ansel_View_Base
                                          array($this->resource->id, $this->gallery->id),
                                          urldecode($this->_params['slideshow_link']));
         } else {
-            $this->_urls['slideshow'] = Horde::applicationUrl(
-                Horde_Util::addParameter('view.php', array_merge(
-                                   array('gallery' => $this->gallery->id,
-                                         'image' => $this->resource->id,
-                                         'view' => 'Slideshow'),
-                                   $this->_date)));
+            $this->_urls['slideshow'] = Horde::applicationUrl('view.php')->add(
+                array_merge(array('gallery' => $this->gallery->id,
+                                  'image' => $this->resource->id,
+                                  'view' => 'Slideshow'),
+                            $this->_date));
         }
 
         $commentHtml = '';
index 56d6ff9..4115637 100644 (file)
@@ -126,7 +126,7 @@ class Ansel_View_List extends Ansel_View_Base
                 if ($this->_owner && $filter == $this->_owner && $this->_owner == Horde_Auth::getAuth()) {
                     $notification->push(_("You have no photo galleries, add one!"),
                                         'horde.message');
-                    header('Location: ' . Horde_Util::addParameter(Horde::applicationUrl('gallery.php'), 'actionID', 'add'));
+                    header('Location: ' .Horde::applicationUrl('gallery.php')->add('actionID', 'add'));
                     exit;
                 }
                 $notification->push(_("There are no photo galleries available."), 'horde.message');
index 13426ed..29f3009 100644 (file)
@@ -230,22 +230,16 @@ class Ansel_View_Results extends Ansel_View_Base
             $links = Ansel_Tags::getTagLinks($rtags, 'add');
             foreach ($rtags as $id => $taginfo) {
                 if (!empty($this->_owner)) {
-                    $links[$id] = Horde_Util::addParameter($links[$id], 'owner',
-                                                     $this->_owner);
+                    $links[$id]->add('owner', $this->_owner);
                 }
-                $rtaghtml .= '<li>' . Horde::link($links[$id],
-                                                  sprintf(ngettext(
-                                                    "%d photo", "%d photos",
-                                                    $taginfo['total']),
-                                                  $taginfo['total']))
-                             . $taginfo['tag_name'] . '</a></li>';
+                $rtaghtml .= '<li>' . $links[$id]->link(array('title' => sprintf(ngettext("%d photo", "%d photos",$taginfo['total']),$taginfo['total']))) . $taginfo['tag_name'] . '</a></li>';
             }
             $rtaghtml .= '</ul>';
         }
         $styleDef = Ansel::getStyleDefinition($GLOBALS['prefs']->getValue('default_gallerystyle'));
         $style = $styleDef['name'];
-        $viewurl = Horde_Util::addParameter('view.php', array('view' => 'Results',
-                                                        'actionID' => 'add'));
+        $viewurl = Horde::applicationUrl('view.php')->add(array('view' => 'Results',
+                                                                'actionID' => 'add'));
 
         $vars = Horde_Variables::getDefaultVariables();
         $option_move = $option_copy = $ansel_storage->countGalleries(Horde_Perms::EDIT);
index 7b98c4d..d3c19d5 100644 (file)
@@ -29,11 +29,10 @@ class Ansel_Widget_Actions extends Ansel_Widget_Base
     {
         $html = $this->_htmlBegin();
         $id = $this->_view->gallery->id;
-        $galleryurl = Horde_Util::addParameter(Horde::applicationUrl('gallery.php'), 'gallery', $id);
+        $galleryurl = Horde::applicationUrl('gallery.php')->add('gallery', $id);
 
         if ($this->_view->gallery->hasFeature('upload')) {
-            $uploadurl = Horde_Util::addParameter(
-                Horde::applicationUrl('img/upload.php'),
+            $uploadurl = Horde::applicationUrl('img/upload.php')->add(
                 array('gallery' => $id,
                       'page' => !empty($this->_view->_params['page']) ? $this->_view->_params['page'] : 0)
                 );
@@ -51,34 +50,29 @@ class Ansel_Widget_Actions extends Ansel_Widget_Base
             } else {
                 /* Get any date info the gallery has */
                 $date = $this->_view->gallery->getDate();
-                $slideshow_url = Horde::applicationUrl(
-                    Horde_Util::addParameter('view.php', array_merge(
-                                       array('gallery' => $id,
-                                             'image' => array_pop($this->_view->gallery->listImages(0, 1)),
-                                             'view' => 'Slideshow'),
-                                       $date)));
+                $slideshow_url = Horde::applicationUrl('view.php')->add(
+                    array_merge(array('gallery' => $id,
+                                      'image' => array_pop($this->_view->gallery->listImages(0, 1)),
+                                      'view' => 'Slideshow'),
+                                $date));
             }
-            $html .= '<li>' . Horde::link($slideshow_url, '', 'widget') . Horde::img('slideshow_play.png', _("Start Slideshow")) . ' ' . _("Start Slideshow") . '</a></li>';
+            $html .= '<li>' . $slideshow_url->link(array('class' => 'widget')) . Horde::img('slideshow_play.png', _("Start Slideshow")) . ' ' . _("Start Slideshow") . '</a></li>';
         }
         if (!empty($uploadurl) && $this->_view->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
-            $html .= '<li>' . Horde::link($uploadurl, '', 'widget') . Horde::img('image_add.png') . ' ' . _("Upload photos") . '</a></li>';
+            $html .= '<li>' . $uploadurl->link(array('class' => 'widget')) . Horde::img('image_add.png') . ' ' . _("Upload photos") . '</a></li>';
 
             /* Subgalleries */
             if ($this->_view->gallery->hasFeature('subgalleries')) {
-                $html .= '<li>' . Horde::link(Horde_Util::addParameter($galleryurl, 'actionID', 'addchild'), '', 'widget') . Horde::img('add.png', '[icon]') . ' ' . _("Create a subgallery") . '</a></li>';
+                $html .= '<li>' . $galleryurl->copy()->add('actionID', 'addchild')->link(array('class' => 'widget')) . Horde::img('add.png', '[icon]') . ' ' . _("Create a subgallery") . '</a></li>';
             }
         }
         $html .= '</ul>';
         $html .= $this->_getGalleryActions();
 
         $selfurl = Horde::selfUrl(true, true);
-        $html .=  '<div class="control"><a href="'
-                 . Horde_Util::addParameter($selfurl, 'actionID',
-                                     'show_actions')
-                 . '" id="gallery-actions-toggle" class="'
-                 . (($GLOBALS['prefs']->getValue('show_actions'))
-                 ? 'hide'
-                 : 'show') . '">&nbsp;</a></div>' . "\n";
+        $html .=  '<div class="control">'
+                 . $selfurl->add('actionID', 'show_actions')->link(array('id' => 'gallery-actions-toggle', 'class' => ($GLOBALS['prefs']->getValue('show_actions') ? 'hide' : 'show')))
+                 . '&nbsp;</a></div>' . "\n";
 
         $html .= $this->_htmlEnd();
         return $html;
@@ -94,9 +88,7 @@ class Ansel_Widget_Actions extends Ansel_Widget_Base
         global $registry, $conf;
 
         $id = $this->_view->gallery->id;
-        $galleryurl = Horde_Util::addParameter(Horde::applicationUrl('gallery.php'),
-                                               'gallery', $id);
-
+        $galleryurl = Horde::applicationUrl('gallery.php')->add('gallery', $id);
         $selfurl = Horde::selfUrl(true, false, true);
         $count = $this->_view->gallery->countImages();
         $date = $this->_view->gallery->getDate();
@@ -130,8 +122,7 @@ class Ansel_Widget_Actions extends Ansel_Widget_Base
             try {
                 $url = $registry->bookmarks->getAddUrl($api_params);
             } catch (Horde_Exception $e) {}
-
-            $html .= '<li>' . Horde::link($url, '', 'widget') . Horde::img(Horde_Themes::img('trean.png', 'trean')) . ' ' . _("Add to bookmarks") . '</a></li>';
+            $html .= '<li>' . $url->link(array('class' => 'widget')) . Horde::img(Horde_Themes::img('trean.png', 'trean')) . ' ' . _("Add to bookmarks") . '</a></li>';
         }
 
         /* Download as ZIP link */
@@ -141,41 +132,44 @@ class Ansel_Widget_Actions extends Ansel_Widget_Base
             $this->_view->gallery->hasFeature('zipdownload')) {
 
             $zip_params = array_merge(array('actionID' => 'downloadzip'), $date);
-            $html .= '<li>' . Horde::link(Horde::applicationUrl(Horde_Util::addParameter($galleryurl, $zip_params)), '', 'widget') . Horde::img('mime/compressed.png') . ' ' .  _("Download as zip file") . '</a></li>';
+            $html .= '<li>' . $galleryurl->copy()->add($zip_params)->link(array('class' => 'widget')) . Horde::img('mime/compressed.png') . ' ' .  _("Download as zip file") . '</a></li>';
         }
 
         /* Image upload, subgalleries, captions etc... */
         if ($this->_view->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
             /* Properties */
-            $html .= '<li>' . Horde::link(Horde_Util::addParameter($galleryurl, array('actionID' => 'modify', 'url' => $selfurl)), '', 'widget') . Horde::img('edit.png') . ' ' . _("Change properties") . '</a></li>';
+            $html .= '<li>' . $galleryurl->copy()->add(array('actionID' => 'modify', 'url' => $selfurl))->link(array('class' => 'widget')) . Horde::img('edit.png') . ' ' . _("Change properties") . '</a></li>';
             if ($count) {
                 /* Captions */
                 if ($this->_view->gallery->hasFeature('image_captions')) {
                     $params = array_merge(array('gallery' => $id), $date);
-                    $html .= '<li>' . Horde::link(Horde::applicationUrl(Horde_Util::addParameter('gallery/captions.php', $params)), '', 'widget') . Horde::img('text.png') . ' ' . _("Set captions") . ' ' . '</a></li>';
+                    $html .= '<li>' . Horde::applicationUrl('gallery/captions.php')->add($params)->link(array('class' => 'widget')) . Horde::img('text.png') . ' ' . _("Set captions") . ' ' . '</a></li>';
                 }
 
                 /* Sort */
                 if ($this->_view->gallery->hasFeature('sort_images')) {
-                    $sorturl = Horde_Util::addParameter(Horde::applicationUrl('gallery/sort.php'), array_merge(array('gallery' => $id), $date));
-                    $html .= '<li>' . Horde::link(Horde_Util::addParameter($sorturl, 'actionId' , 'getOrder'), '', 'widget') . Horde::img('arrow_switch.png') . ' ' . _("Sort photos") . '</a></li>';
+                    $sorturl = Horde::applicationUrl('gallery/sort.php')->add(array_merge(array('gallery' => $id), $date));
+                    $html .= '<li>' . $sorturl->copy()->add('actionId' , 'getOrder')->link(array('class' => 'widget')) . Horde::img('arrow_switch.png') . ' ' . _("Sort photos") . '</a></li>';
                 }
 
                 /* Regenerate Thumbnails */
-                $html .= '<li>' . Horde::link(Horde_Util::addParameter($galleryurl, array('actionID' => 'generateThumbs')), '', 'widget') . Horde::img('reload.png') . ' ' . _("Reset all thumbnails") . '</a></li>';
+                $html .= '<li>' . $galleryurl->copy()->add(array('actionID' => 'generateThumbs'))->link(array('class' => 'widget')) . Horde::img('reload.png') . ' ' . _("Reset all thumbnails") . '</a></li>';
 
                 /* Regenerate all views  */
-                $html .= '<li>' . Horde::link(Horde_Util::addParameter($galleryurl, array('actionID' => 'deleteCache')), '', 'widget') . Horde::img('reload.png') . ' ' . _("Regenerate all photo views") . '</a></li>';
+                $html .= '<li>' . $galleryurl->copy()->add(array('actionID' => 'deleteCache'))->link(array('class' => 'widget')) . Horde::img('reload.png') . ' ' . _("Regenerate all photo views") . '</a></li>';
 
                 /* Find faces */
                 if ($conf['faces']['driver'] && $this->_view->gallery->hasFeature('faces')) {
-                    $html .= '<li>' . Horde::link(Horde::applicationUrl(Horde_Util::addParameter('faces/gallery.php', array_merge($date, array('gallery' => $id, 'page' => (!empty($this->_view->_params['page']) ? $this->_view->_params['page'] : 0))))), '', 'widget') . Horde::img('user.png') . ' ' . _("Find faces") . '</a></li>';
+                    $html .= '<li>' . Horde::applicationUrl('faces/gallery.php')->add(
+                        array_merge($date,
+                                    array('gallery' => $id, 'page' => (!empty($this->_view->_params['page']) ? $this->_view->_params['page'] : 0))))
+                        ->link(array('class' => 'widget')) . Horde::img('user.png') . ' ' . _("Find faces") . '</a></li>';
                 }
 
             } /* end if ($count) {} */
 
             if (Ansel::isAvailable('photo_stack') && $this->_view->gallery->hasFeature('stacks')) {
-                $html .= '<li>' . Horde::link(Horde_Util::addParameter($galleryurl, array('actionID' => 'generateDefault', 'url' => $selfurl)), '', 'widget') . Horde::img('reload.png') . ' ' . _("Reset default photo") . '</a></li>';
+                $html .= '<li>' . $galleryurl->copy()->add(array('actionID' => 'generateDefault', 'url' => $selfurl))->link(array('class' => 'widget')) . Horde::img('reload.png') . ' ' . _("Reset default photo") . '</a></li>';
             }
         }
 
@@ -187,14 +181,13 @@ class Ansel_Widget_Actions extends Ansel_Widget_Base
             $registry->isAuthenticated()) ||
                    $conf['report_content']['allow'] == 'all')) {
 
-            $reporturl = Horde_Util::addParameter(Horde::applicationUrl('report.php'),
-                                                  'gallery', $id);
-            $html .= '<li>' . Horde::link($reporturl, '', 'widget') . ' ' . _("Report") . "</a></li>\n";
+            $reporturl = Horde::applicationUrl('report.php')->add('gallery', $id);
+            $html .= '<li>' . $reporturl->link(array('class' => 'widget')) . _("Report") . '</a></li>';
         }
 
         if ($this->_view->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
-            $html .= '<li>' . Horde::link(Horde_Util::addParameter($galleryurl, 'actionID', 'empty'), '', 'widget') . Horde::img('delete.png') . ' ' . _("Delete All Photos") . '</a></li>';
-            $html .= '<li>' . Horde::link(Horde_Util::addParameter($galleryurl, 'actionID', 'delete'), '', 'widget') . Horde::img('delete.png', 'horde') . ' ' . _("Delete Entire Gallery") . '</a></li>';
+            $html .= '<li>' . $galleryurl->copy()->add('actionID', 'empty')->link(array('class' => 'widget')) . Horde::img('delete.png') . ' ' . _("Delete All Photos") . '</a></li>';
+            $html .= '<li>' . $galleryurl->copy()->add('actionID', 'delete')->link(array('class' => 'widget')) . Horde::img('delete.png', 'horde') . ' ' . _("Delete Entire Gallery") . '</a></li>';
         }
         $html .= '</ul></div>';
 
index 3009799..7067c4b 100644 (file)
@@ -54,8 +54,7 @@ class Ansel_Widget_GalleryFaces extends Ansel_Widget_Base
     protected function _getFaceNames()
     {
         if ($this->_view->resource->get('faces')) {
-            return '<div id="faces_widget_content">'
-                    . '<br /><em>' . _("No faces found") . '</em></div>';
+            return '<div id="faces_widget_content"><br /><em>' . _("No faces found") . '</em></div>';
         }
 
         $faces = $GLOBALS['injector']->getInstance('Ansel_Faces');
@@ -66,12 +65,12 @@ class Ansel_Widget_GalleryFaces extends Ansel_Widget_Base
             . ';width:100%;max-height:300px;overflow:auto;" id="faces_widget_content" >';
 
         $images = $faces->getGalleryFaces($this->_view->resource->id);
-
-
         if ($this->_view->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
             $link_text = (empty($images) ? _("Find faces") : _("Edit faces"));
-            $html .= '<a id="edit_faces" href="' . Horde_Util::addParameter(Horde::applicationUrl('faces/gallery.php'), 'gallery', $this->_view->gallery->id)
-                    . '" class="widget">' . $link_text . '</a>';
+            $html .= Horde::applicationUrl('faces/gallery.php')->add('gallery', $this->_view->gallery->id)->link(
+                         array('id' => 'edit_faces',
+                               'class' => 'widget'))
+                  . $link_text . '</a>';
         }
 
         $faces_html = '<div id="faces-on-gallery">';
index e8d06ff..4b7af3e 100644 (file)
  */
 class Ansel_Widget_Geotag extends Ansel_Widget_Base
 {
+    /**
+     * List of views this widget supports
+     *
+     * @var array
+     */
     protected $_supported_views = array('Image', 'Gallery');
+
+    /**
+     * Default params
+     *
+     * @var array
+     */
     protected $_params = array('default_zoom' => 15,
                                'max_auto_zoom' => 15);
 
+    /**
+     * Const'r
+     *
+     * @param array $params
+     *
+     * @return Ansel_Widget_Geotag
+     */
     public function __construct($params)
     {
         parent::__construct($params);
         $this->_title = _("Location");
     }
 
-    public function attach($view)
+    /**
+     * Attach widget to supplied view.
+     *
+     * @param Ansel_View_Base $view
+     *
+     * @return boolean
+     */
+    public function attach(Ansel_View_Base $view)
     {
-         // Don't even try if we don't have an api key
+        // Don't even try if we don't have an api key
         if (empty($GLOBALS['conf']['api']['googlemaps'])) {
             return false;
         }
@@ -37,6 +62,12 @@ class Ansel_Widget_Geotag extends Ansel_Widget_Base
         return true;
     }
 
+    /**
+     * Build the HTML for the widget
+     *
+     * @TODO inject $ansel_storage
+     * @return string
+     */
     public function html()
     {
         global $ansel_storage;
@@ -71,9 +102,11 @@ class Ansel_Widget_Geotag extends Ansel_Widget_Base
         foreach ($geodata as $id => $data) {
             $geodata[$id]['icon'] = (string)Ansel::getImageUrl($geodata[$id]['image_id'], 'mini', true);
             $geodata[$id]['markerOnly'] = ($viewType == 'Image');
-            $geodata[$id]['link'] = (string)Ansel::getUrlFor('view', array('view' => 'Image',
-                                                                   'gallery' => $this->_view->gallery->id,
-                                                                   'image' => $geodata[$id]['image_id']), true);
+            $geodata[$id]['link'] = (string)Ansel::getUrlFor(
+                    'view',
+                     array('view' => 'Image',
+                           'gallery' => $this->_view->gallery->id,
+                           'image' => $geodata[$id]['image_id']), true);
         }
 
         // If this is an image view, get the other gallery images
@@ -83,9 +116,11 @@ class Ansel_Widget_Geotag extends Ansel_Widget_Base
             foreach ($others as $id => $data) {
                 if ($id != $image_id) {
                     $others[$id]['icon'] = (string)Ansel::getImageUrl($others[$id]['image_id'], 'mini', true);
-                    $others[$id]['link'] = (string)Ansel::getUrlFor('view', array('view' => 'Image',
-                                                                         'gallery' => $this->_view->gallery->id,
-                                                                         'image' => $others[$id]['image_id']), true);
+                    $others[$id]['link'] = (string)Ansel::getUrlFor(
+                            'view',
+                            array('view' => 'Image',
+                                  'gallery' => $this->_view->gallery->id,
+                                  'image' => $others[$id]['image_id']), true);
                 } else {
                     unset($others[$id]);
                 }
@@ -102,8 +137,8 @@ class Ansel_Widget_Geotag extends Ansel_Widget_Base
 
             } elseif ($permsEdit) {
                 // Image view, but no geotags, provide ability to add it.
-                $addurl = Horde_Util::addParameter(Horde::applicationUrl('map_edit.php'), 'image', $this->_params['images'][0]);
-                $addLink = Horde::link($addurl, '', '', '', Horde::popupJs(Horde::applicationUrl('map_edit.php'), array('params' => array('image' => $this->_params['images'][0]), 'urlencode' => true, 'width' => '750', 'height' => '600')) . 'return false;');
+                $addurl = Horde::applicationUrl('map_edit.php')->add('image', $this->_params['images'][0]);
+                $addLink = $addurl->link(array('onclick' => Horde::popupJs(Horde::applicationUrl('map_edit.php'), array('params' => array('image' => $this->_params['images'][0]), 'urlencode' => true, 'width' => '750', 'height' => '600')) . 'return false;'));
                 $imgs = $ansel_storage->getRecentImagesGeodata(Horde_Auth::getAuth());
                     if (count($imgs) > 0) {
                         $imgsrc = '<div class="ansel_location_sameas">';
@@ -113,8 +148,11 @@ class Ansel_Widget_Geotag extends Ansel_Widget_Base
                             } else {
                                 $title = $this->_point2Deg($data['image_latitude'], true) . ' ' . $this->_point2Deg($data['image_longitude']);
                             }
-                            $imgsrc .= Horde::link($addurl, $title, '', '', "Ansel.widgets.geotag.setLocation('" . $data['image_latitude'] . "', '" . $data['image_longitude'] . "');return false") . '<img src="' . Ansel::getImageUrl($id, 'mini', true) . '" alt="[image]" /></a>';
-                                                    }
+                            $imgsrc .= $addurl->link(
+                                        array('title' => $title,
+                                              'onclick' => "Ansel.widgets.geotag.setLocation('" . $data['image_latitude'] . "', '" . $data['image_longitude'] . "');return false"))
+                                    . '<img src="' . Ansel::getImageUrl($id, 'mini', true) . '" alt="[image]" /></a>';
+                        }
                         $imgsrc .= '</div>';
                         $content .= sprintf(_("No location data present. Place using %s map %s or click on image to place at the same location."), $addLink, '</a>') . $imgsrc;
                     } else {
@@ -131,7 +169,6 @@ class Ansel_Widget_Geotag extends Ansel_Widget_Base
             // Avoids undefined error when we build the js function below.
             $image_id = 0;
             $content .= '<div id="ansel_map"></div><div id="ansel_locationtext" style="min-height: 20px;"></div><div id="ansel_map_small"></div>';
-
         }
 
         $content .= '</div>';
@@ -210,7 +247,6 @@ class Ansel_Widget_Geotag extends Ansel_Widget_Base
             }
         };
 EOT;
-
         if (empty($noGeotag)) {
             $html .= "\n" . 'Event.observe(window, "load", function() {Ansel.widgets.geotag.doMap();});' . "\n";
         }
@@ -220,11 +256,23 @@ EOT;
         return $html;
     }
 
+    /**
+     *
+     * @return array
+     */
     protected function _getGalleryImagesWithGeodata()
     {
         return $GLOBALS['ansel_storage']->getImagesGeodata(array(), $this->_view->gallery->id);
     }
 
+    /**
+     * Helper function for converting from decimal points to degrees lat/lng
+     *
+     * @param float   $value  The value
+     * @param boolean $lat    Does this value represent a latitude?
+     *
+     * @return string  The textual representation in degrees.
+     */
     protected function _point2Deg($value, $lat = false)
     {
         $letter = $lat ? ($value > 0 ? "N" : "S") : ($value > 0 ? "E" : "W");
index fc04aa8..5991db4 100644 (file)
@@ -65,9 +65,13 @@ class Ansel_Widget_ImageFaces extends Ansel_Widget_Base
         // TODO: A way to 'close', or go back to, the normal widget view.
         if ($this->_view->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
             $link_text = (empty($images) ? _("Find faces") : _("Edit faces"));
-            $html .= '<a id="edit_faces" href="' . Horde_Util::addParameter(Horde::applicationUrl('faces/gallery.php'), 'gallery', $this->_view->gallery->id)
-                    . '" class="widget">' . $link_text . '</a> | '
-                    . Horde::link(Horde::applicationUrl(Horde_Util::addParameter('faces/custom.php', array('image' => $this->_view->resource->id, 'url' => $this->_params['selfUrl']))),'', 'widget')
+            $html .= Horde::applicationUrl('faces/gallery.php')->add('gallery', $this->_view->gallery->id)->link(
+                    array('id' => 'edit_faces',
+                          'class' => 'widget'))
+                  . $link_text . '</a> | '
+                  . Horde::applicationUrl('faces/custom.php')->add(
+                            array('image' => $this->_view->resource->id,
+                                  'url' => $this->_params['selfUrl']))->link(array('class' => 'widget'))
                     . _("Manual face selection") . '</a>';
 
             // Attach the ajax edit actions
index 0808599..ec64859 100644 (file)
@@ -22,9 +22,9 @@ class Ansel_Widget_Links extends Ansel_Widget_Base
         $feedurl = Horde::url('rss.php', true);
         $owner = $this->_view->gallery->get('owner');
         $html = $this->_htmlBegin();
-        $html .= Horde::link(Ansel::getUrlFor('rss_user', array('owner' => $owner))) . Horde::img('feed.png') . ' ' . ($owner ? sprintf(_("Recent photos by %s"), $owner) : _("Recent system photos")) . '</a>';
+        $html .= Ansel::getUrlFor('rss_user', array('owner' => $owner))->link() . Horde::img('feed.png') . ' ' . ($owner ? sprintf(_("Recent photos by %s"), $owner) : _("Recent system photos")) . '</a>';
         $slug = $this->_view->gallery->get('slug');
-        $html .= '<br />' . Horde::link(Ansel::getUrlFor('rss_gallery', array('gallery' => $this->_view->gallery->id, 'slug' => $slug))) . ' ' .  Horde::img('feed.png') . ' ' . sprintf(_("Recent photos in %s"), htmlspecialchars($this->_view->gallery->get('name'), ENT_COMPAT, Horde_Nls::getCharset())) . '</a>';
+        $html .= '<br />' . Ansel::getUrlFor('rss_gallery', array('gallery' => $this->_view->gallery->id, 'slug' => $slug))->link() . ' ' .  Horde::img('feed.png') . ' ' . sprintf(_("Recent photos in %s"), htmlspecialchars($this->_view->gallery->get('name'), ENT_COMPAT, Horde_Nls::getCharset())) . '</a>';
 
         /* Embed html */
         if (empty($this->_view->_params['image_id'])) {
index 088e8eb..a101ee1 100644 (file)
@@ -15,12 +15,11 @@ class Ansel_Widget_OtherGalleries extends Ansel_Widget_Base
      * Override the parent class' attach method and set the owner in the
      * title string.
      *
-     * @param Ansel_View $view  The view we are attaching to
+     * @param Ansel_View_Base $view  The view we are attaching to
      */
-    public function attach($view)
+    public function attach(Ansel_View_Base $view)
     {
         parent::attach($view);
-
         $owner = $this->_view->gallery->getOwner();
         $name = $owner->getValue('fullname');
         if (!$name) {
@@ -107,12 +106,10 @@ class Ansel_Widget_OtherGalleries extends Ansel_Widget_Base
         $html .= '</div>';
         $selfurl = Horde::selfUrl(true, true);
         $html .=  '<div class="control"><a href="'
-                 . Horde_Util::addParameter($selfurl, 'actionID',
-                                     'show_actions')
-                 . '" id="othergalleries-toggle" class="'
-                 . (($GLOBALS['prefs']->getValue('show_othergalleries'))
-                 ? 'hide'
-                 : 'show') . '">&nbsp;</a></div>' . "\n";
+              . $selfurl->add('actionID', 'show_actions')->link(
+                        array('id' => 'othergalleries-toggle',
+                              'class' => ($GLOBALS['prefs']->getValue('show_othergalleries') ? 'hide' : 'show')))
+              . '&nbsp;</a></div>';
 
         return $html;
     }
index 06727c3..bd1f6e7 100644 (file)
@@ -31,17 +31,16 @@ class Ansel_Widget_OwnerFaces extends Ansel_Widget_Base
             Horde::logMessage($e->getMessage, 'ERR');
             $this->_count = 0;
         }
-
-        $this->_title = '<a href="' . Horde_Util::addParameter(Horde::applicationUrl('faces/search/owner.php'), 'owner', $this->_owner) . '">'
-            . sprintf(_("People in galleries owned by %s (%d of %d)"),
-                      $this->_owner, min(12, $this->_count), number_format($this->_count))
-            . '</a>';
-        $html = $this->_htmlBegin();
-
         if (empty($this->_count)) {
             return null;
         }
 
+        $this->_title = Horde::applicationUrl('faces/search/owner.php')->add('owner', $this->_owner)->link()
+            . sprintf(_("People in galleries owned by %s (%d of %d)"), $this->_owner, min(12, $this->_count), number_format($this->_count))
+            . '</a>';
+
+        $html = $this->_htmlBegin();
+
         $results = $this->_faces->ownerFaces($this->_owner, 0, 12, true);
         $html .= '<div style="display: block'
             . ';background:' . $this->_style['background']
index 74175d3..b6b4a38 100755 (executable)
@@ -77,16 +77,14 @@ class Ansel_Widget_SimilarPhotos extends Ansel_Widget_Base
                         continue;
                     }
 
-                    $title = sprintf(_("%s from %s"), $rImg->filename, $rGal->get('name'));
-                    $html .= Horde::link(
-                        Ansel::getUrlFor('view',
-                                         array('image' => $imgId,
-                                               'view' => 'Image',
-                                               'gallery' => $rImg->gallery,
-                                               'slug' => $rGal->get('slug')),
-                                         true),
-                        $title)
-                    . '<img src="'. Ansel::getImageUrl($imgId, 'mini', true) . '" alt="' . htmlspecialchars($rImg->filename) . '" /></a>';
+                    $html .= Ansel::getUrlFor(
+                            'view',
+                             array('image' => $imgId,
+                                   'view' => 'Image',
+                                   'gallery' => $rImg->gallery,
+                                   'slug' => $rGal->get('slug')),
+                             true)->link(array('title' =>  sprintf(_("%s from %s"), $rImg->filename, $rGal->get('name'))))
+                        . '<img src="'. Ansel::getImageUrl($imgId, 'mini', true) . '" alt="' . htmlspecialchars($rImg->filename) . '" /></a>';
                     $i++;
                 }
             }
index 0fdb65a..d06e714 100644 (file)
@@ -43,9 +43,10 @@ class Ansel_Widget_Tags extends Ansel_Widget_Base
             $imple->attach();
             $html .= Horde::endBuffer();
 
-            $actionUrl = Horde_Util::addParameter('image.php',
-                                                  array('image' => $this->_view->resource->id,
-                                                        'gallery' => $this->_view->gallery->id));
+            $actionUrl = Horde::applicationUrl('image.php')->add(
+                array('image' => $this->_view->resource->id,
+                      'gallery' => $this->_view->gallery->id));
+
             $html .= '<form name="tagform" action="' . $actionUrl . '" onsubmit="return !addTag();" method="post">';
             $html .= '<input id="addtag" name="addtag" type="text" size="15" /> <input name="tagbutton" id="tagbutton" class="button" value="' . _("Add") . '" type="submit" />';
             $html .= '</form>';
@@ -81,7 +82,7 @@ class Ansel_Widget_Tags extends Ansel_Widget_Base
         $links = Ansel_Tags::getTagLinks($tags, 'add', $owner);
         $html = '<ul>';
         foreach ($tags as $tag_id => $taginfo) {
-            $html .= '<li>' . Horde::link($links[$tag_id], sprintf(ngettext("%d photo", "%d photos", $taginfo['total']), $taginfo['total'])) . htmlspecialchars($taginfo['tag_name']) . '</a>' . ($hasEdit ? '<a href="#" onclick="removeTag(' . $tag_id . ');">' . Horde::img('delete-small.png', _("Remove Tag")) . '</a>' : '') . '</li>';
+            $html .= '<li>' . $links[$tag_id]->link(array('title' => sprintf(ngettext("%d photo", "%d photos", $taginfo['total']), $taginfo['total']))) . htmlspecialchars($taginfo['tag_name']) . '</a>' . ($hasEdit ? '<a href="#" onclick="removeTag(' . $tag_id . ');">' . Horde::img('delete-small.png', _("Remove Tag")) . '</a>' : '') . '</li>';
         }
         $html .= '</ul>';
 
index 56485c6..8509b57 100644 (file)
@@ -32,7 +32,7 @@ if ($form->validate()) {
         $_SESSION['ansel']['passwd'][$gallery->id] = md5($vars->get('passwd'));
         $url = $vars->get('url');
         if (empty($url)) {
-            $url = Horde::applicationUrl(Horde_Util::addParameter('view.php', 'gallery', $gallery->id));
+            $url = Horde::applicationUrl('view.php')->add('gallery', $gallery->id);
         }
         header('Location: ' . $url);
         exit;
index c087895..c6966e6 100644 (file)
@@ -281,8 +281,8 @@ if (empty($rss)) {
     } else {
         $getparams = array();
     }
-    $stream_rss = Horde_Util::addParameter(Horde::applicationUrl('rss.php', true, -1), $getparams);
-    $stream_rss2 = Horde_Util::addParameter(Horde::applicationUrl('rss.php', true, -1), $getparams);
+    $stream_rss = Horde::applicationUrl('rss.php', true, -1)->add($getparams);
+    $stream_rss2 = Horde::applicationUrl('rss.php', true, -1)->add($getparams);
     $images = $imgs;
 
     Horde::startBuffer();
index 787067c..aba22c5 100755 (executable)
@@ -6,7 +6,9 @@
    <img src="<?php echo $faces->getFaceUrl($face['image_id'], $face_id) ?>" style="padding: 5px;" alt="<?php echo $facename?>" /><br />
    <?php echo sprintf(ngettext("%d gallery", "%d galleries", count($face['galleries'])), count($face['galleries'])); ?><br />
    <?php if ($GLOBALS['conf']['report_content']['driver']): ?>
-   <a href="<?php echo Horde_Util::addParameter(Horde::applicationUrl('faces/report.php'), 'face', $face_id) ?>" class="small" title="<?php echo _("Report abuse or submit a removal request") ?>"><?php echo _("Report") ?></a><br />
+   <?php echo Horde::applicationUrl('faces/report.php')->add('face', $face_id)->link(
+           array('class' => 'small',
+                 'title' => _("Report abuse or submit a removal request"))) . _("Report") . '</a><br />'?>
    <?php endif; ?>
    <?php if ($conf['faces']['search'] && Horde_Util::loadExtension('libpuzzle')) {
         echo Horde::applicationUrl('faces/search/image_search.php')->add('face_id', $face_id)->link(array('title' => _("Find similar"))) . _("Similar faces") . '</a>';
index 5e0746a..f2f8e1f 100644 (file)
@@ -18,7 +18,7 @@
     <a href="javascript:void(0)" onclick="proccessImageFaces(<?php echo $image->id ?>, 1)">
     <?php echo $reloadimage . _("Reget faces for this photo") ?></a><br />
    <?php endif; ?>
-   <?php echo $customurl->add(array('image' => $image->id, 'gallery' => $image->gallery))->link()?>
+   <?php echo $customurl->copy()->add(array('image' => $image->id, 'gallery' => $image->gallery))->link()?>
    <?php echo  $customimage .  _("Add a custom face range") ?></a><br />
   </td>
   <td style="text-align: center">
@@ -48,7 +48,7 @@ function proccessImageFaces(image_id, reget) {
 }
 
 function deleteFace(image_id, face_id) {
-    var url = '<?php echo Horde::applicationUrl(Horde_Util::addParameter('xrequest.php', array('requestType' => 'EditFaces'))); ?>';
+    var url = '<?php echo Horde::applicationUrl('xrequest.php')->add(array('requestType' => 'EditFaces')); ?>';
     var params = {'image': image_id, face: face_id};
     new Ajax.Request(url + '/action=delete',
                      {
@@ -60,7 +60,7 @@ function deleteFace(image_id, face_id) {
 
 function setFaceName(image_id, face_id) {
     var params = {face: face_id, 'image': image_id, facename: encodeURIComponent($F('facename' + face_id))};
-    var url = '<?php echo Horde::applicationUrl(Horde_Util::addParameter('xrequest.php', array('requestType' => 'EditFaces'))); ?>';
+    var url = '<?php echo Horde::applicationUrl('xrequest.php')->add(array('requestType' => 'EditFaces')); ?>';
     new Ajax.Updater({success: 'face' + face_id},
                      url + '/action=setname',
                      {
index c21ee04..216708b 100755 (executable)
@@ -4,6 +4,6 @@
       <input type="text" name="facename<?php echo $face_id ?>" id="facename<?php echo $face_id ?>" size="15" value="<?php echo $face_name ?>" />
       <a href="javascript:void(0)" onclick="Ansel.setFaceName(<?php echo $image_id ?>, <?php echo $face_id ?>)" title="<?php echo _("Save face name") . '">' . Horde::img('save.png')?></a>
       <a href="javascript:void(0)" onclick="Ansel.deleteFace(<?php echo $image_id ?>, <?php echo $face_id ?>)" title="<?php echo _("Delete face") . '">' . Horde::img('delete.png')?></a>
-      <?php echo $customurl->add(array('face' => $face_id, 'image' => $image_id, 'url' => (!empty($url) ? $url : '')))->link(array('title' => _("Edit face region"))) . Horde::img('edit.png')?></a>
+      <?php echo $customurl->copy()->add(array('face' => $face_id, 'image' => $image_id, 'url' => (!empty($url) ? $url : '')))->link(array('title' => _("Edit face region"))) . Horde::img('edit.png')?></a>
     </div>
 <?php endforeach;?>
index f4f759a..9afe714 100755 (executable)
      <br />
      <img src="<?php echo $faces->getFaceUrl($face['image_id'], $face_id) ?>" style="padding: 5px;" alt="<?php echo $facename?>" /><br />
      <?php echo sprintf(ngettext("%d photo", "%d photos", count($results)), count($results)); ?><br />
-     <a href="<?php echo Horde_Util::addParameter(Horde::applicationUrl('faces/report.php'), 'face', $face_id) ?>" class="small" title="<?php echo _("Report abuse or submit a removal request") ?>"><?php echo _("Report") ?></a>
+     <?php echo Horde::applicationUrl('faces/report.php')->add(array('face', $face_id))->link(
+             array('class' => 'small',
+                   'title' => _("Report abuse or submit a removal request"))) . _("Report") . '</a>'?>
    <?php else: ?>
-     <img src="<?php echo Horde_Util::addParameter(Horde::applicationUrl('faces/search/img.php'), 'thumb', 1) ?>" style="padding: 5px;" alt="<?php echo $title ?>" style="width: 50px; height 50px;" /></a>
+     <img src="<?php echo Horde::applicationUrl('faces/search/img.php')->add('thumb', 1) ?>" style="padding: 5px;" alt="<?php echo $title ?>" style="width: 50px; height 50px;" /></a>
    <?php endif; ?>
   </td>
 <td>
index eed0f22..a541920 100644 (file)
@@ -1,22 +1,20 @@
 <h1 class="header"><?php echo htmlspecialchars($title, ENT_COMPAT, Horde_Nls::getCharset()) ?></h1>
 <?php
-$base_url = Horde::applicationUrl('image.php');
-
-$base_url->add(array_merge(
-                array('gallery' => $gallery_id,
-                      'image' => $image_id,
-                      'page' => $page,
-                      'watermark' => $watermark,
-                      'whalign' => $watermark_halign,
-                      'wvalign' => $watermark_valign,
-                      'font' => $watermark_font),
-                $date));
+$base_url = Horde::applicationUrl('image.php')->add(
+        array_merge(
+            array('gallery' => $gallery_id,
+                  'image' => $image_id,
+                  'page' => $page,
+                  'watermark' => $watermark,
+                  'whalign' => $watermark_halign,
+                  'wvalign' => $watermark_valign,
+                  'font' => $watermark_font),
+            $date));
 
 $edit_url = $base_url->copy()->add('actionID', 'editimage');
 $save_url = $base_url->copy()->add('actionID', $action);
-$image_url = $base_url->copy()->add(array(
-                                    'actionID' => 'image' . $action,
-                                    'view' => 'screen'));
+$image_url = $base_url->copy()->add(array('actionID' => 'image' . $action,
+                                          'view' => 'screen'));
 ?>
 <div class="control anselActions" style="text-align:center;">
 <?php
index f881443..3b55855 100644 (file)
@@ -35,7 +35,6 @@ $lbcssurl = Horde::url($GLOBALS['registry']->get('themesuri', 'ansel') . '/light
 </td>
 </tr></table>
 <?php if (!empty($haveImages)):?>
-<?php $uploadpreview_url = Horde::applicationUrl('img/upload_preview.php');?>
 <script type="text/javascript">
 // <![CDATA[
 // Delay response
@@ -59,7 +58,7 @@ var carousel = null;
 
 function runTest() {
     updateCarouselSize();
-    carousel = new UI.Ajax.Carousel("horizontal_carousel", {url: "<?php echo $uploadpreview_url->add('gallery', $gallery->id) ?>", elementSize: 90})
+    carousel = new UI.Ajax.Carousel("horizontal_carousel", {url: "<?php echo Horde::applicationUrl('img/upload_preview.php')->add('gallery', $gallery->id) ?>", elementSize: 90})
         .observe("request:started", function() {
             $('spinner').show().morph("opacity:0.8", {duration:0.5});
         })
index a0b8a6c..5fa4290 100755 (executable)
@@ -24,11 +24,11 @@ if (isset($face['similarity'])) {
 if ($face['face_name']) {
     echo '<a href="' . $face_url . '" title="' . _("Find other photos this face appears in") . '">' . _("Others") . '</a><br />';
 } elseif ($GLOBALS['conf']['report_content']['driver']) {
-    echo '<a href="' . Horde_Util::addParameter(Horde::applicationUrl('faces/claim.php'), 'face', $face_id)
-                . '" title="' . _("Tell us who is in this photo") . '">' . _("Claim") . '</a><br />';
+    echo Horde::applicationUrl('faces/claim.php')->add('face', $face_id)->link(array('title' => _("Tell us who is in this photo")))
+         . _("Claim") . '</a><br />';
 
-    echo '<a href="' . Horde_Util::addParameter(Horde::applicationUrl('faces/report.php'), 'face', $face_id)
-                . '" title="' . _("Report abuse or submit a removal request") . '">' . _("Report") . '</a><br />';
+    echo Horde::applicationUrl('faces/report.php')->add('face', $face_id)->link(array('title' => _("Report abuse or submit a removal request")))
+         . _("Report") . '</a><br />';
 }
 if ($conf['faces']['search'] && Horde_Util::loadExtension('libpuzzle') !== false) {
     echo Horde::applicationUrl('faces/search/image_search.php')->add('face_id', $face_id)->link(array('title' => _("Find similar"))) . _("Similar faces") . '</a>';
index 62a16bd..eff0be3 100644 (file)
@@ -14,8 +14,11 @@ if ($option_select): ?>
  <div>
   <span class="light">
    <?php if ($option_edit): ?>
-    <?php echo Horde::link(Horde::applicationUrl(Horde_Util::addParameter($image_url, array('actionID' => 'modify'))), '', '', '_blank', Horde::popupJs(Horde::applicationUrl($image_url), array('params' => array('actionID' => 'modify', 'urlencode' => true))) . 'return false;') . _("Properties") ?></a>
-    | <?php echo Horde::link(Horde::applicationUrl(Horde_Util::addParameter($image_url, 'actionID', 'editimage'))) . _("Edit") ?></a>
+    <?php echo $image_url->copy()->add(array('actionID' => 'modify'))->link(
+                array('target' => '_blank',
+                      'onclick' => Horde::popupJs(Horde::applicationUrl($image_url), array('params' => array('actionID' => 'modify', 'urlencode' => true)))
+            . 'return false;')) . _("Properties")?></a>
+    | <?php echo $image_url->copy()->add('actionID', 'editimage')->link() . _("Edit") ?></a>
    <?php endif; ?>
   </span>
  </div>
index 2020c55..d219c51 100644 (file)
@@ -70,7 +70,7 @@ function copySelected()
 function editDates()
 {
     var haveImages = false;
-    var imageDateUrl = '<?php echo Horde::applicationUrl(Horde_Util::addParameter('edit_dates.php', array('gallery' => $this->galleryId))) ?>';
+    var imageDateUrl = '<?php echo Horde::applicationUrl('edit_dates.php')->add(array('gallery' => $this->galleryId)) ?>';
     for (var i = 0; i< document.forms['gallery'].elements.length; ++i) {
        if (document.forms['gallery'].elements[i].checked == true &&
            document.forms['gallery'].elements[i].type == 'checkbox') {
index 6e99c6a..14f30f7 100644 (file)
@@ -68,7 +68,7 @@ function copySelected()
 function editDates()
 {
     var haveImages = false;
-    var imageDateUrl = '<?php echo Horde::applicationUrl(Horde_Util::addParameter('edit_dates.php', array('gallery' => $this->galleryId))) ?>';
+    var imageDateUrl = '<?php echo Horde::applicationUrl('edit_dates.php')->add(array('gallery' => $this->galleryId)) ?>';
     for (var i = 0; i< document.forms['gallery'].elements.length; ++i) {
        if (document.forms['gallery'].elements[i].checked == true &&
            document.forms['gallery'].elements[i].type == 'checkbox') {
index 750ed7b..fadcf16 100644 (file)
   </div>
   <?php endif; ?>
   <?php echo _("Sort by:") . ' '
-      . Horde::link(Horde::applicationUrl(Horde_Util::addParameter($refresh_link, 'sort', 'name')))
+      . $refresh_link->copy()->add('sort', 'name')->link()
       . _("Name") . '</a> | '
-      . Horde::link(Horde::applicationUrl(Horde_Util::addParameter($refresh_link, 'sort', 'last_modified')))
+      . $refresh_link->copy()->add('sort', 'last_modified')->link()
       . _("Date") . '</a> | '
-      . Horde::link(Horde::applicationUrl(Horde_Util::addParameter($refresh_link, 'sort', 'owner')))
+      . $refresh_link->copy()->add('sort', 'owner')->link()
       . _("Owner") . '</a>';
   if ($this->_sortDir) {
-      echo Horde::link(Horde::applicationUrl(Horde_Util::addParameter($refresh_link, array('sort' => $this->_sortBy, 'sort_dir' => 0))))
+      echo $refresh_link->copy()->add(array('sort' => $this->_sortBy, 'sort_dir' => 0))->link()
           . Horde::img('za.png', _("Ascending"))
           . '</a>';
   } else {
-      echo Horde::link(Horde::applicationUrl(Horde_Util::addParameter($refresh_link, array('sort' => $this->_sortBy, 'sort_dir' => 1))))
+      echo $refresh_link->copy()->add(array('sort' => $this->_sortBy, 'sort_dir' => 1))->link()
           . Horde::img('az.png', _("Descending"))
           . '</a>';
    }
index fdcdc92..5a5ba7e 100644 (file)
@@ -62,7 +62,7 @@ function copySelected()
 <div class="header">
 <?php
 /* Build link, if needed, for browsing all users' results */
-$allLink = (!empty($this->_owner)) ? Horde::link(Horde_Util::addParameter(Horde::selfUrl(), array('view' => 'Results')), _("View Results from All Users")) . ' (' . _("View All Results") . ')</a>' : '';
+$allLink = (!empty($this->_owner)) ? Horde::selfUrl()->add(array('view' => 'Results'))->link(array('title' => _("View Results from All Users"))) . ' (' . _("View All Results") . ')</a>' : '';
 if ($total) {
     echo '<span class="rightFloat">' . ($total > $this->_perPage ? sprintf(_("%d to %d of %d Items"), $this->_pagestart, $this->_pageend, $total) : sprintf(ngettext("%d Item", "%d Items", $total), $total)) . '<small>' . $allLink . '</small></span>';
 }
index bbb8657..fbaa5bf 100644 (file)
@@ -18,7 +18,7 @@ if (empty($cmd)) {
         $registry->getApp() . '-' . $conf['server']['name'],
         $registry->get('name'),
         sprintf(_("Publish your photos to %s on %s."), $registry->get('name'), $conf['server']['name']),
-        Horde::applicationUrl(Horde_Util::addParameter('xppublish.php', 'cmd', 'publish'), true, -1),
+        Horde::applicationUrl('xppublish.php', true, -1)->add('cmd', 'publish'),
         Horde::url(Horde_Themes::img('favicon.ico'), true, -1));
     exit;
 }