当前位置: 首页>>代码示例>>PHP>>正文


PHP Ansel::downloadImagesAsZip方法代码示例

本文整理汇总了PHP中Ansel::downloadImagesAsZip方法的典型用法代码示例。如果您正苦于以下问题:PHP Ansel::downloadImagesAsZip方法的具体用法?PHP Ansel::downloadImagesAsZip怎么用?PHP Ansel::downloadImagesAsZip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ansel的用法示例。


在下文中一共展示了Ansel::downloadImagesAsZip方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: galleryActions

 public static function galleryActions($actionID)
 {
     global $registry, $notification, $page_output;
     if (self::download($actionID)) {
         return true;
     }
     $ansel_storage = $GLOBALS['injector']->getInstance('Ansel_Storage');
     switch ($actionID) {
         case 'add':
         case 'addchild':
         case 'save':
         case 'modify':
             $view = new Ansel_View_GalleryProperties(array('actionID' => $actionID, 'url' => new Horde_Url(Horde_Util::getFormData('url')), 'gallery' => Horde_Util::getFormData('gallery')));
             $view->run();
             exit;
         case 'downloadzip':
             $galleryId = Horde_Util::getFormData('gallery');
             try {
                 $gallery = $ansel_storage->getGallery($galleryId);
                 if (!$registry->getAuth() || !$gallery->hasPermission($registry->getAuth(), Horde_Perms::READ)) {
                     $notification->push(_("Access denied downloading photos from this gallery."), 'horde.error');
                     Horde::url('view.php?view=List', true)->redirect();
                     exit;
                 }
                 Ansel::downloadImagesAsZip($gallery);
             } catch (Ansel_Exception $e) {
                 $notification->push($gallery->getMessage(), 'horde.error');
                 Horde::url('view.php?view=List', true)->redirect();
                 exit;
             }
             exit;
         case 'delete':
         case 'empty':
             // Print the confirmation screen.
             $galleryId = Horde_Util::getFormData('gallery');
             if ($galleryId) {
                 try {
                     $gallery = $ansel_storage->getGallery($galleryId);
                     $page_output->header();
                     $notification->notify(array('listeners' => 'status'));
                     require ANSEL_TEMPLATES . '/gallery/delete_confirmation.inc';
                     $page_output->footer();
                     exit;
                 } catch (Ansel_Exception $e) {
                     $notification->push($gallery->getMessage(), 'horde.error');
                 }
             }
             // Return to the gallery list.
             Horde::url(Ansel::getUrlFor('view', array('view' => 'List'), true))->redirect();
             exit;
         case 'do_delete':
         case 'do_empty':
             $ansel_storage = $GLOBALS['injector']->getInstance('Ansel_Storage');
             $galleryId = Horde_Util::getPost('gallery');
             try {
                 $gallery = $ansel_storage->getGallery($galleryId);
             } catch (Ansel_Exception $e) {
                 $notification->push($e->getMessage(), 'horde.error');
                 Ansel::getUrlFor('default_view', array())->redirect();
                 exit;
             }
             switch ($actionID) {
                 case 'do_delete':
                     if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::DELETE)) {
                         $notification->push(_("Access denied deleting this gallery."), 'horde.error');
                     } else {
                         try {
                             $ansel_storage->removeGallery($gallery);
                             $notification->push(sprintf(_("Successfully deleted %s."), $gallery->get('name')), 'horde.success');
                         } catch (Ansel_Exception $e) {
                             $notification->push(sprintf(_("There was a problem deleting %s: %s"), $gallery->get('name'), $e->getMessage()), 'horde.error');
                         } catch (Horde_Exception_NotFound $e) {
                             Horde::log($e, 'err');
                         }
                     }
                     // Return to the default view.
                     Ansel::getUrlFor('default_view', array())->redirect();
                     exit;
                 case 'do_empty':
                     if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::DELETE)) {
                         $notification->push(_("Access denied deleting this gallery."), 'horde.error');
                     } else {
                         $ansel_storage->emptyGallery($gallery);
                         $notification->push(sprintf(_("Successfully emptied \"%s\""), $gallery->get('name')), 'horde.success');
                     }
                     Ansel::getUrlFor('view', array('view' => 'Gallery', 'gallery' => $galleryId, 'slug' => $gallery->get('slug')), true)->redirect();
                     exit;
                 default:
                     Ansel::getUrlFor('view', array('view' => 'Gallery', 'gallery' => $galleryId, 'slug' => $gallery->get('slug')), true)->redirect();
                     exit;
             }
         case 'generateDefault':
             // Re-generate the default pretty gallery image.
             $galleryId = Horde_Util::getFormData('gallery');
             try {
                 $gallery = $ansel_storage->getGallery($galleryId);
                 $gallery->clearStacks();
                 $notification->push(_("The gallery's default photo has successfully been reset."), 'horde.success');
                 Horde::url('view.php', true)->add('gallery', $galleryId)->redirect();
                 exit;
//.........这里部分代码省略.........
开发者ID:raz0rsdge,项目名称:horde,代码行数:101,代码来源:ActionHandler.php


注:本文中的Ansel::downloadImagesAsZip方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。