$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"
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);
$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();
);
$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';
$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"
$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');
$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);
}
$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');
}
$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':
}
$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:
$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';
'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,
}
/* 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);
$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',
}
}
- $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',
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 . '";',
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">';
} 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;
$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;
} 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 */
$url = new Horde_Url($url);
if (count($extras)) {
- $url = $url->add($extras);
+ $url->add($extras);
}
} elseif ($data['view'] == 'Results') {
: ''));
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
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;
$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':
$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':
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
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')
} 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;
}
$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;
}
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;
$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;
$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;
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);
}
}
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.
'gallery' => $gallery->id,
'slug' => $gallery->get('slug')),
true);
- return Horde::link($viewurl)
+ return $viewurl->link()
. @htmlspecialchars($name, ENT_COMPAT, Horde_Nls::getCharset())
. '</a>';
'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)) {
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>';
}
'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>';
} else {
$img = Horde::img('thumb-error.png');
}
- return Horde::link($viewurl, _("View Photo")) . $img . '</a>';
+ return $viewurl->link(array('title' => _("View Photo"))) . $img . '</a>';
}
}
$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()
$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">'
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.
$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()
'gallery' => $gallery->id,
'view' => 'Gallery'),
true);
- $galleryLink = Horde::link($galleryLink)
+ $galleryLink = $galleryLink->link()
. @htmlspecialchars($gallery->get('name'), ENT_COMPAT,
Horde_Nls::getCharset())
. '</a>';
'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(
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.
$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()
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\" />",
'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>';
* 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
{
// 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());
* 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
*/
/**
* Class that represents a slice of a tag search
*
* @TODO: Move this to Ansel_Search_Tags
- *
- *
*/
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>';
* 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.
*
*
* @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');
'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 */
* 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.
*
*
* @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
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>';
. '</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 &&
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);
Horde::startBuffer();
include ANSEL_TEMPLATES . '/tile/gallery' . ($mini ? 'mini' : '') . '.inc';
+
return Horde::endBuffer();
}
* 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'.
*
*
* @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;
$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
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;
}
$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',
'domid' => $image->id . 'caption'));
$imple->attach();
}
-
include ANSEL_BASE . '/templates/tile/image.inc';
+
return Horde::endBuffer();
}
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;
}
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;
}
$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
$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
$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;
}
$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;
}
/* 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,
'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,
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 = '';
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');
$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);
{
$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)
);
} 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') . '"> </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')))
+ . ' </a></div>' . "\n";
$html .= $this->_htmlEnd();
return $html;
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();
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 */
$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>';
}
}
$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>';
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');
. ';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">';
*/
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;
}
return true;
}
+ /**
+ * Build the HTML for the widget
+ *
+ * @TODO inject $ansel_storage
+ * @return string
+ */
public function html()
{
global $ansel_storage;
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
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]);
}
} 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">';
} 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 {
// 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>';
}
};
EOT;
-
if (empty($noGeotag)) {
$html .= "\n" . 'Event.observe(window, "load", function() {Ansel.widgets.geotag.doMap();});' . "\n";
}
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");
// 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
$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'])) {
* 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) {
$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') . '"> </a></div>' . "\n";
+ . $selfurl->add('actionID', 'show_actions')->link(
+ array('id' => 'othergalleries-toggle',
+ 'class' => ($GLOBALS['prefs']->getValue('show_othergalleries') ? 'hide' : 'show')))
+ . ' </a></div>';
return $html;
}
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']
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++;
}
}
$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>';
$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>';
$_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;
} 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();
<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>';
<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">
}
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',
{
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',
{
<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;?>
<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>
<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
</td>
</tr></table>
<?php if (!empty($haveImages)):?>
-<?php $uploadpreview_url = Horde::applicationUrl('img/upload_preview.php');?>
<script type="text/javascript">
// <![CDATA[
// Delay response
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});
})
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>';
<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>
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') {
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') {
</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>';
}
<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>';
}
$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;
}