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


PHP Gallery::get方法代码示例

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


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

示例1: createNewEvent

 public function createNewEvent($writeUpdate = true)
 {
     $models = $this->createModels();
     $location = Location::create_from_string($this->location);
     // Check for existing gallery
     $existingGallery = Gallery::get()->filter(array('Location.PlaceID' => $location->PlaceID))->first();
     // If existing gallery, don't create a new one
     if ($existingGallery) {
         $location = $existingGallery->Location();
         $models['Gallery'] = $existingGallery;
     } else {
         // Write location to database
         $location->write();
         // Write gallery to database
         $models['Gallery']->update(array('LocationID' => $location->ID))->write();
     }
     // Write event to database
     $models['Event']->update(array('GalleryID' => $models['Gallery']->ID))->write();
     // Link event
     $this->update(array('EventID' => $models['Event']->ID, 'State' => 'Merged'));
     if ($writeUpdate) {
         $this->write();
     }
     return $this->Event();
 }
开发者ID:ehyland,项目名称:some-painter-cms,代码行数:25,代码来源:GoogleCalendarEvent.php

示例2: 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

示例3: getGallery

 public function getGallery()
 {
     $params = $this->getURLParams();
     $galleryID = (int) $params['ID'];
     $gallery = Gallery::get()->filter(array('ID' => $galleryID))->first();
     return $this->renderWith('Gallery', $gallery);
 }
开发者ID:silverstripe-europe-meetup,项目名称:website-2015,代码行数:7,代码来源:Page.php

示例4: getCMSFields

 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName('EventSource');
     // galleries field
     $galleries = function () {
         return Gallery::get()->map('ID', 'Title');
     };
     $galleryField = DropdownField::create('GalleryID', 'Gallery', $galleries());
     $galleryField->useAddNew('Gallery', $galleries);
     if ($this->GalleryID) {
         $galleryField->setDescription($this->Gallery()->getDataAdminEditAnchorTag());
     }
     // add fields to tab
     $fields->addFieldsToTab('Root.Main', array($galleryField));
     return $fields;
 }
开发者ID:ehyland,项目名称:some-painter-cms,代码行数:17,代码来源:Event.php

示例5: getCMSFields

 public function getCMSFields()
 {
     $f = parent::getCMSFields();
     $galleries = Gallery::get();
     $f->addFieldToTab('Root.Main', HTMLEditorField::create('BannerTitle', 'BannerTitle'));
     $f->addFieldToTab('Root.Main', TextField::create('BannerText', 'Banner Text'));
     $f->addFieldToTab('Root.Main', TextField::create('WhyChooseTitle', 'Why Choose Title'));
     $f->addFieldToTab('Root.Main', TextareaField::create('WhyChooseText', 'Why Choose Text'));
     $f->addFieldToTab('Root.Main', TextField::create('WhyChooseLink', 'Why Choose Link'));
     $f->addFieldToTab('Root.Main', UploadField::create('EricImage', 'Erics Image'));
     $f->addFieldToTab('Root.Main', TextField::create('OurTeamTitle', 'Team Title'));
     $f->addFieldToTab('Root.Main', TextareaField::create('OurTeamText', 'Team Text'));
     $f->addFieldToTab('Root.Main', TextField::create('OurTeamLink', 'Team Link'));
     $f->addFieldToTab('Root.Main', TextField::create('AdvantageLink', 'Advantage Link'));
     $f->addFieldToTab('Root.Main', TextField::create('AdvantageTitle', 'Advantage Title'));
     $f->addFieldToTab('Root.Main', TextareaField::create('AdvantageText', 'Advantage Text'));
     $f->addFieldToTab('Root.Main', TextField::create('AdvantageLink', 'Advantage Link'));
     $f->addFieldToTab('Root.Featured', TextField::create('FeatPropTitle', 'Featured Property Title'));
     $f->addFieldToTab('Root.Featured', TextField::create('ShowHomeLink', 'Show Home Link'));
     $f->addFieldToTab('Root.Featured', UploadField::create('ShowHomeImage', 'Show Home Image'));
     $f->addFieldToTab('Root.Featured', TextField::create('ShowHomeBtn', 'Show Home Button'));
     $f->addFieldToTab('Root.Featured', UploadField::create('PlanImage', 'Plan Image'));
     $f->addFieldToTab('Root.Featured', TextField::create('FloorPlanLink', 'Floor Plan Link'));
     $f->addFieldToTab('Root.Featured', TextField::create('FloorPlanBtn', 'Floor Plan Button'));
     $f->addFieldToTab('Root.Featured', UploadField::create('QuoteImage', 'Quote Image'));
     $f->addFieldToTab('Root.Featured', TextField::create('QuoteLink', 'Quote Link'));
     $f->addFieldToTab('Root.Featured', TextField::create('QuoteBtn', 'Quote Button'));
     $f->addFieldToTab('Root.Ideas', TextField::create('IdeasTitle', 'Ideas Title'));
     $f->addFieldToTab('Root.Ideas', UploadField::create('Idea1Image', 'Idea 1 Image'));
     $f->addFieldToTab('Root.Ideas', DropdownField::create('Ideas1Link')->setTitle('Ideas 1 Gallery')->setSource($galleries->map()));
     $f->addFieldToTab('Root.Ideas', TextField::create('Ideas1Btn', 'Idea 1 Button'));
     $f->addFieldToTab('Root.Ideas', UploadField::create('Idea2Image', 'Idea 2 Image'));
     $f->addFieldToTab('Root.Ideas', DropdownField::create('Ideas2Link')->setTitle('Ideas 2 Gallery')->setSource($galleries->map()));
     $f->addFieldToTab('Root.Ideas', TextField::create('Ideas2Btn', 'Idea 2 Button'));
     $f->addFieldToTab('Root.Ideas', UploadField::create('Idea3Image', 'Idea 3 Image'));
     $f->addFieldToTab('Root.Ideas', TextField::create('Ideas3Btn', 'Idea 3 Button'));
     $f->addFieldToTab('Root.Ideas', DropdownField::create('Ideas3Link')->setTitle('Ideas 3 Gallery')->setSource($galleries->map()));
     $f->addFieldToTab('Root.Ideas', UploadField::create('Idea4Image', 'Idea 4 Image'));
     $f->addFieldToTab('Root.Ideas', TextField::create('Ideas4Btn', 'Idea 4 Button'));
     $f->addFieldToTab('Root.Ideas', DropdownField::create('Ideas4Link')->setTitle('Ideas 4 Gallery')->setSource($galleries->map()));
     $banners = BannerImage::get()->sort('Position ASC');
     $f->addFieldToTab('Root.Banners', new GridField('BannerGrid', 'Banners', $banners, GridFieldConfig_RelationEditor::create()));
     return $f;
 }
