Copyright 2003-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.
Author: Michael J Rubinsky (mrubinsk@horde.org)
Ejemplo n.º 1
0
 /**
  * Contructor.
  *
  * Also handles any actions from the view.
  *
  * @return Ansel_View_Results
  */
 public function __construct(array $params = array())
 {
     global $prefs, $conf, $injector, $notification;
     $ansel_storage = $injector->getInstance('Ansel_Storage');
     $this->_owner = Horde_Util::getFormData('owner', '');
     $this->_browser = new Ansel_TagBrowser($injector->getInstance('Ansel_Tagger'), null, $this->_owner);
     $this->_page = Horde_Util::getFormData('page', 0);
     $actionID = Horde_Util::getFormData('actionID', '');
     $image_id = Horde_Util::getFormData('image');
     $vars = Horde_Variables::getDefaultVariables();
     // Number perpage from prefs or config.
     $this->_perPage = min($prefs->getValue('tilesperpage'), $conf['thumbnail']['perpage']);
     // Common image actions.
     if (Ansel_ActionHandler::imageActions($actionID)) {
         Ansel::getUrlFor('view', array('view' => 'Results'), true)->redirect();
         exit;
     }
     // Tag browsing actions.
     switch ($actionID) {
         case 'remove':
             $tag = Horde_Util::getFormData('tag');
             if (isset($tag)) {
                 $this->_browser->removeTag($tag);
                 $this->_browser->save();
             }
             break;
         case 'add':
         default:
             $tag = Horde_Util::getFormData('tag');
             if (isset($tag)) {
                 $this->_browser->addTag($tag);
                 $this->_browser->save();
             }
             break;
     }
     // Check for empty tag search and redirect if empty
     if ($this->_browser->tagCount() < 1) {
         Horde::url('browse.php', true)->redirect();
         exit;
     }
 }
Ejemplo n.º 2
0
<?php

/**
 * Copyright 2001-2014 Horde LLC (http://www.horde.org/)
 *
 * See the enclosed file COPYING for license information (GPL). If you
 * did not receive this file, see http://www.horde.org/licenses/gpl.
 *
 * @author Chuck Hagenbuch <*****@*****.**>
 * @author Michael J. Rubinsky <*****@*****.**>
 * @package Ansel
 */
require_once __DIR__ . '/lib/Application.php';
Horde_Registry::appInit('ansel');
// Redirect to the gallery list if no action has been requested.
$actionID = Horde_Util::getFormData('actionID');
if (is_null($actionID)) {
    Horde::url('view.php?view=List', true)->redirect();
    exit;
}
if (!Ansel_ActionHandler::galleryActions($actionID)) {
    Horde::url(Ansel::getUrlFor('view', array('view' => 'List'), true))->redirect();
    exit;
}
Ejemplo n.º 3
0
Archivo: Base.php Proyecto: horde/horde
 /**
  * Constructor
  *
  * @param Ansel_View_Gallery  The view object for this renderer.
  */
 public function __construct(Ansel_View_Gallery $view = null)
 {
     $this->view = $view;
     Ansel_ActionHandler::imageActions(Horde_Util::getFormData('actionID'));
 }
Ejemplo n.º 4
0
 *
 * @author Chuck Hagenbuch <*****@*****.**>
 * @author Michael J. Rubinsky <*****@*****.**>
 */
require_once __DIR__ . '/lib/Application.php';
Horde_Registry::appInit('ansel');
// Get all the form data
$actionID = Horde_Util::getFormData('actionID');
$page = Horde_Util::getFormData('page', 0);
// None of the views on this page display side or top bars.
$page_output->topbar = $page_output->sidebar = false;
// Check basic image actions.
if (Ansel_ActionHandler::imageActions($actionID)) {
    $gallery_id = Horde_Util::getFormData('gallery');
    $gallery = $injector->getInstance('Ansel_Storage')->getGallery($gallery_id);
    $children = $gallery->countGalleryChildren(Horde_Perms::SHOW);
    $perpage = min($prefs->getValue('tilesperpage'), $conf['thumbnail']['perpage']);
    $pages = ceil($children / $perpage);
    if ($page > $pages) {
        $page = $pages;
    }
    // Return to the image list.
    Ansel::getUrlFor('view', array_merge(array('gallery' => $gallery_id, 'view' => 'Gallery', 'page' => $page, 'slug' => $gallery->get('slug')), $date), true)->redirect();
    exit;
}
// Edit actions?
if (!Ansel_ActionHandler::editActions($actionID)) {
    $page_output->header(array('title' => $title));
    $form->renderActive($renderer, $vars, Horde::url('image.php'), 'post', 'multipart/form-data');
    $page_output->footer();
}