Source of file GalleryItem.php
Size: 1,278 Bytes - Last Modified: 2021-12-23T10:10:21+00:00
/var/www/docs.ssmods.com/process/src/code/models/GalleryItem.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 | <?php /** * Gallery Item * * @package plato-silverstripe-gallery */ class GalleryItem extends DataObject { /** * @var string */ private static $default_sort = "Sort"; /** * @var array */ private static $db = array( "Title" => "Varchar(255)", "VideoURL" => "Varchar(255)", "Sort" => "Int" ); /** * @var array */ private static $has_one = array( "GalleryPage" => "GalleryPage", "Image" => "Image" ); /** * @var array */ private static $summary_fields = array( "Title" => "Title", "Image.CMSThumbnail" => "Image" ); /** * @return FieldList */ public function getCMSFields() { $fields = new FieldList( TextField::create('Title', 'Title')->setDescription("Title of the gallery item"), UploadField::create('Image', 'Image')->setFolderName("GalleryItems") ); if (Config::inst()->get('GalleryPage', 'VideoAllowed')) { $fields->push( TextField::create("VideoURL", "Video URL") ->setAttribute("placeholder", "http://") ->setDescription("You may use Youtube OR Vimeo URLs") ); } return $fields; } } |