function getCMSFields()
 {
     $fields = parent::getCMSFields();
     //People
     $videoTable = new DataObjectManager($this, 'Video', 'Video', array('VideoName' => 'Name', 'URL' => 'URL'), 'getCMSFields_forPopup');
     $videoTable->setAddTitle('Video');
     $fields->addFieldToTab('Root.Content.Video', $videoTable);
     $fields->addFieldToTab('Root.Content.Layout', new CheckboxField('Bottom', 'Display playlist at the bottom'));
     $fields->addFieldToTab("Root.Content.Layout", new TextField("BackgroundColour", 'Hex colour code for Background Colour', '', 7));
     $fields->addFieldToTab("Root.Content.Layout", new TextField("TextColour", 'Hex colour code for Text Colour', '', 7));
     return $fields;
 }
 public function getCMSFields($cms)
 {
     $configuration = _t('ImageGalleryPage.CONFIGURATION', 'Configuration');
     $albums = _t('ImageGalleryPage.ALBUMS', 'Albums');
     $photos = _t('ImageGalleryPage.PHOTOS', 'Photos');
     $f = parent::getCMSFields($cms);
     $f->addFieldToTab("Root.Content.{$configuration}", new HeaderField($title = _t('ImageGalleryPage.ALBUMCOVERIMAGES', 'Album cover images'), $headingLevel = "6"));
     $f->addFieldToTab("Root.Content.{$configuration}", new FieldGroup(new NumericField('CoverImageWidth', 'Width'), new NumericField('CoverImageHeight', 'Height')));
     $f->addFieldToTab("Root.Content.{$configuration}", new NumericField('ThumbnailSize', _t('ImageGalleryPage.THUMBNAILHEIGHT', 'Thumbnail height (pixels)')));
     $f->addFieldToTab("Root.Content.{$configuration}", new CheckboxField('Square', _t('ImageGalleryPage.CROPTOSQUARE', 'Crop thumbnails to square')));
     $f->addFieldToTab("Root.Content.{$configuration}", new NumericField('MediumSize', _t('ImageGalleryPage.MEDIUMSIZE', 'Medium size (pixels)')));
     $f->addFieldToTab("Root.Content.{$configuration}", new NumericField('NormalSize', _t('ImageGalleryPage.NORMALSIZE', 'Normal width (pixels)')));
     $f->addFieldToTab("Root.Content.{$configuration}", new NumericField('NormalHeight', _t('ImageGalleryPage.NORMALHEIGHT', 'Normal height (pixels)')));
     $f->addFieldToTab("Root.Content.{$configuration}", new NumericField('MediaPerPage', _t('ImageGalleryPage.IMAGESPERPAGE', 'Number of images per page')));
     $popup_map = array();
     if ($ui_list = ClassInfo::subclassesFor("ImageGalleryUI")) {
         foreach ($ui_list as $ui) {
             if ($ui != "ImageGalleryUI") {
                 $ui_label = eval("return {$ui}::\$label;");
                 $demo_url = eval("return {$ui}::\$link_to_demo;");
                 $demo_link = !empty($demo_url) ? sprintf('<a href="%s" target="_blank">%s</a>', $demo_url, _t('ImageGalleryPage.VIEWDEMO', 'view demo')) : "";
                 $popup_map[$ui] = $ui_label . " " . $demo_link;
             }
         }
     }
     $f->addFieldToTab("Root.Content.{$configuration}", new OptionsetField('GalleryUI', _t('ImageGalleryPage.POPUPSTYLE', 'Popup style'), $popup_map));
     $f->addFieldToTab("Root.Content.{$configuration}", new NumericField('UploadLimit', _t('ImageGalleryPage.MAXFILES', 'Max files allowed in upload queue')));
     if ($this->RootFolderID) {
         $manager = new DataObjectManager($this, 'Albums', $this->albumClass, array('AlbumName' => _t('ImageGalleryAlbum.ALBUMNAME', 'Album Name'), 'Description' => _t('ImageGalleryAlbum.DESCRIPTION', 'Description')), 'getCMSFields_forPopup', "ImageGalleryPageID = {$this->ID}");
         $manager->setAddTitle(_t('ImageGalleryPage.ANALBUM', 'an Album'));
         $manager->setSingleTitle(_t('ImageGalleryPage.ALBUM', 'Album'));
         $manager->setParentClass('ImageGalleryPage');
         $f->addFieldToTab("Root.Content.{$albums}", $manager);
     } else {
         $f->addFieldToTab("Root.Content.{$albums}", new HeaderField($title = _t("ImageGalleryPage.ALBUMSNOTSAVED", "You may add albums to your gallery once you have saved the page for the first time."), $headingLevel = "3"));
     }
     if ($this->RootFolderID && $this->Albums()->Count() > 0) {
         $manager = new ImageGalleryManager($this, 'GalleryItems', $this->itemClass, 'Image', array('Caption' => _t('ImageGalleryItem.CAPTION', 'Caption')), 'getCMSFields_forPopup');
         $manager->setPluralTitle(_t('ImageGalleryPage.IMAGES', 'Images'));
         $manager->setParentClass("ImageGalleryPage");
         if ($this->UploadLimit) {
             $manager->setUploadLimit($this->UploadLimit);
         }
         $f->addFieldToTab("Root.Content.{$photos}", $manager);
     } elseif (!$this->RootFolderID) {
         $f->addFieldToTab("Root.Content.{$photos}", new HeaderField($title = _t("ImageGalleryPage.PHOTOSNOTSAVED", "You may add photos to your gallery once you have saved the page for the first time."), $headingLevel = "3"));
     } elseif ($this->Albums()->Count() == 0) {
         $f->addFieldToTab("Root.Content.{$photos}", new HeaderField($title = _t("ImageGalleryPage.NOALBUMS", "You have no albums. Click on the Albums tab to create at least one album before adding photos."), $headingLevel = "3"));
     }
     return $f;
 }
 public function getAnnouncementTable($calendarID)
 {
     $this->extendAnnouncement();
     $table = new DataObjectManager($this->getEventObject()->Parent(), 'Announcements', $this->class, $this->getAnnouncementTitles(), $this->getAnnouncementFields());
     $table->setAddTitle("Announcement");
     $table->setParentClass("Calendar");
     return $table;
 }
 public function getCMSFields()
 {
     $datetimeObj = $this->getEventDateTimeObject();
     $f = parent::getCMSFields();
     $configuration = _t('Calendar.CONFIGURATION', 'Configuration');
     $f->addFieldsToTab("Root.Content.{$configuration}", array(new NumericField('DefaultEventDisplay', _t('Calendar.NUMBEROFEVENTS', 'Number of events to display on default view.')), new TextField('DefaultDateHeader', _t('Calendar.DEFAULTDATEHEADER', 'Default date header (displays when no date range has been selected)')), new NumericField('OtherDatesCount', _t('Calendar.NUMBERFUTUREDATES', 'Number of future dates to show for repeating events'))));
     $table = $this->getEventDateTimeObject()->getAnnouncementTable($this->ID);
     $announcements = _t('Calendar.Announcements', 'Announcements');
     $f->addFieldToTab("Root.Content.{$announcements}", $table);
     $table = new DataObjectManager($this, 'Feeds', 'ICSFeed', array('Title' => 'Title of Feed', 'URL' => 'URL'), 'getCMSFields_forPopup');
     $table->setAddTitle(_t('Calendar.ICSFEED', 'ICS Feed'));
     $table->setParentClass("Calendar");
     $feeds = _t('Calendar.FEEDS', 'Feeds');
     $f->addFieldToTab("Root.Content.{$feeds}", $table);
     return $f;
 }