public static function getUploadForm($file, $parentClass, $parentId, $parentField)
 {
     if ($file instanceof File && class_exists($parentClass) && is_subclass_of($parentClass, "DataObject")) {
         $parent = $parentClass::get()->byId($parentId);
         $fields = new FieldList($uploadField = new UploadField($parentField, 'Upload', $parent));
         $uploadField->setCanAttachExisting(false);
         // Block access to Silverstripe assets library
         $uploadField->setCanPreviewFolder(false);
         // Don't show target filesystem folder on upload field
         $uploadField->relationAutoSetting = false;
         // Prevents the form thinking the GalleryPage is the underlying object
         $uploadField->setFolderName('Address Book');
         $uploadField->setAllowedMaxFileNumber(1);
         if ($file instanceof Image) {
             $uploadField->setAllowedFileCategories('image');
         }
         $actions = new FieldList(new FormAction('submit', 'Save'));
         $from = new Form(Controller::curr(), 'feFileUploadForm', $fields, $actions, null);
         $urlParams = array('feclass' => $parentClass, 'fefield' => $parentField, 'feid' => $parentId, 'filesUpload' => true, 'fefileid' => $file->ID, 'fefileclass' => $file->ClassName);
         //   feclass: parentClass,
         //                        fefield: parentField,
         //                        feid: parentId,
         //                        feisUpload: true,
         //                        value: "{feclass: " + objClass + ",feid: " + objId + "}"
         //            echo http_build_query($urlParams) . "\n";
         $from->setFormAction('home/feFileUploadForm?' . http_build_query($urlParams));
         return $from;
     }
 }
 public function getCMSFields()
 {
     $ScrollDirectionOptions = array("up", "down", "left", "right");
     $ScrollEasingOptions = array("Elastic", "Linear");
     $ScrollFx = array("none", "scroll", "directscroll", "fade", "crossfade", "cover", "cover-fade", "uncover", "uncover-fade");
     $GenAlignment = array("Left", "Center", "Right");
     $fields = parent::getCMSFields();
     $fields->addFieldToTab('Root.Photos', $uploadField = new UploadField($name = 'Images', $title = 'Upload one or more images (max 10 at a time)'));
     $fields->addFieldToTab('Root.Settings.General', new CheckBoxField('GenAutoStart', 'Auto Start Carousel?'));
     $fields->addFieldToTab('Root.Settings.General', new CheckBoxField('GenCarouselCircular', 'Make Carousel Circular?'));
     $fields->addFieldToTab('Root.Settings.General', new CheckBoxField('GenCarouselInfinite', 'Make Carousel Infinite?'));
     $fields->addFieldToTab('Root.Settings.General', new NumericField('GenItemNumberToStart', 'Which item should start carousel (0 for random)'));
     $fields->addFieldToTab('Root.Settings.General', new NumericField('GenDurationBeforeStart', 'Delay before carousel scrolls for first time (millisec)'));
     $fields->addFieldToTab('Root.Settings.General', new NumericField('GenItemsMin', 'Items Viewable Minimum'));
     $fields->addFieldToTab('Root.Settings.General', new NumericField('GenItemsMax', 'Items Viewable Maximum'));
     $fields->addFieldToTab('Root.Settings.General', new NumericField('GenItemWidth', 'Set image width (use 0 for no scaling)'));
     $fields->addFieldToTab('Root.Settings.General', new NumericField('GenItemHeight', 'Set image Height (use 0 for no scaling)'));
     $fields->addFieldToTab('Root.Settings.General', new DropDownField("GenAlignment", "Slide Alignment?", $GenAlignment));
     $fields->addFieldToTab('Root.Settings.Scroll', new DropDownField("ScrollDirection", "What direction to move the carousel?", $ScrollDirectionOptions));
     $fields->addFieldToTab('Root.Settings.Scroll', new DropDownField("ScrollFx", "Slide Transition type?", $ScrollFx));
     $fields->addFieldToTab('Root.Settings.Scroll', new DropDownField("ScrollEasing", "Slide Easing Option", $ScrollEasingOptions));
     $fields->addFieldToTab('Root.Settings.Scroll', new NumericField('ScrollNumItems', 'Scroll number of items (0 will scroll none)'));
     $fields->addFieldToTab('Root.Settings.Scroll', new NumericField('ScrollDuration', 'Scroll Duration Time (millisec)'));
     $fields->addFieldToTab('Root.Settings.Scroll', new CheckBoxField('ScrollPauseOnHover', 'Pause the scrolling when mouse is hovering?'));
     $fields->addFieldToTab('Root.Settings.Swipe', new CheckBoxField('SwipeOnMouse', 'scroll via dragging (on non-touch-devices only)'));
     $fields->addFieldToTab('Root.Settings.Swipe', new CheckBoxField('SwipeOnTouch', 'scroll via swiping gestures (on touch-devices only)'));
     $uploadField->setFolderName('slides');
     $uploadField->setAllowedMaxFileNumber(10);
     return $fields;
 }
Пример #3
0
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab('Root.Main', new HTMLEditorField('VisaInformation', 'Visa Information'));
     $fields->addFieldToTab('Root.Main', new HTMLEditorField('TravelSupport', 'Travel Support'));
     $fields->addFieldToTab('Root.CityInfo', new HTMLEditorField('CityIntro', 'City Intro'));
     $fields->addFieldToTab('Root.CityInfo', new HTMLEditorField('AboutTheCity', 'About The City'));
     $fields->addFieldToTab('Root.CityInfo', new HTMLEditorField('Locals', 'In The Words Of The Locals'));
     $fields->addFieldToTab('Root.CityInfo', new HTMLEditorField('GettingAround', 'Getting Around'));
     $fields->addFieldsToTab('Root.CityInfo', new TextField('HostCityLat', 'City Latitude (Map Center)'));
     $fields->addFieldsToTab('Root.CityInfo', new TextField('HostCityLng', 'City Longitude (Map Center)'));
     $fields->addFieldToTab('Root.MapLocations', new HTMLEditorField('LocationsTextHeader', 'Intro Text'));
     $fields->addFieldToTab('Root.MapLocations', new HTMLEditorField('OtherLocations', 'Other Locations'));
     if ($this->ID) {
         // Summit Question Categories
         $fields->addFieldsToTab('Root.Main', $venue_back = new UploadField('VenueBackgroundImage', 'Venue Background Image'));
         $venue_back->setFolderName('summits/locations');
         $venue_back->setAllowedMaxFileNumber(1);
         $venue_back->setAllowedFileCategories('image');
         $fields->addFieldsToTab('Root.Main', new TextField('VenueBackgroundImageHero', 'Venue Background Image Author'));
         $fields->addFieldsToTab('Root.Main', new TextField('VenueBackgroundImageHeroSource', 'Venue Background Image Author Url'));
         $fields->addFieldsToTab('Root.CityInfo', $about_back = new UploadField('AboutTheCityBackgroundImage', 'About The City Background Image'));
         $about_back->setFolderName('summits/location/about');
         $about_back->setAllowedMaxFileNumber(1);
         $about_back->setAllowedFileCategories('image');
         $fields->addFieldsToTab('Root.CityInfo', new TextField('AboutTheCityBackgroundImageHero', 'About The City Background Image Author'));
         $fields->addFieldsToTab('Root.CityInfo', new TextField('AboutTheCityBackgroundImageHeroSource', 'About The City Background Image Author Source Url'));
     }
     $fields->addFieldToTab('Root.Main', new TextField('VenueTitleText', 'Venue Title Text'));
     $fields->addFieldToTab('Root.Main', new TextField('AirportsTitle', 'Airports Title'));
     $fields->addFieldToTab('Root.Main', new TextField('AirportsSubTitle', 'Airports SubTitle'));
     $fields->addFieldToTab('Root.Main', new TextField('CampusGraphic', 'URL of image of campus graphic'));
     return $fields;
 }