开发者ID:prostart,项目名称:erics-homes,代码行数:44,代码来源:HomePage.php

示例6: getCMSFields

 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     if ($this->isLocked()) {
         return $fields;
     }
     $gallerySource = function () {
         return Gallery::get()->map()->toArray();
     };
     $fields->addFieldsToTab('Root.Main', array(LiteralField::create('Instructions', '<p>To create the the event, set the status to approved and click save</p>'), TextField::create('ArtistName'), $this->obj('StartDate')->scaffoldFormField(), $this->obj('EndDate')->scaffoldFormField(), CheckboxField::create('HasFreeDrinks'), DropdownField::create('GalleryID', 'Gallery', $gallerySource())->setEmptyString('(Find or create gallery)')->useAddNew('Gallery', $gallerySource)));
     // Add user submitted fields as readonly
     $fields->addFieldToTab('Root.Main', HeaderField::create('UserSubmittedHeader', 'User Submitted Data'));
     foreach (self::$db as $key => $type) {
         if (strpos($key, 'UserSubmitted') !== 0) {
             continue;
         }
         $fields->addFieldToTab('Root.Main', ReadonlyField::create($key));
     }
     return $fields;
 }
开发者ID:ehyland,项目名称:some-painter-cms,代码行数:20,代码来源:UserSubmittedEvent.php

