From 637b2a0b9b83c173724a5d7c48af97e9a38936e5 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Mon, 3 Aug 2009 14:12:46 -0400 Subject: [PATCH] Clean up the Image and Slideshow views. Have Ansel_View_Slideshow extend Ansel_View_Image to get rid of duplicate code. --- ansel/lib/View/Image.php | 247 +++++++++++++++++++++---------------- ansel/lib/View/Slideshow.php | 128 +------------------ ansel/templates/view/image.inc | 41 +++--- ansel/templates/view/slideshow.inc | 16 +-- 4 files changed, 172 insertions(+), 260 deletions(-) diff --git a/ansel/lib/View/Image.php b/ansel/lib/View/Image.php index dbc1a577b..88b862c0b 100644 --- a/ansel/lib/View/Image.php +++ b/ansel/lib/View/Image.php @@ -12,6 +12,17 @@ */ class Ansel_View_Image extends Ansel_View_Base { + + protected $_slug; + protected $_page; + protected $_date; + protected $_mode; + protected $_style; + protected $_geometry; + protected $_imageList; + protected $_revList; + protected $_urls = array(); + /** * Const'r * @@ -20,11 +31,8 @@ class Ansel_View_Image extends Ansel_View_Base { parent::__construct($params); - /* Get the image */ - $image_id = $params['image_id']; - /* Get the Ansel_Image */ - $image = &$GLOBALS['ansel_storage']->getImage($image_id); + $image = &$GLOBALS['ansel_storage']->getImage($params['image_id']); /* Get the Ansel_Gallery */ $this->gallery = $this->getGallery(); @@ -82,7 +90,6 @@ class Ansel_View_Image extends Ansel_View_Base exit; } - /* Any script files we may need if not calling via the api */ if (empty($this->_params['api'])) { Horde::addScriptFile('effects.js', 'horde', true); @@ -113,134 +120,160 @@ class Ansel_View_Image extends Ansel_View_Base */ public function html() { - global $browser, $conf, $prefs, $registry; - - if (is_a($this->gallery, 'PEAR_Error')) { - echo htmlspecialchars($this->gallery->getMessage()); - return; - } + $this->_prepare(); + return $this->_html(); + } - $page = isset($this->_params['page']) ? $this->_params['page'] : 0; - $galleryId = $this->gallery->id; - $gallerySlug = $this->gallery->get('slug'); - $imageId = $this->resource->id; - $galleryOwner = $this->gallery->get('owner'); - $date = $this->gallery->getDate(); + /** + * Build variables needed to output the html + * + * @return void + */ + protected function _prepare() + { + global $browser; - /* Allow overriding the configured view_mode */ - if (isset($this->_params['mode'])) { - $mode = $this->_params['mode']; - } else { - $mode = $this->_params['mode'] = $this->gallery->get('view_mode'); - } + /* Gallery slug and the page this image is one, if specified */ + $this->_page = isset($this->_params['page']) ? $this->_params['page'] : 0; + $this->_slug = $this->gallery->get('slug'); - /* Get any date infor the gallery has */ - $date = $this->gallery->getDate(); + /* Get any date info the gallery has */ + $this->_date = $this->gallery->getDate(); - $style = (empty($this->_params['style']) ? + $this->_style = (empty($this->_params['style']) ? $this->gallery->getStyle() : Ansel::getStyleDefinition($this->_params['style'])); /* Make sure the screen view is loaded and get the geometry */ - $geometry = $this->resource->getDimensions('screen'); - if (is_a($geometry, 'PEAR_Error')) { - Horde::logMessage($geometry->getMessage(), __FILE__, __LINE__, PEAR_LOG_ERR); - $geometry = $conf['screen']; - } - - /* Get comments before any output in sent. */ - if (($conf['comments']['allow'] == 'all' || ($conf['comments']['allow'] == 'authenticated' && Horde_Auth::getAuth())) && - $registry->hasMethod('forums/doComments')) { - $hasComments = true; - $url = empty($this->_params['comment_url']) ? null : $this->_params['comment_url']; - $comments = $registry->call('forums/doComments', - array('ansel', $imageId, - 'commentCallback', true, null, - $url)); - if (is_a($comments, 'PEAR_Error')) { - Horde::logMessage($comments, __FILE__, __LINE__, PEAR_LOG_DEBUG); - $comments = array(); - } - } else { - $comments = array(); - $hasComments = false; + try { + $this->_geometry = $this->resource->getDimensions('screen'); + } catch (Horde_Exception $e) { + Horde::logMessage($e->getMessage(), __FILE__, __LINE__, PEAR_LOG_ERR); + $this->_geometry = $conf['screen']; } - /* Get the index of the starting image */ - $imageList = $this->gallery->listImages(); - $revList = array_flip($imageList); - $imageIndex = $revList[$imageId]; + /* Get the image lists */ + $this->_imageList = $this->gallery->listImages(); + $this->_revList = array_flip($this->_imageList); /* Not needed when being called via api */ if (empty($this->_params['api'])) { - $ecardurl = Horde::applicationUrl( + $this->_urls['ecard'] = Horde::applicationUrl( Horde_Util::addParameter('img/ecard.php', array_merge( - array('gallery' => $galleryId, - 'image' => $imageId), - $date)), + array('gallery' => $this->gallery->id, + 'image' => $this->resource->id), + $this->_date)), true); + /* Build the various urls */ $imageActionUrl = Horde_Util::addParameter( 'image.php', array_merge( - array('gallery' => $galleryId, - 'image' => $imageId, - 'page' => $page), - $date)); + 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), + array('params' => array('actionID' => 'modify', + 'ret' => 'image', + 'gallery' => $this->gallery->id, + 'image' => $this->resource->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)); } + + /* Check for an explicit gallery view url to use */ if (!empty($this->_params['gallery_view_url'])) { - $galleryurl = str_replace( - array('%g', '%s'), - array($galleryId, $gallerySlug), - urldecode($this->_params['gallery_view_url'])); - Horde_Util::addParameter($galleryurl, $date); + $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); } else { - $galleryurl = Ansel::getUrlFor('view', array_merge( - array('gallery' => $galleryId, - 'slug' => $gallerySlug, - 'page' => $page, + $this->_urls['gallery'] = Ansel::getUrlFor('view', array_merge( + array('gallery' => $this->gallery->id, + 'slug' => $this->_slug, + 'page' => $this->_page, 'view' => 'Gallery'), - $date), + $this->_date), true); } /* Get the image src url */ - $imageUrl = Ansel::getImageUrl($imageId, 'screen', true, $style['name']); + $this->_urls['imgsrc'] = Ansel::getImageUrl($this->resource->id, 'screen', true, $this->_style['name']); /* And a self url. Can't use Horde::selfUrl() since that would ignore * pretty urls. */ - $selfUrl = Ansel::getUrlFor('view', array_merge( - array('gallery' => $galleryId, - 'slug' => $gallerySlug, - 'image' => $imageId, + $this->_urls['self'] = Ansel::getUrlFor('view', array_merge( + array('gallery' => $this->gallery->id, + 'slug' => $this->_slug, + 'image' => $this->resource->id, 'view' => 'Image', - 'page' => $page), - $date)); + 'page' => $this->_page), + $this->_date)); + } + + /** + * Image view specific HTML - done so we can extend View_Image for things + * like the slideshow view etc... + */ + protected function _html() + { + global $conf, $registry, $prefs; + + /* Starting image */ + $imageIndex = $this->_revList[$this->resource->id]; + /* Get comments before any output in sent. */ + if (($conf['comments']['allow'] == 'all' || ($conf['comments']['allow'] == 'authenticated' && Horde_Auth::getAuth())) && + $registry->hasMethod('forums/doComments')) { + $hasComments = true; + $url = empty($this->_params['comment_url']) ? null : $this->_params['comment_url']; + $comments = $registry->call('forums/doComments', + array('ansel', $this->resource->id, + 'commentCallback', true, null, + $url)); + if (is_a($comments, 'PEAR_Error')) { + Horde::logMessage($comments, __FILE__, __LINE__, PEAR_LOG_DEBUG); + $comments = array(); + } + } else { + $comments = array(); + $hasComments = false; + } /* Get the next and previous image ids */ - if (isset($imageList[$imageIndex + 1])) { - $next = $imageList[$imageIndex + 1]; + if (isset($this->_imageList[$imageIndex + 1])) { + $next = $this->_imageList[$imageIndex + 1]; } else { - $next = $imageList[0]; + $next = $this->_imageList[0]; } - if (isset($imageList[$imageIndex - 1])) { - $prev = $imageList[$imageIndex - 1]; + if (isset($this->_imageList[$imageIndex - 1])) { + $prev = $this->_imageList[$imageIndex - 1]; } else { - $prev = $imageList[count($imageList) - 1]; + $prev = $this->_imageList[count($this->_imageList) - 1]; } /** Calculate the page number of the next/prev images */ $perpage = $prefs->getValue('tilesperpage'); - $pagestart = $page * $perpage; - $pageend = min(count($imageList), $pagestart + $perpage - 1); - $page_next = $page; + $pagestart = $this->_page * $perpage; + $pageend = min(count($this->_imageList), $pagestart + $perpage - 1); + $page_next = $this->_page; - if ($revList[$imageId] + 1 > $pageend) { + if ($this->_revList[$this->resource->id] + 1 > $pageend) { $page_next++; } - $page_prev = $page; - if ($revList[$imageId] - 1 < $pagestart) { + $page_prev = $this->_page; + if ($this->_revList[$this->resource->id] - 1 < $pagestart) { $page_prev--; } @@ -248,48 +281,48 @@ class Ansel_View_Image extends Ansel_View_Base if (!empty($this->_params['image_view_url'])) { $prev_url = str_replace( array('%i', '%g', '%s'), - array($prev, $galleryId, $gallerySlug), + array($prev, $this->gallery->id, $this->_slug), urldecode($this->_params['image_view_url'])); } else { $prev_url = Ansel::getUrlFor('view', array_merge( - array('gallery' => $galleryId, - 'slug' => $gallerySlug, + array('gallery' => $this->gallery->id, + 'slug' => $this->_slug, 'image' => $prev, 'view' => 'Image', 'page' => $page_prev), - $date)); + $this->_date)); } - $prvImgUrl = Ansel::getImageUrl($prev, 'screen', false, $style['name']); + $prvImgUrl = Ansel::getImageUrl($prev, 'screen', false, $this->_style['name']); /* Next image link */ if (!empty($this->_params['image_view_url'])) { $next_url = str_replace( array('%i', '%g', '%s'), - array($prev, $galleryId, $gallerySlug), + array($prev, $this->gallery->id, $this->_slug), urldecode($this->_params['image_view_url'])); } else { $next_url = Ansel::getUrlFor('view', array_merge( - array('gallery' => $galleryId, - 'slug' => $gallerySlug, + array('gallery' => $this->gallery->id, + 'slug' => $this->_slug, 'image' => $next, 'view' => 'Image', 'page' => $page_next), - $date)); + $this->_date)); } - $nextImgUrl = Ansel::getImageUrl($next, 'screen', false, $style['name']); + $nextImgUrl = Ansel::getImageUrl($next, 'screen', false, $this->_style['name']); /* Slideshow link */ if (!empty($this->_params['slideshow_link'])) { - $slideshow_url = str_replace(array('%i', '%g'), - array($imageId, $galleryId), + $this->_urls['slideshow'] = str_replace(array('%i', '%g'), + array($this->resource->id, $this->gallery->id), urldecode($this->_params['slideshow_link'])); } else { - $slideshow_url = Horde::applicationUrl( + $this->_urls['slideshow'] = Horde::applicationUrl( Horde_Util::addParameter('view.php', array_merge( - array('gallery' => $galleryId, - 'image' => $imageId, + array('gallery' => $this->gallery->id, + 'image' => $this->resource->id, 'view' => 'Slideshow'), - $date))); + $this->_date))); } $commentHtml = ''; @@ -326,7 +359,7 @@ class Ansel_View_Image extends Ansel_View_Base // Faces if ($conf['faces']['driver']) { - $this->addWidget(Ansel_Widget::factory('ImageFaces', array('selfUrl' => $selfUrl))); + $this->addWidget(Ansel_Widget::factory('ImageFaces', array('selfUrl' => $this->_urls['self']))); } // Links @@ -335,7 +368,7 @@ class Ansel_View_Image extends Ansel_View_Base /* In line caption editing */ if ($this->gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) { $imple = Horde_Ajax_Imple::factory(array('ansel', 'EditCaption'), - array('id' => $imageId, + array('id' => $this->resource->id, 'domid' => "Caption", 'cols' => 120)); $imple->attach(); diff --git a/ansel/lib/View/Slideshow.php b/ansel/lib/View/Slideshow.php index 7ebd00ce6..605c8391a 100644 --- a/ansel/lib/View/Slideshow.php +++ b/ansel/lib/View/Slideshow.php @@ -6,142 +6,26 @@ * @author Michael J. Rubinsky * @package Ansel */ -class Ansel_View_Slideshow extends Ansel_View_Base +class Ansel_View_Slideshow extends Ansel_View_Image { /** - * @static + * const'r * - * @return Ansel_View_Slidshow The view object. - * - * @TODO use exceptions from the constructor instead of static - * instance-getting. */ public function __construct($params = array()) { parent::__construct($params); - if (empty($params['image_id'])) { - $image_id = Horde_Util::getFormData('image'); - } else { - $image_id = $params['image_id']; - } - $image = $GLOBALS['ansel_storage']->getImage($image_id); - $this->gallery = $this->getGallery($image->gallery); - $this->image = $image; - - // Check user age - if (!$this->gallery->isOldEnough()) { - $date = Ansel::getDateParameter( - array('year' => !empty($this->_params['year']) ? $this->_params['year'] : 0, - 'month' => !empty($this->_params['month']) ? $this->_params['month'] : 0, - 'day' => !empty($this->_params['day']) ? $this->_params['day'] : 0)); - - $url = Ansel::getUrlFor('view', array_merge( - array('gallery' => $this->gallery->id, - 'slug' => empty($params['slug']) ? '' : $params['slug'], - 'page' => empty($params['page']) ? 0 : $params['page'], - 'view' => 'Slideshow', - 'image' => $image->id), - $date), - true); - - $params = array('gallery' => $this->gallery->id, 'url' => $url); - - header('Location: ' . Horde_Util::addParameter(Horde::applicationUrl('disclamer.php'), $params, null, false)); - exit; - } - - // Check password - if ($this->gallery->hasPasswd()) { - $date = Ansel::getDateParameter( - array('year' => isset($this->_params['year']) ? $this->_params['year'] : 0, - 'month' => isset($this->_params['month']) ? $this->_params['month'] : 0, - 'day' => isset($this->_params['day']) ? $this->_params['day'] : 0)); - - $url = Ansel::getUrlFor('view', array_merge( - array('gallery' => $this->gallery->id, - 'slug' => empty($params['slug']) ? '' : $params['slug'], - 'page' => empty($params['page']) ? 0 : $params['page'], - 'view' => 'Slideshow', - 'image' => $image->id), - $date), - true); - - $params = array('gallery' => $this->gallery->id, 'url' => $url); - - header('Location: ' . Horde_Util::addParameter(Horde::applicationUrl('protect.php'), $params, null, false)); - exit; - } - - - Horde::addScriptFile('effects.js', 'horde', true); - Horde::addScriptFile('stripe.js', 'horde', true); Horde::addScriptFile('slideshow.js', 'ansel', true); } - /** - * Get the title for this view. - * - * @return string The title. - */ - public function getTitle() + protected function _html() { - return $this->resource->filename; - } - - /** - * Get the HTML representing this view. - * - * @return string The HTML. - */ - public function html() - { - global $browser, $conf, $prefs, $registry; - - $page = Horde_Util::getFormData('page', 0); - $galleryId = $this->gallery->id; - $imageId = $this->resource->id; - $galleryOwner = $this->gallery->get('owner'); - $style = $this->gallery->getStyle(); - - /* Get date info to pass along the links */ - if (!empty($this->_params['year'])) { - $date = Ansel::getDateParameter( - array('year' => $this->_params['year'], - 'month' => $this->_params['month'], - 'day' => $this->_params['day'])); - } else { - $date = array(); - } - - /* Get the index of the starting image */ - $imageList = $this->gallery->listImages(); - - $style = $this->gallery->getStyle(); - $revList = array_flip($imageList); - $imageIndex = $revList[$imageId]; - if (isset($imageList[$imageIndex - 1])) { - $prev = $imageList[$imageIndex - 1]; - } else { - $prev = $imageList[count($imageList) - 1]; - } - - $ecardurl = Horde_Util::addParameter('img/ecard.php', - array('gallery' => $galleryId, - 'image' => $imageId)); - $galleryurl = Horde_Util::addParameter('view.php', array_merge( - array('gallery' => $galleryId, - 'page' => $page), - $date)); - $imageActionUrl = Horde_Util::addParameter('image.php', array_merge( - array('gallery' => $galleryId, - 'image' => $imageId, - 'page' => $page), - $date)); - $imageUrl = Ansel::getImageUrl($imageId, 'screen', false, $style['name']); - + global $registry, $prefs; + $imageIndex = $this->_revList[$this->resource->id]; ob_start(); require ANSEL_TEMPLATES . '/view/slideshow.inc'; return ob_get_clean(); + } public function viewType() diff --git a/ansel/templates/view/image.inc b/ansel/templates/view/image.inc index ca28593d1..ef5c9650e 100644 --- a/ansel/templates/view/image.inc +++ b/ansel/templates/view/image.inc @@ -8,12 +8,12 @@ document.observe('dom:loaded', function() { afterFinish: function() {$$('.imgloading').each(function(n) { n.setStyle({visibility: 'hidden'});}); new Effect.Appear($('Caption'), { duration: 0.5 }); }}); - nextImg = new Image(); - prvImg = new Image(); + var nextImg = new Image(); + var prvImg = new Image(); nextImg.src = ""; prvImg.src = ""; }); - new Effect.Opacity('photodiv', {to: 0, duration: 0.5, afterFinish: function() {$('photodiv').src = ""} }); + new Effect.Opacity('photodiv', {to: 0, duration: 0.5, afterFinish: function() {$('photodiv').src = "_urls['imgsrc'] ?>"} }); // Arrow keys for navigation document.observe('keydown', arrowHandler); @@ -50,35 +50,30 @@ function arrowHandler(e)

-
+ gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT) && empty($this->_params['api'])) { $needSeperator = true; - $actionHTML .= Horde::link('#', '', '', '_blank', Horde::popupJs(Horde::applicationUrl($imageActionUrl), array('params' => array('actionID' => 'modify', 'ret' => 'image'), 'urlencode' => true)) . 'return false;', '', '', array('id' => 'image_properties_link')) . _("Properties") . ''; - $actionHTML .= ' | ' . Horde::link(Horde::applicationUrl(Horde_Util::addParameter($imageActionUrl, 'actionID', 'editimage')), '', '', '', '', '', '', array('id' => 'image_edit_link')) . _("Edit") . ''; + $actionHTML .= Horde::link('#', '', '', '_blank', $this->_urls['prop_popup'] . 'return false;', '', '', array('id' => 'image_properties_link')) . _("Properties") . ''; + $actionHTML .= ' | ' . Horde::link($this->_urls['edit'], '', '', '', '', '', '', array('id' => 'image_edit_link')) . _("Edit") . ''; } if ($this->gallery->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE) && empty($this->_params['api'])) { - $actionHTML .= ' | ' . Horde::link(Horde::applicationUrl(Horde_Util::addParameter($imageActionUrl, 'actionID', 'delete')), '', '', '', 'return window.confirm(\'' . addslashes(sprintf(_("Do you want to permanently delete ''%s''?"), $this->resource->filename)) . '\');', '', '', array('id' => 'image_delete_link')) . _("Delete") . ''; + $actionHTML .= ' | ' . Horde::link($this->_urls['delete'], '', '', '', 'return window.confirm(\'' . addslashes(sprintf(_("Do you want to permanently delete ''%s''?"), $this->resource->filename)) . '\');', '', '', array('id' => 'image_delete_link')) . _("Delete") . ''; } - if (!empty($conf['ecard']['enable']) && !empty($ecardurl)) { - $actionHTML .= (empty($this->_params['api']) && $needSeperator ? ' | ' : '') . Horde::link($ecardurl, '', '', '_blank', '', '', '', array('id' => 'image_ecard_link')) . _("Send an Ecard"); $needSeperator = true . ''; + if (!empty($conf['ecard']['enable']) && !empty($this->_urls['ecard'])) { + $actionHTML .= (empty($this->_params['api']) && $needSeperator ? ' | ' : '') . Horde::link($this->_urls['ecard'], '', '', '_blank', '', '', '', array('id' => 'image_ecard_link')) . _("Send an Ecard"); $needSeperator = true . ''; } if ($this->gallery->canDownload()) { - $actionHTML .= (empty($this->_params['api']) && $needSeperator ? ' | ' : '') . Horde::link(Horde::applicationUrl(Horde_Util::addParameter('img/download.php', 'image', $imageId), true), '', '', '', '', '', '', array('id' => 'image_download_link')) . _("Download Original Photo"); $needSeperator = true . ''; + $actionHTML .= (empty($this->_params['api']) && $needSeperator ? ' | ' : '') . Horde::link($this->_urls['download'], '', '', '', '', '', '', array('id' => 'image_download_link')) . _("Download Original Photo"); $needSeperator = true . ''; } if (empty($this->_params['api']) && $this->gallery->get('owner') != Horde_Auth::getAuth() && !empty($GLOBALS['conf']['report_content']['driver']) && (($conf['report_content']['allow'] == 'authenticated' && Horde_Auth::isAuthenticated()) || $conf['report_content']['allow'] == 'all')) { - $reporturl = Horde_Util::addParameter( - Horde::applicationUrl('report.php'), - array('gallery' => $this->gallery->id, - 'image' => $imageId)); - - $actionHTML .= ($needSeperator ? ' | ' : '' ) . Horde::link($reporturl) . _("Report") . ''; + $actionHTML .= ($needSeperator ? ' | ' : '' ) . Horde::link($this->_urls['report']) . _("Report") . ''; } if (strlen($actionHTML)) { echo '
' . $actionHTML . '
'; @@ -88,24 +83,24 @@ function arrowHandler(e) $registry->getImageDir('horde'), 'attr' => 'class="imgloading"'));?> _params['hide_slideshow'])) { - echo ''; } echo '' . Horde::fullSrcImg('slideshow_prev.png', array('attr' => 'alt="' . _("Previous") . '"')) . ''; echo '' . Horde::fullSrcImg('slideshow_next.png', array('attr' => 'alt="' . _("Next") . '"')) . ''; - echo '' . + echo '' . Horde::fullSrcImg('galleries.png', array('attr' => 'alt="' . _("Back to gallery") . '"')) . ''; ?>
- 'photodiv', 'width' => $geometry['width'], 'height' => $geometry['height']), $registry->getImageDir('horde')) ?> -
+ 'photodiv', 'width' => $this->_geometry['width'], 'height' => $this->_geometry['height']), $registry->getImageDir('horde')) ?> +
@@ -115,14 +110,14 @@ function arrowHandler(e) $registry->getImageDir('horde'), 'attr' => 'class="imgloading"'));?> _params['hide_slideshow'])) { - echo ''; } echo '' . Horde::fullSrcImg('slideshow_prev.png', array('attr' => 'alt="' . _("Previous") . '"')) . ''; echo '' . Horde::fullSrcImg('slideshow_next.png', array('attr' => 'alt="' . _("Next") . '"')) . ''; - echo '' . + echo '' . Horde::fullSrcImg('galleries.png', array('attr' => 'alt="' . _("Back to gallery") . '"')) . ''; ?>
diff --git a/ansel/templates/view/slideshow.inc b/ansel/templates/view/slideshow.inc index 559e9ef83..60b0a91ac 100644 --- a/ansel/templates/view/slideshow.inc +++ b/ansel/templates/view/slideshow.inc @@ -5,7 +5,7 @@ SlideController.initialize(json() ?>, &image=" + SlideController.photos[SlideController.photoId][3] + "&view=Image&page=" + SlideController.photos[SlideController.photoId][4]; + location.href = "_urls['gallery'], true) ?>?image=" + SlideController.photos[SlideController.photoId][3] + "&view=Image&page=" + SlideController.photos[SlideController.photoId][4]; } @@ -14,23 +14,23 @@ function stopSlideShow()
gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)): ?> - 'modify', 'share' => $this->gallery->getName(), 'ret' => 'image'))), '', '', '_blank', 'SlideController.pause();' . Horde::popupJs(Horde::applicationUrl($imageActionUrl), array('params' => array('actionID' => 'modify', 'share' => $this->gallery->getName(), 'ret' => 'image'), 'urlencode' => true)) . 'return false;', '', '', array('id' => 'image_properties_link')) . _("Properties") ?> - | 'image_edit_link')) . _("Edit") ?> + _urls['prop_popup'], '', '', array('id' => 'image_properties_link')) . _("Properties") ?> + | _urls['edit']), '', '', '', '', '', '', array('id' => 'image_edit_link')) . _("Edit") ?> gallery->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)): ?> - | image->filename)) . '\');', '', '', array('id' => 'image_delete_link')) . _("Delete") ?> + | _urls['delete'], '', '', '', 'return window.confirm(\'' . addslashes(sprintf(_("Do you want to permanently delete \"%s\"?"), $this->resource->filename)) . '\');', '', '', array('id' => 'image_delete_link')) . _("Delete") ?> - true)) . 'return false;', '', '', array('id' => 'image_ecard_link')) . _("Send an Ecard") ?> | + _urls['ecard'], '', '', '_blank', 'SlideController.pause();' . Horde::popupJs($ecardurl, array('urlencode' => true)) . 'return false;', '', '', array('id' => 'image_ecard_link')) . _("Send an Ecard") ?> | - 'image_download_link')) . _("Download Original Photo") ?> + _urls['download'], '', '', '', 'SlideController.pause();', '', '', array('id' => 'image_download_link')) . _("Download Original Photo") ?>
- +
-- 2.11.0
@@ -48,7 +48,7 @@ function stopSlideShow()
- 'Photo', 'style' => 'display:none;'), $registry->getImageDir('horde')) ?> + 'Photo', 'style' => 'display:none;', 'width' => $this->_geometry['width'], 'height' => $this->_geometry['height']), $registry->getImageDir('horde')) ?>