Пример #4
0
 public function getCMSFields()
 {
     $f = parent::getCMSFields();
     $f->addFieldToTab('Root.Main', new TextField('Link', 'Slide Link'));
     $f->addFieldToTab('Root.Main', $upload = new UploadField('Slide', 'Slide File'));
     $upload->setAllowedMaxFileNumber(1);
     return $f;
 }
 public function getCMSFields()
 {
     $fields = new FieldList();
     $fields->add($upload_0 = new UploadField('Image', 'Photo'));
     $upload_0->setFolderName('summits/overview/networking');
     $upload_0->setAllowedMaxFileNumber(1);
     $upload_0->setAllowedFileCategories('image');
     return $fields;
 }
 /**
  * @return FieldList
  */
 public function getCMSFields()
 {
     $f = parent::getCMSFields();
     $f->addFieldToTab('Root.Main', new TextField('Link', 'Slide Link'));
     $f->addFieldToTab('Root.Main', $upload_field = new UploadField('Slide', 'Slide File'));
     $upload_field->setAllowedMaxFileNumber(1);
     $upload_field->getValidator()->setAllowedMaxFileSize(array('*' => 5 * 1024 * 1024));
     $upload_field->setFolderName(sprintf('summits/%s/presentations/%s/slides/', $_REQUEST['SummitID'], $_REQUEST['SummitEventID']));
     return $f;
 }
 public function getCMSFields()
 {
     $f = new FieldList();
     $f->add(new TextField('Title', 'Title'));
     $image = new UploadField('Image', 'Pic');
     $image->setAllowedMaxFileNumber(1);
     $image->setFolderName(sprintf('summits/%s/highlights/pics', $this->SummitHighlightsPage()->SummitID));
     $f->add($image);
     $f->add(new HiddenField('SummitHighlightsPageID', 'SummitHighlightsPageID'));
     return $f;
 }
 public function getCMSFields()
 {
     $f = parent::getCMSFields();
     //current summit
     $f->removeByName('Content');
     $f->addFieldToTab('Root.CurrentSummit', new HtmlEditorField('ThankYouText', 'ThankYouText'));
     $f->addFieldToTab('Root.CurrentSummit', new TextField('CurrentSummitFlickrUrl', 'Flickr Url'));
     $image = new UploadField('CurrentSummitBackgroundImage', 'Background Image');
     $image->setAllowedMaxFileNumber(1);
     $image->setFolderName(sprintf('summits/%s/highlights/', $this->SummitID));
     $f->addFieldToTab('Root.CurrentSummit', $image);
     // statistics
     $f->addFieldToTab('Root.Statistics', new TextField('AttendanceQty', 'Attendance Qty'));
     $f->addFieldToTab('Root.Statistics', new TextField('CompaniesRepresentedQty', 'Companies Represented Qty'));
     $f->addFieldToTab('Root.Statistics', new TextField('CountriesRepresentedQty', 'Countries Represented Qty'));
     $f->addFieldToTab('Root.Statistics', new TextField('StatisticsVideoUrl', 'Video Url'));
     $file = new UploadField('StatisticsVideo', 'Video');
     $file->setAllowedMaxFileNumber(1);
     $file->setAllowedExtensions(array('mp4'));
     $file->setFolderName(sprintf('summits/%s/highlights/statistics', $this->SummitID));
     $f->addFieldToTab('Root.Statistics', $file);
     $image = new UploadField('StatisticsVideoPoster', 'Video Poster');
     $image->setAllowedMaxFileNumber(1);
     $image->setFolderName(sprintf('summits/%s/highlights/statistics', $this->SummitID));
     $f->addFieldToTab('Root.Statistics', $image);
     // next summit
     $f->addFieldToTab('Root.NextSummit', new HtmlEditorField('NextSummitText', 'Next Summit Text'));
     $dropdown = DropdownField::create('NextSummitBackgroundImageID', 'Please choose an image for this page', SummitImage::get()->map("ID", "Title", "Please Select"))->setEmptyString('(None)');
     $f->addFieldToTab('Root.NextSummit', $dropdown);
     $image = new UploadField('NextSummitTinyBackgroundImage', 'Promo Background Image');
     $image->setAllowedMaxFileNumber(1);
     $image->setFolderName(sprintf('summits/%s/highlights/next_summit/', $this->SummitID));
     $f->addFieldToTab('Root.NextSummit', $image);
     // release
     $f->addFieldToTab('Root.ReleaseAnnounced', new TextField('ReleaseAnnouncedTitle', 'Title'));
     $f->addFieldToTab('Root.ReleaseAnnounced', new HtmlEditorField('ReleaseAnnouncedDescription', 'Description'));
     $f->addFieldToTab('Root.ReleaseAnnounced', new TextField('ReleaseAnnouncedButtonTitle', 'Button Text'));
     $f->addFieldToTab('Root.ReleaseAnnounced', new TextField('ReleaseAnnouncedButtonLink', 'Button Link'));
     $release_image = new UploadField('ReleaseAnnouncedImage', 'Image');
     $release_image->setAllowedMaxFileNumber(1);
     $release_image->setFolderName(sprintf('summits/%s/highlights/release/', $this->SummitID));
     $f->addFieldToTab('Root.ReleaseAnnounced', $release_image);
     if ($this->ID > 0) {
         $config = GridFieldConfig_RecordEditor::create();
         $config->addComponent($sort = new GridFieldSortableRows('Order'));
         $gridField = new GridField('KeynotesImages', 'KeynotesImages', $this->KeynotesImages(), $config);
         $f->addFieldToTab('Root.KeyNotesImages', $gridField);
         $config = GridFieldConfig_RecordEditor::create();
         $config->addComponent($sort = new GridFieldSortableRows('Order'));
         $gridField = new GridField('Pics', 'Pics', $this->Pics(), $config);
         $f->addFieldToTab('Root.Pics', $gridField);
     }
     return $f;
 }
 public function getCMSFields()
 {
     $f = parent::getCMSFields();
     $f->removeByName('Picture');
     $map_field = new UploadField('Picture', 'Map');
     $map_field->setAllowedMaxFileNumber(1);
     $map_field->setFolderName(sprintf('summits/%s/locations/%s/maps/', $_REQUEST['SummitID'], $_REQUEST['LocationID']));
     $map_field->getValidator()->setAllowedMaxFileSize(array('*' => 500 * 1024));
     $f->add($map_field);
     return $f;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $tab = 'Root.Main';
     $tab = 'Root.Examples';
     $field = new UploadField('Image');
     $field->setAllowedMaxFileNumber(1);
     $field->getValidator()->setAllowedMaxFileSize(4 * 1024 * 1024);
     $field->setFolderName('Uploads/10-image-setwidth/');
     $fields->addFieldToTab($tab, $field);
     return $fields;
 }
Пример #11
0
 public function getCMSFields()
 {
     $f = new FieldList();
     $f->add(new TextField('Name', 'Name'));
     $f->add(new HtmlEditorField('Description', 'Description'));
     $map_field = new UploadField('Map', 'Map');
     $map_field->setAllowedMaxFileNumber(1);
     $map_field->setFolderName(sprintf('summits/%s/locations/maps/', $this->Location()->SummitID));
     $f->add($map_field);
     $f->add(new HiddenField('LocationID', 'LocationID'));
     return $f;
 }
Пример #12
0
 public function getCMSFields()
 {
     $f = parent::getCMSFields();
     $map_field = new UploadField('Map', 'Map');
     $map_field->setAllowedMaxFileNumber(1);
     $map_field->setFolderName(sprintf('summits/%s/locations/venues/maps/', $this->SummitID));
     $f->addFieldToTab('Root.Main', $map_field);
     $config = GridFieldConfig_RecordEditor::create();
     $gridField = new GridField('Rooms', 'Rooms', $this->Rooms(), $config);
     $f->addFieldToTab('Root.Rooms', $gridField);
     return $f;
 }
 public function getCMSFields()
 {
     $f = new FieldList();
     $f->add(new TextField('Name', 'Name'));
     $f->add(new HtmlEditorField('Description', 'Description'));
     $map_field = new UploadField('Picture', 'Picture');
     $map_field->setAllowedMaxFileNumber(1);
     $map_field->setFolderName(sprintf('summits/%s/locations/%s/images/', $_REQUEST['SummitID'], $_REQUEST['LocationID']));
     $map_field->getValidator()->setAllowedMaxFileSize(array('*' => 500 * 1024));
     $f->add($map_field);
     $f->add(new HiddenField('LocationID', 'LocationID'));
     return $f;
 }
 function getCMSFields()
 {
     $f = parent::getCMSFields();
     $f->removeByName(array('SortOrder', 'Image'));
     $f->removeByName('SortOrder');
     $f->addFieldsToTab('Root.Main', HtmlEditorField::create("Description")->setRows(15));
     $f->addFieldsToTab('Root.Image', $HeroImage = new UploadField('Image', 'Please upload a Hero image <span>(max. 1 files)</span>'));
     $HeroImage->setAllowedFileCategories('image');
     $HeroImage->setAllowedMaxFileNumber(1);
     $HeroImage->getValidator()->setAllowedExtensions(array('jpg', 'jpeg', 'png', 'gif'));
     $HeroImage->setConfig('allowedMaxFileNumber', 1);
     $HeroImage->setFolderName('Uploads/Distributors/' . $this->URLSegment);
     return $f;
 }
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab('Root.Main', new DropdownField('Size', 'Icon size:', singleton('WebAppIcon')->dbObject('Size')->enumValues()));
     $fields->addFieldToTab('Root.Main', $uploadField = new UploadField($name = 'Image', $title = 'Upload a App Icon'));
     $uploadField->setAllowedMaxFileNumber(1);
     $uploadField->setFolderName('appicons');
     $uploadField->setAllowedExtensions(array('png'));
     $sizeMB = 1;
     $size = $sizeMB * 1024 * 1024;
     $uploadField->getValidator()->setAllowedMaxFileSize($size);
     // hide the settings field
     $fields->removeByName('WebAppConfigID');
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName('PageID');
     $fields->removeByName('SortOrder');
     $tab = 'Root.Main';
     $field = new TextField('FirstName');
     $fields->addFieldToTab($tab, $field);
     $field = new TextField('LastName');
     $fields->addFieldToTab($tab, $field);
     $field = new UploadField('Avatar');
     $field->setAllowedMaxFileNumber(1);
     $field->setFolderName('Uploads/02-template-controls/');
     $fields->addFieldToTab($tab, $field);
     return $fields;
 }
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab('Root.Main', new DropdownField('Device', 'Startup screen size:', singleton('WebAppStartupScreen')->dbObject('Device')->enumValues()));
     $fields->addFieldToTab('Root.Main', $uploadField = new UploadField($name = 'Image', $title = 'Upload a Splash Screen'));
     $uploadField->setAllowedMaxFileNumber(1);
     $uploadField->setFolderName('splashscreens');
     $uploadField->setAllowedExtensions(array('png'));
     $sizeMB = 5;
     $size = $sizeMB * 1024 * 1024;
     $uploadField->getValidator()->setAllowedMaxFileSize($size);
     // hide the media field, this gets written inBefore Write. See below
     $fields->addFieldToTab('Root.Main', new HiddenField('Media'));
     // hide the settings field
     $fields->removeByName('WebAppConfigID');
     return $fields;
 }
 public function getCMSFields()
 {
     $f = new FieldList();
     $f->add(new TextField('Title', 'Title'));
     $f->add(new DropdownField('Day', 'Day', $this->dbObject('Day')->enumValues()));
     $f->add(new HtmlEditorField('Description', 'Description'));
     $image = new UploadField('Image', 'Pic');
     $image->setAllowedMaxFileNumber(1);
     $image->setFolderName(sprintf('summits/%s/keynotes/pics', $this->SummitHighlightsPage()->SummitID));
     $f->add($image);
     $image = new UploadField('Thumbnail', 'Thumbnail');
     $image->setAllowedMaxFileNumber(1);
     $image->setFolderName(sprintf('summits/%s/keynotes/thumbs', $this->SummitHighlightsPage()->SummitID));
     $f->add($image);
     $f->add(new HiddenField('SummitHighlightsPageID', 'SummitHighlightsPageID'));
     return $f;
 }
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->insertBefore(new Tab('About'), 'Settings');
     $fields->insertBefore(new Tab('Host'), 'Settings');
     // header
     $fields->removeByName('Content');
     $fields->addFieldToTab('Root.Main', $uploadField = new UploadField('HeaderPics', 'Header Pictures'));
     $uploadField->setAllowedMaxFileNumber(10);
     $uploadField->setFolderName('openstackdays');
     // About
     $fields->addFieldToTab('Root.About', $about_desc = new HtmlEditorField('AboutDescription', 'Intro Text', $this->AboutDescription));
     $config = new GridFieldConfig_RecordEditor(10);
     $config->getComponentByType('GridFieldDataColumns')->setDisplayFields(array('YoutubeID' => 'YoutubeID', 'Caption' => 'Caption', 'Active' => 'Active'));
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab('Root.About', new GridField('AboutVideos', 'Videos', $this->AboutVideos(), $config));
     // Host
     $fields->addFieldToTab('Root.Host', $host_intro = new HtmlEditorField('HostIntro', 'Intro Text', $this->HostIntro));
     $fields->addFieldToTab('Root.Host', $host_faq = new HtmlEditorField('HostFAQs', 'FAQs', $this->HostFAQs));
     $fields->addFieldToTab('Root.Host', $toolkit_text = new HtmlEditorField('ToolkitDesc', 'Toolkit Text', $this->ToolkitDesc));
     $config = new GridFieldConfig_RecordEditor(3);
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab('Root.Host', new GridField('OfficialGuidelines', 'Official Guidelines', $this->OfficialGuidelines(), $config));
     $config = new GridFieldConfig_RecordEditor(3);
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab('Root.Host', new GridField('PlanningTools', 'Planning Tools', $this->PlanningTools(), $config));
     $fields->addFieldToTab('Root.Host', $artwork_intro = new HtmlEditorField('ArtworkIntro', 'Artwork intro text', $this->ArtworkIntro));
     $artwork_intro->setRows(4);
     $config = new GridFieldConfig_RecordEditor(3);
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab('Root.Host', new GridField('Artwork', 'Artwork', $this->Artwork(), $config));
     $fields->addFieldToTab('Root.Host', $collateral_intro = new HtmlEditorField('CollateralIntro', 'Collateral intro text', $this->CollateralIntro));
     $collateral_intro->setRows(4);
     $config = new GridFieldConfig_RecordEditor(10);
     $config->getComponentByType('GridFieldDataColumns')->setDisplayFields(array('YoutubeID' => 'YoutubeID', 'Caption' => 'Caption', 'Active' => 'Active'));
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab('Root.Host', new GridField('Collaterals', 'Video / Presentations / Collateral', $this->Collaterals(), $config));
     $config = new GridFieldConfig_RecordEditor(3);
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab('Root.Host', new GridField('Media', 'PR / Media', $this->Media(), $config));
     return $fields;
 }
 public function getCMSFields()
 {
     $f = new FieldList();
     $f->add(new TextField('Name', 'Name'));
     $f->add(new TextareaField('Description', 'Description'));
     $f->add(new NumericField('Number', 'Number'));
     $f->add($upload_field = new UploadField('Image', 'Map'));
     $f->add(new HiddenField('VenueID', 'VenueID'));
     $upload_field->setAllowedMaxFileNumber(1);
     $upload_field->getValidator()->setAllowedMaxFileSize(array('*' => 512 * 1024));
     $upload_field->setFolderName(sprintf('summits/%s/locations/%s/floors/', $_REQUEST['SummitID'], $_REQUEST['LocationID']));
     if ($this->ID) {
         $f->add(new LiteralField('br', '<br>'));
         $config = GridFieldConfig_RelationEditor::create();
         $config->getComponentByType('GridFieldAddExistingAutocompleter')->setSearchList($this->Venue()->Rooms());
         $gridField = new GridField('Rooms', 'Rooms', $this->Rooms(), $config);
         $f->add($gridField);
     }
     return $f;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->add(new TextField('AddEntityText', 'Add Text'));
     $fields->add(new TextField('DeleteEntityText', 'Delete Text'));
     $fields->add(new TextField('EditEntityText', 'Edit Text'));
     $icon = new UploadField('EntityIcon', 'Upload Entity Icon');
     $icon->setCanAttachExisting(false);
     $icon->setAllowedMaxFileNumber(1);
     $icon->setAllowedFileCategories('image');
     $icon->setFolderName('survey-builder');
     if ($this->ID > 0) {
         $fields->add($icon);
         $id = (int) $this->ID;
         $parent_id = (int) $this->SurveyTemplateID;
         $fields->add($ddl_entity = new DropdownField('EntityID', 'Please choose an entity to hold', EntitySurveyTemplate::get()->where(" (OwnerID = 0 OR OwnerID = {$id} ) AND ParentID = {$parent_id} ")->map("ID", "EntityName")));
         $ddl_entity->setEmptyString('-- Please Select --');
     }
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab('Root.Main', new HTMLEditorField('VisaInformation', 'Visa Information'));
     $fields->addFieldToTab('Root.Main', new HTMLEditorField('TravelSupport', 'Travel Support'));
     $fields->addFieldToTab('Root.CityInfo', new HTMLEditorField('CityIntro', 'City Intro'));
     $fields->addFieldToTab('Root.CityInfo', new HTMLEditorField('AboutTheCity', 'About The City'));
     $fields->addFieldToTab('Root.CityInfo', new HTMLEditorField('Locals', 'In The Words Of The Locals'));
     $fields->addFieldToTab('Root.CityInfo', new HTMLEditorField('GettingAround', 'Getting Around'));
     $fields->addFieldsToTab('Root.CityInfo', new TextField('HostCityLat', 'City Latitude (Map Center)'));
     $fields->addFieldsToTab('Root.CityInfo', new TextField('HostCityLng', 'City Longitude (Map Center)'));
     $fields->addFieldToTab('Root.MapLocations', new HTMLEditorField('LocationsTextHeader', 'Intro Text'));
     $fields->addFieldToTab('Root.MapLocations', new HTMLEditorField('OtherLocations', 'Other Locations'));
     if ($this->ID) {
         // Summit Question Categories
         $LocationFields = singleton('SummitLocation')->getCMSFields();
         $config = GridFieldConfig_RelationEditor::create();
         $config->getComponentByType('GridFieldDetailForm')->setFields($LocationFields);
         $config->addComponent(new GridFieldSortableRows('Order'));
         $gridField = new GridField('Locations', 'Locations', $this->Locations(), $config);
         $fields->addFieldToTab('Root.MapLocations', $gridField);
         $fields->addFieldsToTab('Root.Main', $venue_back = new UploadField('VenueBackgroundImage', 'Venue Background Image'));
         $venue_back->setFolderName('summits/locations');
         $venue_back->setAllowedMaxFileNumber(1);
         $venue_back->setAllowedFileCategories('image');
         $fields->addFieldsToTab('Root.Main', new TextField('VenueBackgroundImageHero', 'Venue Background Image Author'));
         $fields->addFieldsToTab('Root.Main', new TextField('VenueBackgroundImageHeroSource', 'Venue Background Image Author Url'));
         $fields->addFieldsToTab('Root.CityInfo', $about_back = new UploadField('AboutTheCityBackgroundImage', 'About The City Background Image'));
         $about_back->setFolderName('summits/location/about');
         $about_back->setAllowedMaxFileNumber(1);
         $about_back->setAllowedFileCategories('image');
         $fields->addFieldsToTab('Root.CityInfo', new TextField('AboutTheCityBackgroundImageHero', 'About The City Background Image Author'));
         $fields->addFieldsToTab('Root.CityInfo', new TextField('AboutTheCityBackgroundImageHeroSource', 'About The City Background Image Author Source Url'));
     }
     $fields->addFieldToTab('Root.Main', new TextField('VenueTitleText', 'Venue Title Text'));
     $fields->addFieldToTab('Root.Main', new TextField('AirportsTitle', 'Airports Title'));
     $fields->addFieldToTab('Root.Main', new TextField('AirportsSubTitle', 'Airports SubTitle'));
     $fields->addFieldToTab('Root.Main', new TextField('CampusGraphic', 'URL of image of campus graphic'));
     return $fields;
 }