示例7: array

        return Redirect::to('/admin/category/add');
    });
    Route::post('/add', array('uses' => 'RainGalleryContent@postAddNewCategory'));
});
// Admin Panel | photogallery
Route::group(array('before' => 'admin.login', 'prefix' => 'admin/photogallery'), function () {
    # Admin Add photo
    Route::get('/add', function () {
        $user = Sentry::getUser();
        return View::make('backend.photoadd')->with('edit', false)->with('editData', [])->with('user', $user);
    });
    Route::post('/add', array('uses' => 'RainGalleryContent@postAddNewImage'));
    # Admin List photo
    Route::get('/list', function () {
        $user = Sentry::getUser();
        $galleryImages = Gallery::get();
        return View::make('backend.photolist')->with('user', $user)->with('galleryimg', $galleryImages);
    });
    # Admin Edit category
    Route::get('/edit/{id}', function ($id) {
        $user = Sentry::getUser();
        $editVarsdata = Gallery::find($id);
        return View::make('backend.photoadd')->with('edit', true)->with('editData', $editVarsdata)->with('user', $user);
    });
    Route::get('/delete/{id}', function ($id) {
        $user = Sentry::getUser();
        $getDelData = Gallery::find($id);
        if ($getDelData) {
            $getDelData->delete();
        }
        return Redirect::to('/admin/photogallery/list');
开发者ID:arizawan,项目名称:chaity.com,代码行数:31,代码来源:routes.php

示例8: Galleries

 public function Galleries()
 {
     return Gallery::get()->sort('Position ASC');
 }
开发者ID:prostart,项目名称:erics-homes,代码行数:4,代码来源:IdeasPage.php

示例9: strip_tags

header('Content-Type: application/xml');
$rssmode = getRSSAlbumsmode();
$albumfolder = getRSSAlbumnameAndCollection("albumfolder");
$collection = getRSSAlbumnameAndCollection("collection");
$albumname = getRSSAlbumTitle();
$albumpath = getRSSImageAndAlbumPaths("albumpath");
$imagepath = getRSSImageAndAlbumPaths("imagepath");
$size = getRSSImageSize();
$items = getOption('feed_items');
// # of Items displayed on the feed
$gallery = new Gallery();
?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title><?php 
echo strip_tags(get_language_string($gallery->get('gallery_title'), $locale)) . ' ' . strip_tags($albumname);
?>
</title>
<link><?php 
echo $protocol . "://" . $host . WEBPATH;
?>
</link>
<atom:link href="<?php 
echo $protocol;
?>
://<?php 
echo html_encode($_SERVER["HTTP_HOST"]);
echo html_encode($_SERVER["REQUEST_URI"]);
?>
" rel="self"	type="application/rss+xml" />
<description><?php 
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:31,代码来源:rss.php

示例10: insert

 function insert(Gallery $imagen)
 {
     return $this->bd->insert($this->tabla, $imagen->get());
 }
开发者ID:ealvarez1990,项目名称:galeriaarte,代码行数:4,代码来源:ManageGallery.php

示例11: getTitle

    require_once 'includes/classes/User.php';
    $ADK_USER = new User();
    $ADK_USER->id = $ADK_USER_ID;
    $ADK_USER->get($con);
    $ADK_HIKES = new Hikes();
    $ADK_HIKES->userid = $ADK_USER_ID;
    $ADK_HIKES->get($con);
}
$ADK_PEAKS = new Peaks();
$ADK_PEAKS->get($con);
$ADK_GALLERY = new Gallery();
$ADK_GALLERY->userid = $ADK_USER_ID;
if ($ADK_USERGROUP_CDE === 'COR') {
    $ADK_GALLERY->corrid = $_SESSION['ADK_USER_ID'];
}
$ADK_GALLERY->get($con);
if ($ADK_USERGROUP_CDE !== 'HIK') {
    require_once 'includes/classes/Hiker.php';
    $ADK_HIKERS = new Hikers();
    $ADK_HIKERS->get($con, $ADK_USERGROUP_CDE === 'COR' ? $_SESSION['ADK_USER_ID'] : '%');
}
$con->close();
function getTitle($photo)
{
    $title = $photo->name;
    if ($photo->peaks != '') {
        $title .= "\n" . $photo->peaks;
    }
    if ($photo->username != '') {
        $title .= "\n" . $photo->username;
    }
开发者ID:neilsimp1,项目名称:adk,代码行数:31,代码来源:gallery.inc.php

示例12: strip_tags

$id = getRSSID();
$title = getRSSTitle();
if (!empty($title)) {
    $title = " - " . html_encode($title);
}
$type = getRSSType();
$albumpath = getRSSImageAndAlbumPaths("albumpath");
$imagepath = getRSSImageAndAlbumPaths("imagepath");
$items = getOption('feed_items');
// # of Items displayed on the feed
$gallery = new Gallery();
?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title><?php 
echo strip_tags(get_language_string($gallery->get('gallery_title'), $locale)) . $title . gettext(' (latest comments)');
?>
</title>
<link><?php 
echo $protocol . "://" . $host . WEBPATH;
?>
</link>
<atom:link href="<?php 
echo $protocol;
?>
://<?php 
echo html_encode($_SERVER["HTTP_HOST"]);
echo html_encode($_SERVER["REQUEST_URI"]);
?>
" rel="self"	type="application/rss+xml" />
<description><?php 
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:31,代码来源:rss-comments.php

示例13: zp_mail

/**
 * Send an mail to the mailing list. We also attempt to intercept any form injection
 * attacks by slime ball spammers. Returns error message if send failure.
 *
 * @param string $subject  The subject of the email.
 * @param string $message  The message contents of the email.
 * @param string $from_mail Optional sender for the email.
 * @param string $from_name Optional sender for the name.
 * @param array $email_list a list of email addresses
 * @param array $cc_addresses a list of addresses to send copies to.
 * @param array $bcc_addresses a list of addresses to send blind copies to.
 *
 * @return string
 *
 * @author Todd Papaioannou (lucky@luckyspin.org)
 * @since  1.0.0
 */
function zp_mail($subject, $message, $email_list = NULL, $cc_addresses = NULL, $bcc_addresses = NULL)
{
    global $_zp_authority;
    $gallery = new Gallery();
    $result = '';
    if (is_null($email_list)) {
        $email_list = $_zp_authority->getAdminEmail();
    } else {
        foreach ($email_list as $key => $email) {
            if (!is_valid_email_zp($email)) {
                unset($email_list[$key]);
                if (empty($result)) {
                    $result = gettext('Mail send failed.');
                }
                $result .= ' ' . sprintf(gettext('Invalid "to" mail address %s.'), $email);
            }
        }
    }
    if (is_null($cc_addresses)) {
        $cc_addresses = array();
    } else {
        if (empty($email_list) && !empty($cc_addresses)) {
            if (empty($result)) {
                $result = gettext('Mail send failed.');
            }
            $result .= ' ' . gettext('"cc" list provided without "to" address list.');
            return $result;
        }
        foreach ($cc_addresses as $key => $email) {
            if (!is_valid_email_zp($email)) {
                unset($cc_addresses[$key]);
                if (empty($result)) {
                    $result = gettext('Mail send failed.');
                }
                $result = ' ' . sprintf(gettext('Invalid "cc" mail address %s.'), $email);
            }
        }
    }
    if (is_null($bcc_addresses)) {
        $bcc_addresses = array();
    } else {
        foreach ($bcc_addresses as $key => $email) {
            if (!is_valid_email_zp($email)) {
                unset($bcc_addresses[$key]);
                if (empty($result)) {
                    $result = gettext('Mail send failed. ');
                }
                $result = ' ' . sprintf(gettext('Invalid "bcc" mail address %s.'), $email);
            }
        }
    }
    if (count($email_list) + count($bcc_addresses) > 0) {
        if (zp_has_filter('sendmail')) {
            // Make sure no one is trying to use our forms to send Spam
            // Stolen from Hosting Place:
            //   http://support.hostingplace.co.uk/knowledgebase.php?action=displayarticle&cat=0000000039&id=0000000040
            $badStrings = array("Content-Type:", "MIME-Version:", "Content-Transfer-Encoding:", "bcc:", "cc:");
            foreach ($_POST as $k => $v) {
                foreach ($badStrings as $v2) {
                    if (strpos($v, $v2) !== false) {
                        header("HTTP/1.0 403 Forbidden");
                        header("Status: 403 Forbidden");
                        die("Forbidden");
                        exit;
                    }
                }
            }
            foreach ($_GET as $k => $v) {
                foreach ($badStrings as $v2) {
                    if (strpos($v, $v2) !== false) {
                        header("HTTP/1.0 403 Forbidden");
                        header("Status: 403 Forbidden");
                        die("Forbidden");
                        exit;
                    }
                }
            }
            $from_mail = getOption('site_email');
            $from_name = get_language_string($gallery->get('gallery_title'), getOption('locale'));
            // Convert to UTF-8
            if (LOCAL_CHARSET != 'UTF-8') {
                $subject = $_zp_UTF8->convert($subject, LOCAL_CHARSET);
                $message = $_zp_UTF8->convert($message, LOCAL_CHARSET);
//.........这里部分代码省略.........
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:101,代码来源:functions.php

示例14: html_encode

?>
</title>
<link><?php 
echo $protocol . "://" . $host . WEBPATH;
?>
</link>
<atom:link href="<?php 
echo $protocol;
?>
://<?php 
echo html_encode($_SERVER["HTTP_HOST"]);
echo html_encode($_SERVER["REQUEST_URI"]);
?>
" rel="self" type="application/rss+xml" />
<description><?php 
echo html_encode(strip_tags(get_language_string($gallery->get('Gallery_description'), $locale)));
?>
</description>
<language><?php 
echo $validlocale;
?>
</language>
<pubDate><?php 
echo date("r", time());
?>
</pubDate>
<lastBuildDate><?php 
echo date("r", time());
?>
</lastBuildDate>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:31,代码来源:rss-news.php

示例15: insert

 function insert(Gallery $param)
 {
     $parametros = $param->get();
     return $this->db->insert($this->table, $parametros, false);
 }
开发者ID:developdms,项目名称:Practica-5,代码行数:5,代码来源:ManagerGallery.php


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