From b563f84d8f0055a4f7fec6720778f5b961d5de8d Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Wed, 2 Jun 2010 13:34:43 -0400 Subject: [PATCH] Use Horde_Url style links, parameter adding etc... --- ansel/faces/claim.php | 7 +- ansel/faces/custom.php | 2 +- ansel/faces/gallery.php | 4 +- ansel/faces/report.php | 8 +-- ansel/faces/savecustom.php | 10 +-- ansel/gallery.php | 8 +-- ansel/group.php | 6 +- ansel/image.php | 36 +++++----- ansel/lib/Ajax/Imple/ImageSaveGeotag.php | 9 ++- ansel/lib/Ajax/Imple/TagActions.php | 2 +- ansel/lib/Ansel.php | 63 ++++++++---------- ansel/lib/Api.php | 18 +++-- ansel/lib/Block/gallery.php | 9 +-- ansel/lib/Block/my_galleries.php | 11 ++-- ansel/lib/Block/random_photo.php | 2 +- ansel/lib/Block/recent_comments.php | 5 +- ansel/lib/Block/recently_added.php | 12 ++-- ansel/lib/Block/recently_added_geodata.php | 6 +- ansel/lib/Faces.php | 13 ++-- ansel/lib/Faces/Base.php | 7 +- ansel/lib/Tags.php | 19 +++--- ansel/lib/Tile/DateGallery.php | 24 ++++--- ansel/lib/Tile/Gallery.php | 30 ++++----- ansel/lib/Tile/Image.php | 35 +++++----- ansel/lib/View/Gallery.php | 4 +- ansel/lib/View/GalleryRenderer/Gallery.php | 4 +- ansel/lib/View/GalleryRenderer/GalleryLightbox.php | 4 +- ansel/lib/View/Image.php | 56 +++++++--------- ansel/lib/View/List.php | 2 +- ansel/lib/View/Results.php | 14 ++-- ansel/lib/Widget/Actions.php | 69 +++++++++----------- ansel/lib/Widget/GalleryFaces.php | 11 ++-- ansel/lib/Widget/Geotag.php | 76 ++++++++++++++++++---- ansel/lib/Widget/ImageFaces.php | 10 ++- ansel/lib/Widget/Links.php | 4 +- ansel/lib/Widget/OtherGalleries.php | 15 ++--- ansel/lib/Widget/OwnerFaces.php | 13 ++-- ansel/lib/Widget/SimilarPhotos.php | 18 +++-- ansel/lib/Widget/Tags.php | 9 +-- ansel/protect.php | 2 +- ansel/rss.php | 4 +- ansel/templates/faces/face.inc | 4 +- ansel/templates/faces/gallery.inc | 6 +- ansel/templates/faces/image.inc | 2 +- ansel/templates/faces/search.inc | 6 +- ansel/templates/image/preview_image.inc | 26 ++++---- ansel/templates/image/upload.inc | 3 +- ansel/templates/tile/face.inc | 8 +-- ansel/templates/tile/image.inc | 7 +- ansel/templates/view/gallery.inc | 2 +- ansel/templates/view/gallerylightbox.inc | 2 +- ansel/templates/view/list.inc | 10 +-- ansel/templates/view/results.inc | 2 +- ansel/xppublish.php | 2 +- 54 files changed, 373 insertions(+), 368 deletions(-) diff --git a/ansel/faces/claim.php b/ansel/faces/claim.php index 35273d155..f32f16cdd 100644 --- a/ansel/faces/claim.php +++ b/ansel/faces/claim.php @@ -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" diff --git a/ansel/faces/custom.php b/ansel/faces/custom.php index 09465efa2..21db99f88 100644 --- a/ansel/faces/custom.php +++ b/ansel/faces/custom.php @@ -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); diff --git a/ansel/faces/gallery.php b/ansel/faces/gallery.php index 1d20b148a..a93faf9ec 100644 --- a/ansel/faces/gallery.php +++ b/ansel/faces/gallery.php @@ -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') . ''); +$title = sprintf(_("Searching for faces in %s"),Ansel::getUrlFor('view', array('gallery' => $gallery_id, 'view' => 'Gallery'))->link() . $gallery->get('name') . ''); Horde::addScriptFile('stripe.js', 'horde'); Horde::addScriptFile('popup.js', 'horde'); require ANSEL_TEMPLATES . '/common-header.inc'; diff --git a/ansel/faces/report.php b/ansel/faces/report.php index cecd1bd32..bd1456c27 100644 --- a/ansel/faces/report.php +++ b/ansel/faces/report.php @@ -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" diff --git a/ansel/faces/savecustom.php b/ansel/faces/savecustom.php index 79a88bc27..b2a0e0f79 100644 --- a/ansel/faces/savecustom.php +++ b/ansel/faces/savecustom.php @@ -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'); diff --git a/ansel/gallery.php b/ansel/gallery.php index 768121ef1..8b0d91946 100644 --- a/ansel/gallery.php +++ b/ansel/gallery.php @@ -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: diff --git a/ansel/group.php b/ansel/group.php index efc110acd..accc8a1a9 100644 --- a/ansel/group.php +++ b/ansel/group.php @@ -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") . ''; + $groupby_links[] = Ansel::getUrlFor('group', array('actionID' => 'groupby', 'groupby' => 'owner'))->link() . _("owner") . ''; } elseif ($groupby !== 'category') { - $groupby_links[] = Horde::link(Ansel::getUrlFor('group', array('actionID' => 'groupby', 'groupby' => 'category'))) . _("category") . ''; + $groupby_links[] = Ansel::getUrlFor('group', array('actionID' => 'groupby', 'groupby' => 'category'))->link() . _("category") . ''; } if ($groupby !== 'none') { - $groupby_links[] = Horde::link(Ansel::getUrlFor('group', array('actionID' => 'groupby', 'groupby' => 'none'))) . _("none") . ''; + $groupby_links[] = Ansel::getUrlFor('group', array('actionID' => 'groupby', 'groupby' => 'none'))->link() . _("none") . ''; } require ANSEL_TEMPLATES . '/common-header.inc'; diff --git a/ansel/image.php b/ansel/image.php index fc297e62f..b468aa6ca 100644 --- a/ansel/image.php +++ b/ansel/image.php @@ -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 . '";', diff --git a/ansel/lib/Ajax/Imple/ImageSaveGeotag.php b/ansel/lib/Ajax/Imple/ImageSaveGeotag.php index c2ecd129c..153c97ae8 100644 --- a/ansel/lib/Ajax/Imple/ImageSaveGeotag.php +++ b/ansel/lib/Ajax/Imple/ImageSaveGeotag.php @@ -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 = '
'; @@ -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") . '[image]'; + $imgsrc .= $addurl->link( + array('title' => $title, + 'onclick' => "Ansel.widgets.geotag.setLocation('" . $data['image_latitude'] . "', '" . $data['image_longitude'] . "');return false")) + . '[image]'; } $imgsrc .= '
'; $content = sprintf(_("No location data present. Place using %smap%s or click on image to place at the same location."), $addLink, '') . $imgsrc; diff --git a/ansel/lib/Ajax/Imple/TagActions.php b/ansel/lib/Ajax/Imple/TagActions.php index b914ee021..6e6152c2b 100644 --- a/ansel/lib/Ajax/Imple/TagActions.php +++ b/ansel/lib/Ajax/Imple/TagActions.php @@ -108,7 +108,7 @@ class Ansel_Ajax_Imple_TagActions extends Horde_Ajax_Imple_Base $links = Ansel_Tags::getTagLinks($tags, 'add'); $html = ''; return $html; diff --git a/ansel/lib/Ansel.php b/ansel/lib/Ansel.php index 933a90c88..686ef7d15 100644 --- a/ansel/lib/Ansel.php +++ b/ansel/lib/Ansel.php @@ -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 . '' . $nav; + $nav = $separator . Ansel::getUrlFor('view', array_merge($navdata, $urlParameters))->link() . $title . '' . $nav; } else { $nav = $separator . '' . $title . '' . $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 . '' . $nav; + $nav = $separator . Ansel::getUrlFor('view', array('view' => 'List', 'groupby' => 'owner', 'owner' => $owner, 'havesearch' => $haveSearch))->link() . $owner_title . '' . $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 . '' . $nav; diff --git a/ansel/lib/Api.php b/ansel/lib/Api.php index da35f3599..6de9e1bb8 100644 --- a/ansel/lib/Api.php +++ b/ansel/lib/Api.php @@ -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); } } diff --git a/ansel/lib/Block/gallery.php b/ansel/lib/Block/gallery.php index 02ede55a1..4ffd086af 100644 --- a/ansel/lib/Block/gallery.php +++ b/ansel/lib/Block/gallery.php @@ -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") . ''; + return Ansel::getUrlFor('view', array('view' => 'List'), true)->link() . _("Gallery") . ''; } // 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()) . ''; @@ -96,9 +95,7 @@ class Horde_Block_ansel_gallery extends Horde_Block { 'slug' => $gallery->get('slug')), true); $html .= '