Пример #23
0
 public function getCMSFields()
 {
     $f = parent::getCMSFields();
     // hack
     $this->SummitID = $_REQUEST['SummitID'];
     $this->VenueID = $_REQUEST['VenueID'];
     $f->addFieldToTab('Root.Main', new NumericField('Capacity', 'Capacity'));
     $f->addFieldToTab('Root.Main', new CheckboxField('OverrideBlackouts', 'Overrides Blackouts'));
     $f->addFieldToTab('Root.Main', new HiddenField('VenueID', 'VenueID'));
     $f->addFieldToTab('Root.Main', $ddl_floor = new DropdownField('FloorID', 'Floor', SummitVenueFloor::get()->filter('VenueID', $this->VenueID)->map("ID", "FullName")));
     $ddl_floor->setEmptyString("-- SELECT A FLOOR --");
     $f->addFieldToTab('Root.Main', $upload_field = new UploadField('Image', 'Map'));
     $upload_field->setAllowedMaxFileNumber(1);
     $upload_field->setFolderName(sprintf('summits/%s/locations/%s/rooms/', $_REQUEST['SummitID'], $_REQUEST['LocationID']));
     $upload_field->getValidator()->setAllowedMaxFileSize(array('*' => 512 * 1024));
     if ($this->ID > 0) {
         $config = GridFieldConfig_RecordEditor::create();
         $gridField = new GridField('Metrics', 'Metrics', $this->Metrics(), $config);
         $f->addFieldToTab('Root.Main', $gridField);
     }
     return $f;
 }
