*/
public function __construct($params = array())
{
- global $prefs, $ansel_storage, $notification;
+ global $prefs, $ansel_storage;
parent::__construct($params);
+ /* Notifications */
+ $notification = $GLOBALS['injector']->getInstance('Horde_Notification');
+
// We'll need this in the template.
$this->_sortBy = !empty($this->_params['sort']) ? $this->_params['sort'] : 'name';
$this->_sortDir = isset($this->_params['sort_dir']) ? $this->_params['sort_dir'] : 0;
*/
public function html()
{
- global $conf, $prefs, $registry, $ansel_storage, $notification;
+ global $conf, $prefs, $registry, $ansel_storage;
$vars = Horde_Variables::getDefaultVariables();
if (!empty($this->_params['page'])) {
{
global $prefs, $conf, $ansel_storage;
+ $notification = $GLOBALS['injector']->getInstance('Horde_Notification');
+
$this->_owner = Horde_Util::getFormData('owner', null);
$this->_search = Ansel_Tags::getSearch(null, $this->_owner);
$this->_page = Horde_Util::getFormData('page', 0);
$img = $ansel_storage->getImage($image);
$gallery = $ansel_storage->getgallery($img->gallery);
if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
- $GLOBALS['notification']->push(
+ $notification->push(
sprintf(_("Access denied deleting photos from \"%s\"."), $image),
'horde.error');
} else {
$result = $gallery->removeImage($image);
if (is_a($result, 'PEAR_Error')) {
- $GLOBALS['notification']->push(
- sprintf(_("There was a problem deleting photos: %s"),
- $result->getMessage()), 'horde.error');
+ $notification->push(
+ sprintf(_("There was a problem deleting photos: %s"), $result->getMessage()), 'horde.error');
} else {
- $GLOBALS['notification']->push(_("Deleted the photo."),
- 'horde.success');
+ $notification->push(_("Deleted the photo."), 'horde.success');
Ansel_Tags::clearCache();
}
}
if ($images && $newGallery) {
$newGallery = $ansel_storage->getGallery($newGallery);
if (is_a($newGallery, 'PEAR_Error')) {
- $GLOBALS['notification']->push(_("Bad input."),
- 'horde.error');
+ $notification->push(_("Bad input."), 'horde.error');
} else {
// Group by gallery first, then process in bulk by gallery.
$galleries = array();
$gallery = $ansel_storage->getGallery($gallery_id);
$result = $gallery->moveImagesTo($images, $newGallery);
if (is_a($result, 'PEAR_Error')) {
- $GLOBALS['notification']->push($result, 'horde.error');
+ $notification->push($result, 'horde.error');
} else {
- $GLOBALS['notification']->push(
+ $notification->push(
sprintf(ngettext("Moved %d photo from \"%s\" to \"%s\"",
"Moved %d photos from \"%s\" to \"%s\"",
count($images)),
if ($images && $newGallery) {
$newGallery = $ansel_storage->getGallery($newGallery);
if (is_a($newGallery, 'PEAR_Error')) {
- $GLOBALS['notification']->push(_("Bad input."),
- 'horde.error');
+ $notification->push(_("Bad input."), 'horde.error');
} else {
// Group by gallery first, then process in bulk by gallery.
$galleries = array();
$gallery = $ansel_storage->getGallery($gallery_id);
$result = $gallery->copyImagesTo($images, $newGallery);
if (is_a($result, 'PEAR_Error')) {
- $GLOBALS['notification']->push($result,
- 'horde.error');
+ $notification->push($result, 'horde.error');
} else {
- $GLOBALS['notification']->push(
+ $notification->push(
sprintf(ngettext("Copied %d photo from %s to %s",
"Copied %d photos from %s to %s",
count($images)),