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


PHP Gallery类代码示例

本文整理汇总了PHP中Gallery的典型用法代码示例。如果您正苦于以下问题:PHP Gallery类的具体用法?PHP Gallery怎么用?PHP Gallery使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: load

 /**
  * Load your component.
  *
  * @param \Cx\Core\ContentManager\Model\Entity\Page $page       The resolved page
  */
 public function load(\Cx\Core\ContentManager\Model\Entity\Page $page)
 {
     global $_CORELANG, $subMenuTitle, $objTemplate;
     switch ($this->cx->getMode()) {
         case \Cx\Core\Core\Controller\Cx::MODE_FRONTEND:
             $objGallery = new Gallery(\Env::get('cx')->getPage()->getContent());
             \Env::get('cx')->getPage()->setContent($objGallery->getPage());
             $topGalleryName = $objGallery->getTopGalleryName();
             if ($topGalleryName) {
                 \Env::get('cx')->getPage()->setTitle($topGalleryName);
                 \Env::get('cx')->getPage()->setContentTitle($topGalleryName);
                 \Env::get('cx')->getPage()->setMetaTitle($topGalleryName);
             }
             break;
         case \Cx\Core\Core\Controller\Cx::MODE_BACKEND:
             $this->cx->getTemplate()->addBlockfile('CONTENT_OUTPUT', 'content_master', 'LegacyContentMaster.html');
             $objTemplate = $this->cx->getTemplate();
             \Permission::checkAccess(12, 'static');
             $subMenuTitle = $_CORELANG['TXT_GALLERY_TITLE'];
             $objGalleryManager = new GalleryManager();
             $objGalleryManager->getPage();
             break;
         default:
             break;
     }
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:31,代码来源:ComponentController.class.php

示例2: index

 /**
  * The gallery index handler.
  * 
  * @access public
  * @return string The HTML code.
  */
 public function index()
 {
     $Gallery = new Gallery();
     $params = array();
     $params[] = 'Type = ' . Gallery::GALLERY;
     $this->getView()->set('Galleries', $Gallery->findList($params, 'Position asc'));
     return $this->getView()->render();
 }
开发者ID:vosaan,项目名称:ankor.local,代码行数:14,代码来源:gallery.php

示例3: forceAlbum

function forceAlbum($success)
{
    // we presume that the site only serves the one album.
    $gallery = new Gallery();
    $albums = $gallery->getAlbums();
    $_GET['album'] = array_shift($albums);
    return $success;
}
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:8,代码来源:singleAlbum.php

示例4: index

 /**
  * The development index handler.
  * 
  * @access public
  * @return string The HTML code.
  */
 public function index()
 {
     $Gallery = new Gallery();
     $Award = new Award();
     $this->getView()->set('Gallery', $Gallery->findItem(array('Type = ' . Gallery::DEVELOPMENT)));
     $this->getView()->set('Patents', $Award->findList(array('Type = ' . Award::PATENT), 'Position asc'));
     return $this->getView()->render();
 }
开发者ID:vosaan,项目名称:ankor.local,代码行数:14,代码来源:development.php

示例5: _initFormForGallery

 function _initFormForGallery(&$form, $gallery_id)
 {
     require_once 'Modules/Gallery/Gallery.php';
     $dbcon =& AMP_Registry::getDbcon();
     $publish_item = new Gallery($dbcon, $gallery_id);
     $title = 'Photo Gallery: ' . $publish_item->getName();
     return $this->_initFormPublishItem($form, $publish_item, AMP_CONTENT_CLASS_DEFAULT, $title);
 }
开发者ID:radicaldesigns,项目名称:amp,代码行数:8,代码来源:ComponentMap.inc.php

示例6: delete

 function delete($cat_id, $id = FALSE)
 {
     if ($id) {
         $gallery = new Gallery($id);
         $gallery->delete_file($gallery->id, 'uploads/galleries/', 'image');
         $gallery->delete();
         set_notify('success', lang('delete_data_complete'));
     }
     redirect('galleries/admin/galleries/index/' . $cat_id);
 }
开发者ID:unisexx,项目名称:thaigcd2015,代码行数:10,代码来源:galleries.php

示例7: lamtech_preprocess_node

function lamtech_preprocess_node(&$vars)
{
    // kpr($vars);
    if (isset($vars['content']['field_category']) && count($vars['content']['field_category'])) {
        $vars['category'] = $vars['content']['field_category'][0];
        unset($vars['content']['field_category']);
    }
    $helper = NULL;
    switch ($vars['type']) {
        case 'cta':
            require_once DRUPAL_ROOT . '/' . drupal_get_path('theme', 'lamtech') . '/tpl/anb/cta/CTA.php';
            $helper = new CTA();
            $helper->preprocess($vars);
            break;
        case 'features_intro':
            require_once DRUPAL_ROOT . '/' . drupal_get_path('theme', 'lamtech') . '/tpl/anb/fi/FeaturesIntro.php';
            $helper = new FeaturesIntro();
            $helper->preprocess($vars);
            break;
        case 'gallery':
            require_once DRUPAL_ROOT . '/' . drupal_get_path('theme', 'lamtech') . '/tpl/anb/gallery/Gallery.php';
            $helper = new Gallery();
            $helper->preprocess($vars);
            break;
        case 'testimonials':
            require_once DRUPAL_ROOT . '/' . drupal_get_path('theme', 'lamtech') . '/tpl/anb/testimonials/Testimonials.php';
            $helper = new Testimonials();
            $helper->preprocess($vars);
            break;
        case 'hero':
            require_once DRUPAL_ROOT . '/' . drupal_get_path('theme', 'lamtech') . '/tpl/anb/hero/Hero.php';
            $helper = new Hero();
            $helper->preprocess($vars);
            break;
        case 'team':
            require_once DRUPAL_ROOT . '/' . drupal_get_path('theme', 'lamtech') . '/tpl/anb/team/Team.php';
            $helper = new Team();
            $helper->preprocess($vars);
            break;
        case 'statistic':
            require_once DRUPAL_ROOT . '/' . drupal_get_path('theme', 'lamtech') . '/tpl/anb/statistic/Statistic.php';
            $helper = new Statistic();
            $helper->preprocess($vars);
            break;
        case 'contact_info':
            require_once DRUPAL_ROOT . '/' . drupal_get_path('theme', 'lamtech') . '/tpl/anb/contact-info/ContactInfo.php';
            $helper = new ContactInfo();
            $helper->preprocess($vars);
            break;
        case 'advanced_page':
            unset($vars['content']['field_hide_title']);
            break;
    }
    // kpr($vars);
}
开发者ID:LamTechConsult,项目名称:lamtechsl,代码行数:55,代码来源:template.php

示例8: createAndUploadPhoto

	public function createAndUploadPhoto(Gallery $gallery, array $values, \Nette\Web\HttpUploadedFile $file)
	{
		if (!$file->isImage()) {
			throw new ValidationException("Soubor není obrázek.");
		}

		$photo = $this->createBlank();
		$this->update($photo, $values);
		$gallery->addPhoto($photo);
		@mkdir(pathinfo($photo->getFilePath(), PATHINFO_DIRNAME), 0777, true);
		$file->toImage()->resize($this->maxWidth, $this->maxHeight)->save($photo->getFilePath());
		$this->save($gallery);
	}
开发者ID:JanTvrdik,项目名称:Neuron,代码行数:13,代码来源:PhotoService.php

示例9: mod_gallery

/**
 * Функция вывода галереи
 *
 * @param string $gallery_id идентификатор галереи
 * и опционально количество изображений на странице
 */
function mod_gallery($gallery_id)
{
    global $AVE_Template;
    require_once BASE_DIR . '/modules/gallery/class.gallery.php';
    $gallery = new Gallery();
    $own_lim = @explode('-', stripslashes($gallery_id));
    $lim = empty($own_lim[1]) ? '' : $own_lim[1];
    $gallery_id = $own_lim[0];
    $tpl_dir = BASE_DIR . '/modules/gallery/templates/';
    $lang_file = BASE_DIR . '/modules/gallery/lang/' . $_SESSION['user_language'] . '.txt';
    $AVE_Template->config_load($lang_file);
    $gallery->galleryShow($tpl_dir, $gallery_id, $lim);
}
开发者ID:laiello,项目名称:avecms,代码行数:19,代码来源:modul.php

示例10: getList

 function getList($params = NULL, $proyection = '*', $order = '1', $limit = '')
 {
     if ($this->db != NULL) {
         $this->db->read($this->table, $proyection, $params);
         $r = array();
         while ($param = $this->db->getRow()) {
             $gallery = new Gallery();
             $gallery->set($param);
             $r[] = $gallery;
         }
         return $r;
     }
     return NULL;
 }
开发者ID:developdms,项目名称:Practica-5,代码行数:14,代码来源:ManagerGallery.php

示例11: synchronize

 /**
  * {@inheritdoc}
  */
 public function synchronize()
 {
     $this->pictures = array();
     $config = GalleryConfig::load();
     $Gallery = new Gallery();
     $result = PersistenceContext::get_querier()->select("SELECT g.id, g.name, g.path, g.width, g.height, g.idcat, gc.auth\n\t\tFROM " . GallerySetup::$gallery_table . " g\n\t\tLEFT JOIN " . GallerySetup::$gallery_cats_table . " gc on gc.id = g.idcat\n\t\tWHERE g.aprob = 1\n\t\tORDER BY RAND()\n\t\tLIMIT 30");
     while ($row = $result->fetch()) {
         $row['auth'] = $row['idcat'] == 0 ? $config->get_authorizations() : unserialize(stripslashes($row['auth']));
         //Calcul des dimensions avec respect des proportions.
         list($row['width'], $row['height']) = $Gallery->get_resize_properties($row['width'], $row['height']);
         $this->pictures[$row['id']] = $row;
     }
     $result->dispose();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:17,代码来源:GalleryMiniMenuCache.class.php

示例12: email_new_user_save

function email_new_user_save($savemsg, $userobj, $what)
{
    global $_zp_authority;
    if ($what == 'new' && ($mail = $userobj->getEmail())) {
        $gallery = new Gallery();
        $ref = $_zp_authority->getResetTicket($adm = $userobj->getUser(), $userobj->getPass());
        $msg = "\n" . sprintf(gettext('You are receiving this e-mail because a user code (%1$s) has been created for you on the Zenphoto gallery %2$s.'), $adm, $gallery->getTitle()) . "\n" . sprintf(gettext('To set your Zenphoto User password visit: %s'), FULLWEBPATH . "/" . ZENFOLDER . "/admin-users.php?ticket={$ref}&user={$adm}") . "\n" . gettext("This ticket will automatically expire in 3 days.");
        $err_msg = zp_mail(gettext("The Zenphoto user created"), $msg, array($mail));
        if (!empty($err_msg)) {
            $savemsg .= $err_msg;
        }
    }
    return $savemsg;
}
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:14,代码来源:email-newuser.php

示例13: uploadPhoto

 public function uploadPhoto(Gallery $gallery, array $values, \Nette\Web\HttpUploadedFile $file)
 {
     if (!$file->isImage()) {
         throw new \Neuron\Model\ValidationException("File is not image.");
     }
     // save image
     $image = $file->toImage()->resize($this->maxWidth, $this->maxHeight);
     $values['hash'] = $this->repository->save((string) $image);
     // save entity
     $em = $this->getEntityManager();
     $photo = new Photo($values);
     $em->persist($photo);
     $gallery->addPhoto($photo);
     $em->flush();
 }
开发者ID:janmarek,项目名称:Neuron,代码行数:15,代码来源:PhotoService.php

示例14: actionShow

 public function actionShow($id)
 {
     $model = Gallery::model()->findByPk((int) $id);
     if (is_null($model)) {
         throw new CHttpException(404, Yii::t('gallery', 'Страница не найдена!'));
     }
     $image = new Image();
     if (Yii::app()->request->isPostRequest && isset($_POST['Image'])) {
         $transaction = Yii::app()->db->beginTransaction();
         try {
             $image = $image->create($_POST['Image']);
             if (!$image->hasErrors()) {
                 if ($model->addImage($image)) {
                     Yii::app()->user->setFlash(YFlashMessages::NOTICE_MESSAGE, Yii::t('gallery', 'Фотография добавлена!'));
                 }
                 $transaction->commit();
                 $this->redirect(array('/gallery/gallery/show/', 'id' => $model->id));
             }
             throw new CDbException(Yii::t('gallery', 'При добавлении изображения произошла ошибка!'));
         } catch (Exception $e) {
             $transaction->rollback();
             Yii::app()->user->setFlash(YFlashMessages::ERROR_MESSAGE, Yii::t('gallery', $e->getMessage()));
         }
     }
     $dataProvider = new CActiveDataProvider('ImageToGallery', array('criteria' => array('condition' => 'galleryId = :galleryId', 'params' => array(':galleryId' => $model->id), 'limit' => self::GALLERY_PER_PAGE, 'order' => 't.creation_date DESC', 'with' => 'image'), 'pagination' => array('pageSize' => self::GALLERY_PER_PAGE)));
     $this->render('show', array('image' => $image, 'model' => $model, 'dataProvider' => $dataProvider));
 }
开发者ID:RSol,项目名称:yupe,代码行数:27,代码来源:GalleryController.php

示例15: generate_data_for_day

 private static function generate_data_for_day(SS_Datetime $date)
 {
     $data = array('timestamp' => time(), 'searchDate' => $date->Format("Y-m-d"), 'collections' => array('events' => array(), 'galleries' => array(), 'locations' => array()));
     $galleryIDs = array();
     $locationIDs = array();
     // Get events
     $where = sprintf("DATE(`StartDate`) = '%s'", $date->Format('Y-m-d'));
     $events = Event::get()->where($where)->exclude(array("GalleryID" => 0, "Gallery.LocationID" => 0));
     foreach ($events as $event) {
         $galleryIDs[] = $event->GalleryID;
         $data['collections']['events'][] = $event->forAPI();
     }
     // Get galleries
     $galleries = Gallery::get()->byIDs(array_unique($galleryIDs));
     foreach ($galleries as $gallery) {
         $locationIDs[] = $gallery->LocationID;
         $data['collections']['galleries'][] = $gallery->forAPI();
     }
     // Get locations
     $locations = Location::get()->byIDs(array_unique($locationIDs));
     foreach ($locations as $location) {
         $data['collections']['locations'][] = $location->forAPI();
     }
     return $data;
 }
开发者ID:ehyland,项目名称:some-painter-cms,代码行数:25,代码来源:EventsDataUtil.php


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