Пример #24
0
 public function getCMSFields()
 {
     $_REQUEST['SummitID'] = $this->ID;
     $f = new FieldList($rootTab = new TabSet("Root", $tabMain = new Tab('Main')));
     $f->addFieldToTab('Root.Main', new TextField('Title', 'Title'));
     $f->addFieldToTab('Root.Main', $link = new TextField('Link', 'Summit Page Link'));
     $link->setDescription('The link to the site page for this summit. Eg: <em>/summit/vancouver-2015/</em>');
     $f->addFieldToTab('Root.Main', new CheckboxField('Active', 'This is the active summit'));
     $f->addFieldToTab('Root.Main', $date_label = new TextField('DateLabel', 'Date label'));
     $date_label->setDescription('A readable piece of text representing the date, e.g. <em>May 12-20, 2015</em> or <em>December 2016</em>');
     $f->addFieldToTab('Root.Main', $registration_link = new TextField('RegistrationLink', 'Registration Link'));
     $registration_link->setDescription('Link to the site where tickets can be purchased.');
     $f->addFieldsToTab('Root.Main', $ddl_timezone = new DropdownField('TimeZone', 'Time Zone', DateTimeZone::listIdentifiers()));
     $ddl_timezone->setEmptyString('-- Select a Timezone --');
     $f->addFieldToTab('Root.Main', $date = new DatetimeField('SummitBeginDate', 'Summit Begin Date'));
     $date->getDateField()->setConfig('showcalendar', true);
     $date->setConfig('dateformat', 'dd/MM/yyyy');
     $f->addFieldToTab('Root.Main', $date = new DatetimeField('SummitEndDate', 'Summit End Date'));
     $date->getDateField()->setConfig('showcalendar', true);
     $date->setConfig('dateformat', 'dd/MM/yyyy');
     $f->addFieldToTab('Root.Main', $date = new DatetimeField('StartShowingVenuesDate', 'Start Showing Venues'));
     $date->getDateField()->setConfig('showcalendar', true);
     $date->setConfig('dateformat', 'dd/MM/yyyy');
     $f->addFieldToTab('Root.Main', $date = new DatetimeField('SubmissionBeginDate', 'Submission Begin Date'));
     $date->getDateField()->setConfig('showcalendar', true);
     $date->setConfig('dateformat', 'dd/MM/yyyy');
     $f->addFieldToTab('Root.Main', $date = new DatetimeField('SubmissionEndDate', 'Submission End Date'));
     $date->getDateField()->setConfig('showcalendar', true);
     $date->setConfig('dateformat', 'dd/MM/yyyy');
     $f->addFieldToTab('Root.Main', $date = new DatetimeField('VotingBeginDate', 'Voting Begin Date'));
     $date->getDateField()->setConfig('showcalendar', true);
     $date->setConfig('dateformat', 'dd/MM/yyyy');
     $f->addFieldToTab('Root.Main', $date = new DatetimeField('VotingEndDate', 'Voting End Date'));
     $date->getDateField()->setConfig('showcalendar', true);
     $date->setConfig('dateformat', 'dd/MM/yyyy');
     $f->addFieldToTab('Root.Main', $date = new DatetimeField('SelectionBeginDate', 'Selection Begin Date'));
     $date->getDateField()->setConfig('showcalendar', true);
     $date->setConfig('dateformat', 'dd/MM/yyyy');
     $f->addFieldToTab('Root.Main', $date = new DatetimeField('SelectionEndDate', 'Selection End Date'));
     $date->getDateField()->setConfig('showcalendar', true);
     $date->setConfig('dateformat', 'dd/MM/yyyy');
     $f->addFieldToTab('Root.Main', $date = new DatetimeField('RegistrationBeginDate', 'Registration Begin Date'));
     $date->getDateField()->setConfig('showcalendar', true);
     $date->setConfig('dateformat', 'dd/MM/yyyy');
     $f->addFieldToTab('Root.Main', $date = new DatetimeField('RegistrationEndDate', 'Registration End Date'));
     $date->getDateField()->setConfig('showcalendar', true);
     $date->setConfig('dateformat', 'dd/MM/yyyy');
     $logo_field = new UploadField('Logo', 'Logo');
     $logo_field->setAllowedMaxFileNumber(1);
     $logo_field->setAllowedFileCategories('image');
     $logo_field->setFolderName('summits/logos/');
     $logo_field->getValidator()->setAllowedMaxFileSize(1048576);
     $f->addFieldToTab('Root.Main', $logo_field);
     $f->addFieldToTab('Root.Main', new TextField('ComingSoonBtnText', 'Coming Soon Btn Text'));
     $f->addFieldToTab('Root.Main', new TextField('ExternalEventId', 'Eventbrite Event Id'));
     if ($this->ID > 0) {
         // tracks
         $config = GridFieldConfig_RecordEditor::create(10);
         $categories = new GridField('Categories', 'Presentation Categories', $this->Categories(), $config);
         $f->addFieldToTab('Root.Presentation Categories', $categories);
         // track groups
         $config = GridFieldConfig_RecordEditor::create(10);
         $categories = new GridField('CategoryGroups', 'Category Groups', $this->CategoryGroups(), $config);
         $f->addFieldToTab('Root.Category Groups', $categories);
         // locations
         $config = GridFieldConfig_RecordEditor::create();
         $config->removeComponentsByType('GridFieldAddNewButton');
         $multi_class_selector = new GridFieldAddNewMultiClass();
         $multi_class_selector->setClasses(array('SummitVenue' => 'Venue', 'SummitHotel' => 'Hotel', 'SummitAirport' => 'Airport', 'SummitExternalLocation' => 'External Location'));
         $config->addComponent($multi_class_selector);
         $config->addComponent($sort = new GridFieldSortableRows('Order'));
         $gridField = new GridField('Locations', 'Locations', $this->Locations()->where("ClassName <> 'SummitVenueRoom' "), $config);
         $f->addFieldToTab('Root.Locations', $gridField);
         // types
         $config = GridFieldConfig_RecordEditor::create();
         $config->addComponent(new GridFieldAddDefaultSummitTypes());
         $gridField = new GridField('Types', 'Types', $this->Types(), $config);
         $f->addFieldToTab('Root.Types', $gridField);
         // event types
         $config = GridFieldConfig_RecordEditor::create();
         $config->addComponent(new GridFieldAddDefaultEventTypes());
         $gridField = new GridField('EventTypes', 'EventTypes', $this->EventTypes(), $config);
         $f->addFieldToTab('Root.EventTypes', $gridField);
         //schedule
         $config = GridFieldConfig_RecordEditor::create(50);
         $config->addComponent(new GridFieldAjaxRefresh(1000, false));
         $config->removeComponentsByType('GridFieldDeleteAction');
         $gridField = new GridField('Schedule', 'Schedule', $this->Events()->filter('Published', true)->sort(array('StartDate' => 'ASC', 'EndDate' => 'ASC')), $config);
         $config->getComponentByType("GridFieldDataColumns")->setFieldCasting(array("Description" => "HTMLText->BigSummary"));
         $f->addFieldToTab('Root.Schedule', $gridField);
         $config->addComponent(new GridFieldPublishSummitEventAction());
         // events
         $config = GridFieldConfig_RecordEditor::create(50);
         $config->addComponent(new GridFieldPublishSummitEventAction());
         $config->addComponent(new GridFieldAjaxRefresh(1000, false));
         $config->addComponent($bulk_summit_types = new GridFieldBulkActionAssignSummitTypeSummitEvents());
         $bulk_summit_types->setTitle('Set Summit Types');
         $gridField = new GridField('Events', 'Events', $this->Events()->filter('ClassName', 'SummitEvent'), $config);
         $config->getComponentByType("GridFieldDataColumns")->setFieldCasting(array("Description" => "HTMLText->BigSummary"));
         $f->addFieldToTab('Root.Events', $gridField);
         //track selection list presentations
         $result = DB::query("SELECT DISTINCT SummitEvent.*, Presentation.*\nFROM SummitEvent\nINNER JOIN Presentation ON Presentation.ID = SummitEvent.ID\nINNER JOIN SummitSelectedPresentation ON SummitSelectedPresentation.PresentationID = Presentation.ID\nINNER JOIN SummitSelectedPresentationList ON SummitSelectedPresentation.SummitSelectedPresentationListID = SummitSelectedPresentationList.ID\nWHERE(ListType = 'Group') AND (SummitEvent.ClassName IN ('Presentation')) AND  (SummitEvent.SummitID = {$this->ID})");
         $presentations = new ArrayList();
         foreach ($result as $row) {
             $presentations->add(new Presentation($row));
         }
         $config = GridFieldConfig_RecordEditor::create(50);
         $config->addComponent(new GridFieldPublishSummitEventAction());
         $config->addComponent(new GridFieldAjaxRefresh(1000, false));
         $config->addComponent($bulk_summit_types = new GridFieldBulkActionAssignSummitTypeSummitEvents());
         $bulk_summit_types->setTitle('Set Summit Types');
         $config->removeComponentsByType('GridFieldAddNewButton');
         $gridField = new GridField('TrackChairs', 'TrackChairs Selection Lists', $presentations, $config);
         $gridField->setModelClass('Presentation');
         $f->addFieldToTab('Root.TrackChairs Selection Lists', $gridField);
         // attendees
         $config = GridFieldConfig_RecordEditor::create(50);
         $gridField = new GridField('Attendees', 'Attendees', $this->Attendees(), $config);
         $f->addFieldToTab('Root.Attendees', $gridField);
         //tickets types
         $config = GridFieldConfig_RecordEditor::create(50);
         $gridField = new GridField('SummitTicketTypes', 'Ticket Types', $this->SummitTicketTypes(), $config);
         $f->addFieldToTab('Root.TicketTypes', $gridField);
         // promo codes
         $config = GridFieldConfig_RecordEditor::create(50);
         $config->removeComponentsByType('GridFieldAddNewButton');
         $multi_class_selector = new GridFieldAddNewMultiClass();
         $multi_class_selector->setClasses(array('SpeakerSummitRegistrationPromoCode' => 'Speaker Promo Code'));
         $config->addComponent($multi_class_selector);
         $promo_codes = new GridField('SummitRegistrationPromoCodes', 'Registration Promo Codes', $this->SummitRegistrationPromoCodes(), $config);
         $f->addFieldToTab('Root.RegistrationPromoCodes', $promo_codes);
         // speakers
         $config = GridFieldConfig_RecordEditor::create(50);
         $gridField = new GridField('Speakers', 'Speakers', $this->Speakers(false), $config);
         $config->getComponentByType("GridFieldDataColumns")->setFieldCasting(array("Bio" => "HTMLText->BigSummary"));
         $f->addFieldToTab('Root.Speakers', $gridField);
         // presentations
         $config = GridFieldConfig_RecordEditor::create(50);
         $config->addComponent(new GridFieldPublishSummitEventAction());
         $config->addComponent(new GridFieldAjaxRefresh(1000, false));
         $config->addComponent($bulk_summit_types = new GridFieldBulkActionAssignSummitTypeSummitEvents());
         $bulk_summit_types->setTitle('Set Summit Types');
         $gridField = new GridField('Presentations', 'Presentations', $this->Presentations()->where(" Title IS NOT NULL AND Title <>'' "), $config);
         $config->getComponentByType("GridFieldDataColumns")->setFieldCasting(array("Description" => "HTMLText->BigSummary"));
         $f->addFieldToTab('Root.Presentations', $gridField);
         // push notifications
         $config = GridFieldConfig_RecordEditor::create(50);
         $config->addComponent(new GridFieldAjaxRefresh(1000, false));
         $config->getComponentByType('GridFieldDataColumns')->setDisplayFields(array('Channel' => 'Channel', 'Message' => 'Message', 'Owner.FullName' => 'Owner', 'IsSent' => 'Is Sent?'));
         $gridField = new GridField('Notifications', 'Notifications', $this->Notifications(), $config);
         $f->addFieldToTab('Root.Notifications', $gridField);
     }
     return $f;
 }
 public function getCMSFields()
 {
     Requirements::css('silverstripe-video-embed/assests/css/VideoEmbedEditor.css');
     Requirements::javascript('silverstripe-video-embed/assests/javascript/urlParser.min.js');
     Requirements::javascript(THIRDPARTY_DIR . '/json-js/json2.js');
     Requirements::javascript('silverstripe-video-embed/assests/javascript/VideoEmbedEditor.js');
     $Fields = parent::getCMSFields();
     $Fields->removeByName('Type');
     $Fields->removeByName('Code');
     $Fields->removeByName('HTML5Video');
     $Fields->removeByName('ThumbnailURL');
     $Fields->removeByName('ThumbnailFile');
     $types = $this->GetVideoTypes();
     $typeSelection = array();
     foreach ($types as $type) {
         if (isset($type["label"])) {
             $typeSelection[$type["label"]] = $type["label"];
         }
     }
     $Fields->addFieldToTab('Root.Main', new DropdownField("Type", "Type", $typeSelection));
     $CodeField = new TextField("Code", "Code");
     $CodeField->setDescription('
         Copy and paste your Video URL here<br/>
         eg</br>
         &nbsp;&nbsp;https://www.youtube.com/watch?v=cRi5Hh7RU34</br>
         &nbsp;&nbsp;http://vimeo.com/93104916</br>
         &nbsp;&nbsp;http://www.dailymotion.com/video/x1no7nq_jquery-and-ajax-tutorials-45-ajax-login-example_tech</br>
     ');
     $Fields->addFieldToTab('Root.Main', $CodeField);
     $TitleField = new TextField("Title", "Title");
     $Fields->addFieldToTab('Root.Main', $TitleField);
     $HTML5VideoField = new UploadField('HTML5Video', 'Video file');
     //::create("HTML5Video")->setTitle("Album Cover Photo");
     $HTML5VideoField->getValidator()->allowedExtensions = array("webm", "ogg", "mp4", "flv");
     $HTML5VideoField->setAllowedMaxFileNumber(1);
     $Fields->addFieldToTab('Root.Main', $HTML5VideoField);
     $ThumbnailUploadField = new UploadField('ThumbnailFile', '');
     $ThumbnailUploadField->getValidator()->allowedExtensions = array('jpg', 'jpeg', 'gif', 'png');
     $ThumbnailUploadField->setAllowedMaxFileNumber(1);
     $thumbnailField = new SelectionGroup('ThumbnailGroup', array(SelectionGroup_Item::create('URL', array(LiteralField::create('ThumbPreview', '
             <div class="ss-uploadfield ">
                 <div class="ss-uploadfield-item ss-uploadfield-addfile middleColumn">
                     <div class="ss-uploadfield-item-preview ss-uploadfield-dropzone ui-corner-all" style="display: block; margin: 0" id="ThumbnailURLHolder">
                         Enter a URL
     		</div>
                     <img src="" alt="Failed to load preview" style="display:none; width: 60px;" id="ThumbnailURLPreview"/>
             '), TextField::create('ThumbnailURL', ''), LiteralField::create('ThumbPreview', '
                 </div>
             </div>'))), SelectionGroup_Item::create('File', $ThumbnailUploadField)));
     $thumbnailField->setValue("URL");
     if ($this->ThumbnailURL) {
         $thumbnailField->setValue("URL");
     } else {
         if ($this->ThumbnailFile()->exists()) {
             $thumbnailField->setValue("File");
         }
     }
     $fields[] = LiteralField::create("guestLabel", '<div id="Thumbnail" class="field text">
         <label class="left" for="Form_ItemEditForm_Value">Thumbnail</label>
         <div class="middleColumn">');
     $fields[] = $thumbnailField;
     $fields[] = LiteralField::create("guestLabel", ' <input type="text" name="Value" class="text" id="Form_ItemEditForm_Value">
         </div>
     </div>');
     $fields[] = new HiddenField("VideoTypesHolder", "VideoTypesHolder", Convert::raw2json($types));
     $Fields->addFieldsToTab('Root.Main', $fields);
     return $Fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldsToTab('Root.Main', new HtmlEditorField('OverviewIntro', 'Overview Intro'));
     if ($this->ID > 0) {
         $fields->addFieldToTab('Root.Networking', new HtmlEditorField('NetworkingContent', 'Content'));
         //networking photos
         $config = GridFieldConfig_RecordEditor::create();
         $config->addComponent(new GridFieldSortableRows('Order'));
         $gridField = new GridField('NetworkingPhotos', 'Photos', $this->NetworkingPhotos(), $config);
         $fields->addFieldToTab('Root.Networking', $gridField);
         $fields->addFieldToTab('Root.Networking', new HtmlEditorField('NetworkingContent', 'Content'));
         //menu items
         $config = GridFieldConfig_RecordEditor::create();
         $config->addComponent(new GridFieldSortableRows('Order'));
         $gridField = new GridField('HelpMenuItems', 'Help Menu Items', $this->HelpMenuItems(), $config);
         $fields->addFieldToTab('Root.HelpSideBarMenu', $gridField);
     }
     $fields->addFieldsToTab('Root.Schedule', new TextField('ScheduleTitle', 'Title'));
     $fields->addFieldsToTab('Root.Schedule', new HtmlEditorField('ScheduleText', 'Text'));
     $fields->addFieldsToTab('Root.Schedule', new TextField('ScheduleUrl', 'Url'));
     $fields->addFieldsToTab('Root.Schedule', new TextField('ScheduleBtnText', 'Button Caption'));
     // Video Recap
     $fields->addFieldsToTab('Root.VideoRecap', new TextField('RecapTitle', 'Title'));
     $fields->addFieldsToTab('Root.VideoRecap', new TextField('VideoRecapCaption1', 'Caption Text 1'));
     $fields->addFieldsToTab('Root.VideoRecap', new TextField('VideoRecapYouTubeID1', 'YouTubeID 1'));
     $fields->addFieldsToTab('Root.VideoRecap', new TextField('VideoRecapCaption2', 'Caption Text 2'));
     $fields->addFieldsToTab('Root.VideoRecap', new TextField('VideoRecapYouTubeID2', 'YouTubeID 2'));
     // GrowthBox
     $fields->addFieldToTab("Root.GrowthBox", new HtmlEditorField('GrowthBoxTextTop', 'Text Top'));
     $fields->addFieldToTab("Root.GrowthBox", new HtmlEditorField('GrowthBoxTextBottom', 'Text Bottom'));
     $fields->addFieldsToTab("Root.GrowthBox", $upload_0 = new UploadField('GrowthBoxBackground', 'Background Image'));
     $fields->addFieldsToTab("Root.GrowthBox", $upload_1 = new UploadField('GrowthBoxChartLegend', 'Chart Legend (SVG)'));
     $fields->addFieldsToTab("Root.GrowthBox", $upload_2 = new UploadField('GrowthBoxChartLegendPng', 'Chart Legend (PNG)'));
     $fields->addFieldsToTab("Root.GrowthBox", $upload_3 = new UploadField('GrowthBoxChart', 'Chart (SVG)'));
     $fields->addFieldsToTab("Root.GrowthBox", $upload_4 = new UploadField('GrowthBoxChartPng', 'Chart (PNG)'));
     $upload_0->setFolderName('summits/overview');
     $upload_0->setAllowedMaxFileNumber(1);
     $upload_0->setAllowedFileCategories('image');
     $upload_0->setOverwriteWarning(false);
     $upload_0->getUpload()->setReplaceFile(true);
     $upload_1->setFolderName('summits/overview');
     $upload_1->setAllowedMaxFileNumber(1);
     $upload_1->setAllowedExtensions(array('svg'));
     $upload_1->setOverwriteWarning(false);
     $upload_1->getUpload()->setReplaceFile(true);
     $upload_2->setFolderName('summits/overview');
     $upload_2->setAllowedMaxFileNumber(1);
     $upload_2->setAllowedExtensions(array('png'));
     $upload_2->setOverwriteWarning(false);
     $upload_2->getUpload()->setReplaceFile(true);
     $upload_3->setFolderName('summits/overview');
     $upload_3->setAllowedMaxFileNumber(1);
     $upload_3->setAllowedExtensions(array('svg'));
     $upload_3->setOverwriteWarning(false);
     $upload_3->getUpload()->setReplaceFile(true);
     $upload_4->setFolderName('summits/overview');
     $upload_4->setAllowedMaxFileNumber(1);
     $upload_4->setAllowedExtensions(array('png'));
     $upload_4->setOverwriteWarning(false);
     $upload_4->getUpload()->setReplaceFile(true);
     //two main events
     $fields->addFieldsToTab('Root.TwoMainEvents', new TextField('TwoMainEventsTitle', 'Title'));
     $fields->addFieldsToTab('Root.TwoMainEvents', new TextField('EventOneTitle', 'Event One - Title'));
     $fields->addFieldsToTab('Root.TwoMainEvents', new TextField('EventOneSubTitle', 'Event One - SubTitle'));
     $fields->addFieldsToTab('Root.TwoMainEvents', new HtmlEditorField('EventOneContent', 'Event One - Content'));
     $fields->addFieldsToTab('Root.TwoMainEvents', new TextField('EventTwoTitle', 'Event Two - Title'));
     $fields->addFieldsToTab('Root.TwoMainEvents', new TextField('EventTwoSubTitle', 'Event Two - SubTitle'));
     $fields->addFieldsToTab('Root.TwoMainEvents', new HtmlEditorField('EventTwoContent', 'Event Two - Content'));
     $fields->addFieldsToTab("Root.TwoMainEvents", $upload_5 = new UploadField('EventOneLogo', 'Event Two Logo (SVG)'));
     $fields->addFieldsToTab("Root.TwoMainEvents", $upload_6 = new UploadField('EventOneLogoPng', 'Event Two Logo (PNG)'));
     $fields->addFieldsToTab("Root.TwoMainEvents", $upload_7 = new UploadField('EventTwoLogo', 'Event Two Logo (SVG)'));
     $fields->addFieldsToTab("Root.TwoMainEvents", $upload_8 = new UploadField('EventTwoLogoPng', 'Event Two Logo (PNG)'));
     $upload_5->setFolderName('summits/overview/events');
     $upload_5->setAllowedMaxFileNumber(1);
     $upload_5->setAllowedExtensions(array('svg'));
     $upload_5->setOverwriteWarning(false);
     $upload_5->getUpload()->setReplaceFile(true);
     $upload_6->setFolderName('summits/overview/events');
     $upload_6->setAllowedMaxFileNumber(1);
     $upload_6->setAllowedExtensions(array('png'));
     $upload_6->setOverwriteWarning(false);
     $upload_6->getUpload()->setReplaceFile(true);
     $upload_7->setFolderName('summits/overview/events');
     $upload_7->setAllowedMaxFileNumber(1);
     $upload_7->setAllowedExtensions(array('svg'));
     $upload_7->setOverwriteWarning(false);
     $upload_7->getUpload()->setReplaceFile(true);
     $upload_8->setFolderName('summits/overview/events');
     $upload_8->setAllowedMaxFileNumber(1);
     $upload_8->setAllowedExtensions(array('png'));
     $upload_8->setOverwriteWarning(false);
     $upload_8->getUpload()->setReplaceFile(true);
     //atendees chart
     $fields->addFieldsToTab("Root.AtendeesChart", $upload_13 = new UploadField('AtendeesChartRef', 'Atendees Chart Legend (SVG)'));
     $fields->addFieldsToTab("Root.AtendeesChart", $upload_19 = new UploadField('AtendeesChartRefPng', 'Atendees Chart Legend (PNG)'));
     $fields->addFieldToTab("Root.AtendeesChart", new TextField('Atendees1Label', 'Atendees 1 Label'));
     $fields->addFieldsToTab("Root.AtendeesChart", $upload_9 = new UploadField('Atendees1Chart', 'Atendees 1 Chart (SVG)'));
     $fields->addFieldsToTab("Root.AtendeesChart", $upload_15 = new UploadField('Atendees1ChartPng', 'Atendees 1 Chart (PNG)'));
     $fields->addFieldToTab("Root.AtendeesChart", new TextField('Atendees2Label', 'Atendees 2 Label'));
     $fields->addFieldsToTab("Root.AtendeesChart", $upload_10 = new UploadField('Atendees2Chart', 'Atendees 2 Chart (SVG)'));
     $fields->addFieldsToTab("Root.AtendeesChart", $upload_16 = new UploadField('Atendees2ChartPng', 'Atendees 2 Chart (PNG)'));
     $fields->addFieldToTab("Root.AtendeesChart", new TextField('Atendees3Label', 'Atendees 3 Label'));
     $fields->addFieldsToTab("Root.AtendeesChart", $upload_11 = new UploadField('Atendees3Chart', 'Atendees 3 Chart (SVG)'));
     $fields->addFieldsToTab("Root.AtendeesChart", $upload_17 = new UploadField('Atendees3ChartPng', 'Atendees 3 Chart (PNG)'));
     $fields->addFieldToTab("Root.AtendeesChart", new TextField('Atendees4Label', 'Atendees 4 Label'));
     $fields->addFieldsToTab("Root.AtendeesChart", $upload_12 = new UploadField('Atendees4Chart', 'Atendees 4 Chart (SVG)'));
     $fields->addFieldsToTab("Root.AtendeesChart", $upload_18 = new UploadField('Atendees4ChartPng', 'Atendees 4 Chart (PNG)'));
     $upload_9->setFolderName('summits/overview');
     $upload_9->setAllowedMaxFileNumber(1);
     $upload_9->setAllowedExtensions(array('svg'));
     $upload_9->setOverwriteWarning(false);
     $upload_9->getUpload()->setReplaceFile(true);
     $upload_10->setFolderName('summits/overview');
     $upload_10->setAllowedMaxFileNumber(1);
     $upload_10->setAllowedExtensions(array('svg'));
     $upload_10->setOverwriteWarning(false);
     $upload_10->getUpload()->setReplaceFile(true);
     $upload_11->setFolderName('summits/overview');
     $upload_11->setAllowedMaxFileNumber(1);
     $upload_11->setAllowedExtensions(array('svg'));
     $upload_11->setOverwriteWarning(false);
     $upload_11->getUpload()->setReplaceFile(true);
     $upload_12->setFolderName('summits/overview');
     $upload_12->setAllowedMaxFileNumber(1);
     $upload_12->setAllowedExtensions(array('svg'));
     $upload_12->setOverwriteWarning(false);
     $upload_12->getUpload()->setReplaceFile(true);
     $upload_13->setFolderName('summits/overview');
     $upload_13->setAllowedMaxFileNumber(1);
     $upload_13->setAllowedExtensions(array('svg'));
     $upload_13->setOverwriteWarning(false);
     $upload_13->getUpload()->setReplaceFile(true);
     $upload_15->setFolderName('summits/overview');
     $upload_15->setAllowedMaxFileNumber(1);
     $upload_15->setAllowedExtensions(array('png'));
     $upload_15->setOverwriteWarning(false);
     $upload_15->getUpload()->setReplaceFile(true);
     $upload_16->setFolderName('summits/overview');
     $upload_16->setAllowedMaxFileNumber(1);
     $upload_16->setAllowedExtensions(array('png'));
     $upload_16->setOverwriteWarning(false);
     $upload_16->getUpload()->setReplaceFile(true);
     $upload_17->setFolderName('summits/overview');
     $upload_17->setAllowedMaxFileNumber(1);
     $upload_17->setAllowedExtensions(array('png'));
     $upload_17->setOverwriteWarning(false);
     $upload_17->getUpload()->setReplaceFile(true);
     $upload_18->setFolderName('summits/overview');
     $upload_18->setAllowedMaxFileNumber(1);
     $upload_18->setAllowedExtensions(array('png'));
     $upload_18->setOverwriteWarning(false);
     $upload_18->getUpload()->setReplaceFile(true);
     $upload_19->setFolderName('summits/overview');
     $upload_19->setAllowedMaxFileNumber(1);
     $upload_19->setAllowedExtensions(array('png'));
     $upload_19->setOverwriteWarning(false);
     $upload_19->getUpload()->setReplaceFile(true);
     //summit timeline
     $fields->addFieldToTab("Root.Timeline", new TextField('TimelineCaption', 'Timeline Caption'));
     $fields->addFieldsToTab("Root.Timeline", $upload_14 = new UploadField('TimelineImage', 'Timeline (SVG)'));
     $fields->addFieldsToTab("Root.Timeline", $upload_20 = new UploadField('TimelineImagePng', 'Timeline (PNG)'));
     $upload_14->setFolderName('summits/overview');
     $upload_14->setAllowedMaxFileNumber(1);
     $upload_14->setAllowedExtensions(array('svg'));
     $upload_14->setOverwriteWarning(false);
     $upload_14->getUpload()->setReplaceFile(true);
     $upload_20->setFolderName('summits/overview');
     $upload_20->setAllowedMaxFileNumber(1);
     $upload_20->setAllowedExtensions(array('png'));
     $upload_20->setOverwriteWarning(false);
     $upload_20->getUpload()->setReplaceFile(true);
     return $fields;
 }
Пример #27
0
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName('Content');
     $fields->addFieldToTab('Root.Main', new LiteralField('HideSections', '<label>Hide Sections</label><hr>'));
     $fields->addFieldToTab('Root.Main', new CheckboxField('HideFee', 'Hide Exam Fee and Pricing'));
     $fields->addFieldToTab('Root.Main', new CheckboxField('HidePurchaseExam', 'Hide Purchase Exam Section'));
     $fields->addFieldToTab('Root.Main', new CheckboxField('HideVirtualExam', 'Hide Virtual Exam Section'));
     $fields->addFieldToTab('Root.Main', new CheckboxField('HideHowGetStarted', 'Hide How to get started Section'));
     $fields->addFieldToTab('Root.Main', new TextField('BannerTitle', 'Banner Title'));
     $fields->addFieldToTab('Root.Main', $banner_html = new HtmlEditorField('BannerText', 'Banner Text'));
     $banner_html->setRows(5);
     $fields->addFieldToTab('Root.Main', $how_html = new HtmlEditorField('GetStartedText', 'How to Get Started'));
     $how_html->setRows(5);
     $fields->addFieldToTab('Root.Main', new TextField('HandBookLink', 'HandBook Link'));
     $fields->addFieldToTab('Root.Main', new TextField('GetStartedURL', 'Get Started URL'));
     $fields->addFieldToTab('Root.Main', new TextField('GetStartedLabel', 'Get Started Label'));
     $fields->addFieldToTab('Root.Main', new TextField('AlreadyRegisteredURL', 'Already Registered URL'));
     // exam details
     $fields->addFieldToTab('Root.ExamDetails', $html_details = new HtmlEditorField('ExamDetails', 'Details Title'));
     $html_details->setRows(5);
     $fields->addFieldToTab('Root.ExamDetails', new TextField('ExamCost', 'Cost (include currency sign)'));
     $fields->addFieldToTab('Root.ExamDetails', new TextField('ExamDuration', 'Duration ( include time unit)'));
     $fields->addFieldToTab('Root.ExamDetails', $html_format = new HtmlEditorField('ExamFormat', 'Format'));
     $html_format->setRows(5);
     $fields->addFieldToTab('Root.ExamDetails', $html_req = new HtmlEditorField('ExamIDRequirements', 'ID Requirements'));
     $html_req->setRows(5);
     $fields->addFieldToTab('Root.ExamDetails', $html_system = new HtmlEditorField('ExamSystemRequirements', 'System Requirements'));
     $html_system->setRows(5);
     $fields->addFieldToTab('Root.ExamDetails', $html_score = new HtmlEditorField('ExamScoring', 'Scoring'));
     $html_score->setRows(5);
     $fields->addFieldToTab('Root.ExamDetails', $html_lang = new HtmlEditorField('ExamLanguage', 'Language'));
     $html_lang->setRows(5);
     $fields->addFieldToTab('Root.ExamDetails', $html_duration = new HtmlEditorField('ExamHowLongSchedule', 'How long do I have to schedule my exam?'));
     $html_duration->setRows(5);
     $fields->addFieldToTab('Root.ExamDetails', $html_retake = new HtmlEditorField('ExamRetake', 'Retake'));
     $html_retake->setRows(5);
     if ($this->ID > 0) {
         $logo_field = new UploadField('HeroImage', 'Hero Image');
         $logo_field->setAllowedMaxFileNumber(1);
         $logo_field->setAllowedFileCategories('image');
         $logo_field->setFolderName('coa/hero_images/');
         $logo_field->getValidator()->setAllowedMaxFileSize(1048576);
         $fields->addFieldToTab('Root.Main', $logo_field);
         $config = GridFieldConfig_RelationEditor::create();
         $config->removeComponentsByType('GridFieldEditButton');
         $config->removeComponentsByType('GridFieldAddNewButton');
         $config->addComponent($sort = new GridFieldSortableRows('Order'));
         $partners = new GridField('TrainingPartners', 'Training Partners', $this->TrainingPartners(), $config);
         $fields->addFieldsToTab('Root.TrainingPartners', $partners);
     }
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     // Optional Sponsor Alert
     $sponsorAlertField = new TextField('SponsorAlert', 'Sponsor Alert');
     $fields->addFieldToTab('Root.Main', $sponsorAlertField);
     $fields->addFieldsToTab('Root.Main', new HtmlEditorField('SponsorIntro', 'Sponsor Intro Text'));
     $fields->addFieldsToTab('Root.Main', new HtmlEditorField('HowToSponsorContent', 'How To Sponsor (Bottom)'));
     $fields->addFieldsToTab('Root.Main', new HtmlEditorField('VenueMapContent', 'Venue Map Content'));
     // Sponsor Steps Editor
     $sponsorStepsField = new HTMLEditorField('SponsorSteps', 'Steps To Become A Sponsor');
     $fields->addFieldToTab('Root.Main', $sponsorStepsField, 'Content');
     //call for sponsorship dates
     $start_date = new DatetimeField('CallForSponsorShipStartDate', 'Call For SponsorShip - Start Date');
     $end_date = new DatetimeField('CallForSponsorShipEndDate', 'Call For SponsorShip - End Date');
     $start_date->getDateField()->setConfig('showcalendar', true);
     $start_date->setConfig('dateformat', 'dd/MM/yyyy');
     $end_date->getDateField()->setConfig('showcalendar', true);
     $end_date->setConfig('dateformat', 'dd/MM/yyyy');
     $fields->addFieldToTab('Root.Main', $start_date);
     $fields->addFieldToTab('Root.Main', $end_date);
     if ($this->ID) {
         //set current page id
         $_REQUEST["PageId"] = $this->ID;
         // Summit Packages
         $config = GridFieldConfig_RelationEditor::create();
         $config->addComponent(new GridFieldSortableRows('Order'));
         $gridField = new GridField('SummitPackages', 'Sponsor Packages', $this->SummitPackages(), $config);
         $fields->addFieldToTab('Root.Packages', $gridField);
         // Summit Add Ons
         $config = GridFieldConfig_RelationEditor::create();
         $config->addComponent(new GridFieldSortableRows('Order'));
         // Remove pagination so that you can sort all add-ons collectively
         $config->removeComponentsByType('GridFieldPaginator');
         $config->removeComponentsByType('GridFieldPageCount');
         $gridField = new GridField('SummitAddOn', 'Sponsor Add Ons', $this->SummitAddOns(), $config);
         $fields->addFieldToTab('Root.AddOns', $gridField);
         $prospectusField = new TextField('SponsorProspectus');
         $fields->addFieldToTab('Root.ProspectusAndContract', $prospectusField);
         $contractField = new TextField('SponsorContract');
         $fields->addFieldToTab('Root.ProspectusAndContract', $contractField);
         // sponsors
         $companies = new GridField('Companies', 'Sponsors', $this->Companies(), GridFieldConfig_RelationEditor::create(10));
         $companies->getConfig()->removeComponentsByType('GridFieldEditButton');
         $companies->getConfig()->removeComponentsByType('GridFieldAddNewButton');
         $companies->getConfig()->getComponentByType('GridFieldDataColumns')->setDisplayFields(array('Name' => 'Name', "DDLSponsorshipType" => "Sponsorship Type", "InputSubmitPageUrl" => "Sponsor Link"));
         $fields->addFieldToTab('Root.SponsorCompanies', $companies);
         $fields->addFieldsToTab("Root.Main", $upload_0 = new UploadField('CrowdImage', 'Crowd Image'));
         $fields->addFieldsToTab("Root.Main", $upload_1 = new UploadField('ExhibitImage', 'Exhibit Image'));
         $upload_0->setFolderName('summits/sponsorship/backgroun');
         $upload_0->setAllowedMaxFileNumber(1);
         $upload_0->setAllowedFileCategories('image');
         $upload_1->setFolderName('summits/sponsorship/background');
         $upload_1->setAllowedMaxFileNumber(1);
         $upload_1->setAllowedFileCategories('image');
         //audience
         $config = GridFieldConfig_RecordEditor::create();
         $config->addComponent($sort = new GridFieldSortableRows('Order'));
         $gridField = new GridField('AttendeesByRegion', 'Attendees By Region', $this->AttendeesByRegion(), $config);
         $fields->add($gridField);
         $config = GridFieldConfig_RecordEditor::create();
         $config->addComponent($sort = new GridFieldSortableRows('Order'));
         $gridField = new GridField('AttendeesByRoles', 'Attendees By Roles', $this->AttendeesByRoles(), $config);
         $fields->add($gridField);
     }
     $fields->addFieldsToTab('Root.Audience', new CheckboxField('ShowAudience', 'Show Audience'));
     $fields->addFieldsToTab('Root.Audience', new HtmlEditorField('AudienceIntro', 'Intro'));
     $fields->addFieldsToTab('Root.Audience', new TextField('AudienceMetricsTitle', 'Metrics Title'));
     $fields->addFieldsToTab('Root.Audience', new TextField('AudienceTotalSummitAttendees', 'Total Summit Attendees'));
     $fields->addFieldsToTab('Root.Audience', new TextField('AudienceCompaniesRepresented', 'Companies Represented'));
     $fields->addFieldsToTab('Root.Audience', new TextField('AudienceCountriesRepresented', 'Countries Represented'));
     return $fields;
 }
Пример #29
0
 public function updateCMSFields(FieldList $f)
 {
     //clear all fields
     $oldFields = $f->toArray();
     foreach ($oldFields as $field) {
         $f->remove($field);
     }
     $_REQUEST['SummitID'] = $this->owner->ID;
     $f->add($rootTab = new TabSet("Root", $tabMain = new Tab('Main')));
     $summit_time_zone = null;
     if ($this->owner->TimeZone) {
         $time_zone_list = timezone_identifiers_list();
         $summit_time_zone = $time_zone_list[$this->owner->TimeZone];
     }
     if ($this->owner->RandomVotingLists()->exists()) {
         $f->addFieldToTab('Root.Main', HeaderField::create('The presentations in this summit have been randomised for voting', 4));
     }
     $f->addFieldToTab('Root.Main', new TextField('Title', 'Title'));
     $f->addFieldToTab('Root.Main', $link = new TextField('Link', 'Summit Page Link'));
     $link->setDescription('The link to the site page for this summit. Eg: <em>/summit/vancouver-2015/</em>');
     $f->addFieldToTab('Root.Main', new CheckboxField('Active', 'This is the active summit'));
     $f->addFieldToTab('Root.Main', $date_label = new TextField('DateLabel', 'Date label'));
     $date_label->setDescription('A readable piece of text representing the date, e.g. <em>May 12-20, 2015</em> or <em>December 2016</em>');
     $f->addFieldToTab('Root.Main', $registration_link = new TextField('RegistrationLink', 'Registration Link'));
     $registration_link->setDescription('Link to the site where tickets can be purchased.');
     $f->addFieldsToTab('Root.Dates', $ddl_timezone = new DropdownField('TimeZone', 'Time Zone', DateTimeZone::listIdentifiers()));
     $ddl_timezone->setEmptyString('-- Select a Timezone --');
     if ($summit_time_zone) {
         $f->addFieldToTab('Root.Dates', new HeaderField("All dates below are in <span style='color:red;'>{$summit_time_zone}</span> time."));
     } else {
         $f->addFieldToTab('Root.Dates', new HeaderField("All dates below in the timezone of the summit's venue."));
     }
     $f->addFieldToTab('Root.Dates', $date = new DatetimeField('SummitBeginDate', "When does the summit begin?"));
     $date->getDateField()->setConfig('showcalendar', true);
     $date->getDateField()->setConfig('dateformat', 'dd/MM/yyyy');
     $f->addFieldToTab('Root.Dates', $date = new DatetimeField('SummitEndDate', "When does the summit end?"));
     $date->getDateField()->setConfig('showcalendar', true);
     $date->getDateField()->setConfig('dateformat', 'dd/MM/yyyy');
     $f->addFieldToTab('Root.Dates', $date = new DatetimeField('StartShowingVenuesDate', "When do you begin showing venues?"));
     $date->getDateField()->setConfig('showcalendar', true);
     $date->getDateField()->setConfig('dateformat', 'dd/MM/yyyy');
     $f->addFieldToTab('Root.Dates', $date = new DatetimeField('SubmissionBeginDate', "When do submissions begin?"));
     $date->getDateField()->setConfig('showcalendar', true);
     $date->getDateField()->setConfig('dateformat', 'dd/MM/yyyy');
     $f->addFieldToTab('Root.Dates', $date = new DatetimeField('SubmissionEndDate', "When do submissions end?"));
     $date->getDateField()->setConfig('showcalendar', true);
     $date->getDateField()->setConfig('dateformat', 'dd/MM/yyyy');
     $f->addFieldToTab('Root.Dates', $date = new DatetimeField('VotingBeginDate', "When does voting begin?"));
     $date->getDateField()->setConfig('showcalendar', true);
     $date->getDateField()->setConfig('dateformat', 'dd/MM/yyyy');
     $f->addFieldToTab('Root.Dates', $date = new DatetimeField('VotingEndDate', "When does voting end?"));
     $date->getDateField()->setConfig('showcalendar', true);
     $date->getDateField()->setConfig('dateformat', 'dd/MM/yyyy');
     $f->addFieldToTab('Root.Dates', $date = new DatetimeField('SelectionBeginDate', "When do selections begin?"));
     $date->getDateField()->setConfig('showcalendar', true);
     $date->getDateField()->setConfig('dateformat', 'dd/MM/yyyy');
     $f->addFieldToTab('Root.Dates', $date = new DatetimeField('SelectionEndDate', "When do selections end?"));
     $date->getDateField()->setConfig('showcalendar', true);
     $date->getDateField()->setConfig('dateformat', 'dd/MM/yyyy');
     $f->addFieldToTab('Root.Dates', $date = new DatetimeField('RegistrationBeginDate', "When does registration begin?"));
     $date->getDateField()->setConfig('showcalendar', true);
     $date->getDateField()->setConfig('dateformat', 'dd/MM/yyyy');
     $f->addFieldToTab('Root.Dates', $date = new DatetimeField('RegistrationEndDate', "When does registration end?"));
     $date->getDateField()->setConfig('showcalendar', true);
     $date->getDateField()->setConfig('dateformat', 'dd/MM/yyyy');
     $f->addFieldToTab('Root.Dates', $date = new DateField('ScheduleDefaultStartDate', "Default Start Date to show on schedule page?"));
     $date->setConfig('showcalendar', true);
     $date->setConfig('dateformat', 'dd/MM/yyyy');
     $f->addFieldsToTab('Root.Main', new NumericField('MaxSubmissionAllowedPerUser', 'Max. Submission Allowed Per User'));
     $logo_field = new UploadField('Logo', 'Logo');
     $logo_field->setAllowedMaxFileNumber(1);
     $logo_field->setAllowedFileCategories('image');
     $logo_field->setFolderName('summits/logos/');
     $logo_field->getValidator()->setAllowedMaxFileSize(1024 * 1024 * 1);
     $f->addFieldToTab('Root.Main', $logo_field);
     $f->addFieldToTab('Root.Main', new TextField('ComingSoonBtnText', 'Coming Soon Btn Text'));
     $f->addFieldToTab('Root.Main', new TextField('ExternalEventId', 'Eventbrite Event Id'));
     if ($this->owner->ID > 0) {
         $summit_id = $this->owner->ID;
         // tracks
         $config = GridFieldConfig_RecordEditor::create(25);
         $categories = new GridField('Categories', 'Presentation Categories', $this->owner->getCategories(), $config);
         $f->addFieldToTab('Root.Presentation Categories', $categories);
         $config = GridFieldConfig_RelationEditor::create(25);
         $config->removeComponentsByType(new GridFieldDataColumns());
         $config->removeComponentsByType(new GridFieldDetailForm());
         $config->addComponent(new GridFieldUpdateDefaultCategoryTags());
         $default_tags = new GridField('CategoryDefaultTags', 'Category Default Tags', $this->owner->CategoryDefaultTags(), $config);
         $completer = $config->getComponentByType('GridFieldAddExistingAutocompleter');
         $completer->setResultsFormat('$Tag');
         $completer->setSearchFields(array('Tag'));
         $completer->setSearchList(Tag::get());
         $editconf = new GridFieldDetailForm();
         $editconf->setFields(FieldList::create(TextField::create('Tag', 'Tag'), DropdownField::create('ManyMany[Group]', 'Group', array('topics' => 'Topics', 'speaker' => 'Speaker', 'openstack projects mentioned' => 'OpenStack Projects Mentioned'))));
         $summaryfieldsconf = new GridFieldDataColumns();
         $summaryfieldsconf->setDisplayFields(array('Tag' => 'Tag', 'Group' => 'Group'));
         $config->addComponent($editconf);
         $config->addComponent($summaryfieldsconf, new GridFieldFilterHeader());
         $f->addFieldToTab('Root.Presentation Categories', $default_tags);
         // track groups
         $config = GridFieldConfig_RecordEditor::create(25);
         $config->removeComponentsByType('GridFieldAddNewButton');
         $multi_class_selector = new GridFieldAddNewMultiClass();
         $multi_class_selector->setClasses(array('PresentationCategoryGroup' => 'Category Group', 'PrivatePresentationCategoryGroup' => 'Private Category Group'));
         $config->addComponent($multi_class_selector);
         $categories = new GridField('CategoryGroups', 'Category Groups', $this->owner->CategoryGroups(), $config);
         $f->addFieldToTab('Root.Category Groups', $categories);
         // locations
         $config = GridFieldConfig_RecordEditor::create();
         $config->removeComponentsByType('GridFieldAddNewButton');
         $multi_class_selector = new GridFieldAddNewMultiClass();
         $multi_class_selector->setClasses(array('SummitVenue' => 'Venue', 'SummitHotel' => 'Hotel', 'SummitAirport' => 'Airport', 'SummitExternalLocation' => 'External Location'));
         $config->addComponent($multi_class_selector);
         $config->addComponent($sort = new GridFieldSortableRows('Order'));
         $gridField = new GridField('Locations', 'Locations', $this->owner->Locations()->where("ClassName <> 'SummitVenueRoom' "), $config);
         $f->addFieldToTab('Root.Locations', $gridField);
         // types
         $config = GridFieldConfig_RecordEditor::create();
         $config->addComponent(new GridFieldAddDefaultSummitTypes());
         $gridField = new GridField('SummitTypes', 'SummitTypes', $this->owner->Types(), $config);
         $f->addFieldToTab('Root.SummitTypes', $gridField);
         // event types
         $config = GridFieldConfig_RecordEditor::create();
         $config->addComponent(new GridFieldAddDefaultEventTypes());
         $gridField = new GridField('EventTypes', 'EventTypes', $this->owner->EventTypes(), $config);
         $f->addFieldToTab('Root.EventTypes', $gridField);
         //schedule
         $config = GridFieldConfig_RecordEditor::create(25);
         $config->addComponent(new GridFieldAjaxRefresh(1000, false));
         $config->removeComponentsByType('GridFieldDeleteAction');
         $gridField = new GridField('Schedule', 'Schedule', $this->owner->Events()->filter('Published', true)->sort(array('StartDate' => 'ASC', 'EndDate' => 'ASC')), $config);
         $config->getComponentByType("GridFieldDataColumns")->setFieldCasting(array("Description" => "HTMLText->BigSummary"));
         $f->addFieldToTab('Root.Schedule', $gridField);
         $config->addComponent(new GridFieldPublishSummitEventAction());
         // events
         $config = GridFieldConfig_RecordEditor::create(25);
         $config->addComponent(new GridFieldPublishSummitEventAction());
         $config->addComponent(new GridFieldAjaxRefresh(1000, false));
         $config->addComponent($bulk_summit_types = new GridFieldBulkActionAssignSummitTypeSummitEvents());
         $bulk_summit_types->setTitle('Set Summit Type');
         $gridField = new GridField('Events', 'Events', $this->owner->Events()->filter('ClassName', 'SummitEvent'), $config);
         $config->getComponentByType("GridFieldDataColumns")->setFieldCasting(array("Description" => "HTMLText->BigSummary"));
         $f->addFieldToTab('Root.Events', $gridField);
         //track selection list presentations
         $config = GridFieldConfig_RecordEditor::create(25);
         $gridField = new GridField('TrackChairsSelectionLists', 'TrackChairs Selection Lists', SummitSelectedPresentationList::get()->filter('ListType', 'Group')->where(' CategoryID IN ( SELECT ID FROM PresentationCategory WHERE SummitID = ' . $summit_id . ')'), $config);
         $f->addFieldToTab('Root.TrackChairs Selection Lists', $gridField);
         // attendees
         $config = GridFieldConfig_RecordEditor::create(25);
         $gridField = new GridField('Attendees', 'Attendees', $this->owner->Attendees(), $config);
         $f->addFieldToTab('Root.Attendees', $gridField);
         //tickets types
         $config = GridFieldConfig_RecordEditor::create(25);
         $gridField = new GridField('SummitTicketTypes', 'Ticket Types', $this->owner->SummitTicketTypes(), $config);
         $f->addFieldToTab('Root.TicketTypes', $gridField);
         // promo codes
         $config = GridFieldConfig_RecordEditor::create(50);
         $config->removeComponentsByType('GridFieldAddNewButton');
         $multi_class_selector = new GridFieldAddNewMultiClass();
         $multi_class_selector->setClasses(array('SpeakerSummitRegistrationPromoCode' => 'Speaker Promo Code'));
         $config->addComponent($multi_class_selector);
         $promo_codes = new GridField('SummitRegistrationPromoCodes', 'Registration Promo Codes', $this->owner->SummitRegistrationPromoCodes(), $config);
         $f->addFieldToTab('Root.RegistrationPromoCodes', $promo_codes);
         // speakers
         $config = GridFieldConfig_RecordEditor::create(25);
         $gridField = new GridField('Speakers', 'Speakers', $this->owner->Speakers(false), $config);
         $config->getComponentByType("GridFieldDataColumns")->setFieldCasting(array("Bio" => "HTMLText->BigSummary"));
         $f->addFieldToTab('Root.Speakers', $gridField);
         // presentations
         $config = GridFieldConfig_RecordEditor::create(25);
         $config->addComponent(new GridFieldPublishSummitEventAction());
         $config->addComponent(new GridFieldAjaxRefresh(1000, false));
         $config->addComponent($bulk_summit_types = new GridFieldBulkActionAssignSummitTypeSummitEvents());
         $bulk_summit_types->setTitle('Set Summit Type');
         $gridField = new GridField('Presentations', 'Presentations', $this->owner->Presentations()->where(" Title IS NOT NULL AND Title <>'' "), $config);
         $config->getComponentByType("GridFieldDataColumns")->setFieldCasting(array("Description" => "HTMLText->BigSummary"));
         $f->addFieldToTab('Root.Presentations', $gridField);
         // push notifications
         $config = GridFieldConfig_RecordEditor::create(25);
         $config->addComponent(new GridFieldAjaxRefresh(1000, false));
         $config->getComponentByType('GridFieldDataColumns')->setDisplayFields(array('Channel' => 'Channel', 'Message' => 'Message', 'Owner.FullName' => 'Owner', 'IsSent' => 'Is Sent?', 'SentDate' => 'Sent Date'));
         $config->getComponentByType('GridFieldDetailForm')->setItemRequestClass('GridFieldDetailFormPushNotification');
         $gridField = new GridField('Notifications', 'Notifications', $this->owner->Notifications(), $config);
         $f->addFieldToTab('Root.PushNotifications', $gridField);
         //entity events
         $config = GridFieldConfig_RecordEditor::create(25);
         $config->addComponent(new GridFieldAjaxRefresh(1000, false));
         $config->addComponent(new GridFieldWipeDevicesDataAction());
         $config->addComponent(new GridFieldDeleteAllSummitEntityEventsAction());
         $config->removeComponentsByType('GridFieldAddNewButton');
         $gridField = new GridField('EntityEvents', 'EntityEvents', $this->owner->EntityEvents(), $config);
         $f->addFieldToTab('Root.EntityEvents', $gridField);
         //TrackChairs
         $config = GridFieldConfig_RecordEditor::create(25);
         $config->addComponent(new GridFieldAjaxRefresh(1000, false));
         $gridField = new GridField('TrackChairs', 'TrackChairs', $this->owner->TrackChairs(), $config);
         $f->addFieldToTab('Root.TrackChairs', $gridField);
         //RSVP templates
         $config = GridFieldConfig_RecordEditor::create(40);
         $config->addComponent(new GridFieldAjaxRefresh(1000, false));
         $gridField = new GridField('RSVPTemplates', 'RSVPTemplates', $this->owner->RSVPTemplates(), $config);
         $f->addFieldToTab('Root.RSVPTemplates', $gridField);
     }
 }
Пример #30
0
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName('Content');
     $fields->addFieldToTab('Root.Main', new TextField('BannerTitle', 'Banner Title'));
     $fields->addFieldToTab('Root.Main', new HtmlEditorField('BannerText', 'Banner Text'));
     $fields->addFieldToTab('Root.Main', new HtmlEditorField('GetStartedText', 'How to Get Started'));
     $fields->addFieldToTab('Root.Main', new TextField('HandBookLink', 'HandBook Link'));
     $fields->addFieldToTab('Root.Main', new TextField('GetStartedURL', 'Get Started URL'));
     $fields->addFieldToTab('Root.Main', new TextField('AlreadyRegisteredURL', 'Already Registered URL'));
     // exam details
     $fields->addFieldToTab('Root.ExamDetails', new HtmlEditorField('ExamDetails', 'Details Title'));
     $fields->addFieldToTab('Root.ExamDetails', new TextField('ExamCost', 'Cost (include currency sign)'));
     $fields->addFieldToTab('Root.ExamDetails', new TextField('ExamDuration', 'Duration ( include time unit)'));
     $fields->addFieldToTab('Root.ExamDetails', new HtmlEditorField('ExamFormat', 'Format'));
     $fields->addFieldToTab('Root.ExamDetails', new HtmlEditorField('ExamIDRequirements', 'ID Requirements'));
     $fields->addFieldToTab('Root.ExamDetails', new HtmlEditorField('ExamSystemRequirements', 'System Requirements'));
     $fields->addFieldToTab('Root.ExamDetails', new HtmlEditorField('ExamScoring', 'Scoring'));
     $fields->addFieldToTab('Root.ExamDetails', new HtmlEditorField('ExamLanguage', 'Language'));
     $fields->addFieldToTab('Root.ExamDetails', new HtmlEditorField('ExamHowLongSchedule', 'How long do I have to schedule my exam?'));
     if ($this->ID > 0) {
         $logo_field = new UploadField('HeroImage', 'Hero Image');
         $logo_field->setAllowedMaxFileNumber(1);
         $logo_field->setAllowedFileCategories('image');
         $logo_field->setFolderName('coa/hero_images/');
         $logo_field->getValidator()->setAllowedMaxFileSize(1048576);
         $fields->addFieldToTab('Root.Main', $logo_field);
         $config = GridFieldConfig_RelationEditor::create();
         $config->removeComponentsByType('GridFieldEditButton');
         $config->removeComponentsByType('GridFieldAddNewButton');
         $config->addComponent($sort = new GridFieldSortableRows('Order'));
         $partners = new GridField('TrainingPartners', 'Training Partners', $this->TrainingPartners(), $config);
         $fields->addFieldsToTab('Root.TrainingPartners', $partners);
     }
     return $fields;
 }