From: Michael J. Rubinsky Date: Sun, 8 Aug 2010 16:26:24 +0000 (-0400) Subject: Horde::link -> Horde_Url#link() X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=a0662bb9e501771ae1fdb966f7331dedd19b5ece;p=horde.git Horde::link -> Horde_Url#link() --- diff --git a/ansel/js/slideshow.js b/ansel/js/slideshow.js index 720570938..be877bd4e 100644 --- a/ansel/js/slideshow.js +++ b/ansel/js/slideshow.js @@ -147,9 +147,9 @@ Slide.prototype = { } if ($('image_delete_link')) { //TODO : Guess we should have PHP save the localized text for this... - var deleteAction = function() {return window.confirm("Do you want to permanently delete " + SlideController.photos[SlideController.photoId][1])}; + var deleteAction = function() { SlideController.pause(); if (!window.confirm("Do you want to permanently delete " + SlideController.photos[SlideController.photoId][1])) { alert("blah"); return false; } return true;}; $('image_delete_link').href = SlideController.baseUrl + '/image.php' + params + '&actionID=delete'; - $('image_delete_link').observe('click', deleteAction); + $('image_delete_link').observe('click', function(e) { return deleteAction(); e.stop(); }); } $('image_download_link').href = SlideController.baseUrl + '/img/download.php?image=' + SlideController.photos[SlideController.photoId][3]; $('image_download_link').observe('click', function() {SlideController.pause();}); diff --git a/ansel/lib/Block/recent_comments.php b/ansel/lib/Block/recent_comments.php index 58d76db7a..74c15dcfd 100644 --- a/ansel/lib/Block/recent_comments.php +++ b/ansel/lib/Block/recent_comments.php @@ -60,9 +60,7 @@ class Horde_Block_ansel_recent_comments extends Horde_Block try { $gallery = $this->_getGallery(); } catch (Horde_Exception $e) { - return Horde::link( - Ansel::getUrlFor('view', array('view' => 'List'), true)) - . _("Gallery") . ''; + return Ansel::getUrlFor('view', array('view' => 'List'), true)->link() . _("Gallery") . ''; } // Build the gallery name. if (isset($this->_params['gallery'])) { diff --git a/ansel/lib/GalleryMode/Normal.php b/ansel/lib/GalleryMode/Normal.php index 0f1619417..df530a914 100644 --- a/ansel/lib/GalleryMode/Normal.php +++ b/ansel/lib/GalleryMode/Normal.php @@ -216,7 +216,7 @@ class Ansel_GalleryMode_Normal extends Ansel_GalleryMode_Base } catch (VFS_Exception $e) {} /* Delete from storage */ - $GLOBALS['injector']->getInstance('Ansel_Storage')->getScope()->deleteImage($image->id); + $GLOBALS['injector']->getInstance('Ansel_Storage')->getScope()->removeImage($image->id); if (!$isStack) { $this->_gallery->updateImageCount(1, false); } diff --git a/ansel/lib/Storage.php b/ansel/lib/Storage.php index 90c472fc0..7a7e92d1a 100644 --- a/ansel/lib/Storage.php +++ b/ansel/lib/Storage.php @@ -1125,7 +1125,7 @@ class Ansel_Storage public function removeImage($image_id) { $this->_db->exec('DELETE FROM ansel_images WHERE image_id = ' . (int)$image_id); - $this->_db->exec('DELETE FROM ansel_image_attributes WHERE image_id = ' . (int)$imageid); + $this->_db->exec('DELETE FROM ansel_image_attributes WHERE image_id = ' . (int)$image_id); } /** diff --git a/ansel/lib/View/GalleryRenderer/Gallery.php b/ansel/lib/View/GalleryRenderer/Gallery.php index 624523469..be2ad59c8 100644 --- a/ansel/lib/View/GalleryRenderer/Gallery.php +++ b/ansel/lib/View/GalleryRenderer/Gallery.php @@ -107,21 +107,21 @@ class Ansel_View_GalleryRenderer_Gallery extends Ansel_View_GalleryRenderer_Base $cellwidth = round(100 / $tilesperrow); $count = 0; $action_links = array(); + $url = new Horde_Url('#'); if ($GLOBALS['conf']['gallery']['downloadzip']) { - $action_links[] = Horde::link('#', '', 'widget', '', 'downloadSelected(); return false;') . _("Download selected images") . ''; - + $action_links[] = $url->link(array('class' => 'widget', 'onclick.raw' => 'downloadSelected(); return false;')) . _("Download selected images") . ''; } if (!empty($option_edit)) { - $action_links[] = Horde::link('#', '', 'widget', '', 'editDates(); return false;') . _("Edit Dates") . ''; + $action_links[] = $url->link(array('class' => 'widget', 'onclick.raw' => 'editDates(); return false;')) . _("Edit Dates") . ''; } if (!empty($option_delete)) { - $action_links[] = Horde::link('#', '', 'widget', '', 'deleteSelected(); return false;') . _("Delete") . ''; + $action_links[] = $url->link(array('class' => 'widget', 'onclick.raw' => 'deleteSelected(); return false;')) . _("Delete") . ''; } if (!empty($option_move)) { - $action_links[] = Horde::link('#', '', 'widget', '', 'moveSelected(); return false;') . _("Move") . ''; + $action_links[] = $url->link(array('class' => 'widget', 'onclick.raw' =>'moveSelected(); return false;')) . _("Move") . ''; } if (!empty($option_copy)) { - $action_links[] = Horde::link('#', '', 'widget', '', 'copySelected(); return false;') . _("Copy") . ''; + $action_links[] = $url->link(array('class' => 'widget', 'onclick.raw' => 'copySelected(); return false;')) . _("Copy") . ''; } Horde::addScriptFile('popup.js', 'horde'); include ANSEL_TEMPLATES . '/view/gallery.inc'; diff --git a/ansel/lib/View/Image.php b/ansel/lib/View/Image.php index da0fcc6e0..e965bc228 100644 --- a/ansel/lib/View/Image.php +++ b/ansel/lib/View/Image.php @@ -147,7 +147,7 @@ class Ansel_View_Image extends Ansel_View_Base $this->_geometry = $this->resource->getDimensions('screen'); } catch (Horde_Exception $e) { Horde::logMessage($e, 'ERR'); - $this->_geometry = $conf['screen']; + $this->_geometry = $GLOBALS['conf']['screen']; } /* Get the image lists */ diff --git a/ansel/lib/Widget/Actions.php b/ansel/lib/Widget/Actions.php index e19218569..7e80ae508 100644 --- a/ansel/lib/Widget/Actions.php +++ b/ansel/lib/Widget/Actions.php @@ -2,6 +2,13 @@ /** * Ansel_Widget_Actions:: class to wrap the display of gallery actions * + * Copyright 2008-2010 The Horde Project (http://www.horde.org/) + * + * See the enclosed file COPYING for license information (GPL). If you + * did not receive this file, see http://www.fsf.org/copyleft/gpl.html. + * + * @TODO: Use Horde_View for html template output. + * * @author Michael J. Rubinsky * @package Ansel */ @@ -34,14 +41,14 @@ class Ansel_Widget_Actions extends Ansel_Widget_Base if ($this->_view->gallery->hasFeature('upload')) { $uploadurl = Horde::applicationUrl('img/upload.php')->add( array('gallery' => $id, - 'page' => !empty($this->_view->_params['page']) ? $this->_view->_params['page'] : 0) - ); + 'page' => !empty($this->_view->_params['page']) ? $this->_view->_params['page'] : 0)); } $html .= '