예제 #1
0
 /**
  * Get CMS fields
  * 
  * @return FieldList
  */
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName('TeamMembers');
     $fields->addFieldToTab('Root.Main', GridField::create('TeamMembers', 'Team Members', $this->TeamMembers(), GridFieldConfig_RecordEditor::create()->addComponent(new GridFieldSortableRows('SortOrder'))));
     return $fields;
 }
예제 #2
0
 /**
  * Get Cms fields
  * 
  * @return FieldList
  */
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName('ActionBoxes');
     $fields->removeFieldsFromTab('Root.Main', array('Content'));
     $fields->addFieldToTab('Root.Main', GridField::create('ActionBoxes', 'Action Boxes', $this->ActionBoxes(), GridFieldConfig_RecordEditor::create()->addComponent(new GridFieldSortableRows('SortOrder'))));
     return $fields;
 }
예제 #3
0
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $tinyMce = HtmlEditorField::create('Content', _t('TextBlock.CONTENT', 'Content'));
     $fields->addFieldToTab('Root.Main', $tinyMce);
     $this->extend('updateCMSFields', $fields);
     return $fields;
 }
예제 #4
0
 /**
  * Get CMS fields
  * 
  * @return FieldList
  */
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeFieldsFromTab('Root.Main', array('BackgroundImage', 'Items'));
     $fields->removeByName('SpinningBanners');
     $fields->addFieldToTab('Root.Main', GridField::create('SpinningBanners', 'Spinning Banners', $this->SpinningBanners(), GridFieldConfig_RecordEditor::create()->addComponent(new GridFieldSortableRows('SortOrder'))));
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldsToTab("Root.Employee", new TextField('Name', 'Name'));
     $fields->addFieldsToTab("Root.Employee", new TextField('Phone', 'Phone'));
     $fields->addFieldsToTab("Root.Employee", new TextField('Email', 'Email'));
     return $fields;
 }
예제 #6
0
 /**
  * Get CMS Fields
  * 
  * @return FieldList
  */
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->insertAfter($fields->dataFieldByName('ButtonText'), 'Content');
     $fields->insertAfter($fields->dataFieldByName('RedirectPageID'), 'ButtonText');
     $fields->dataFieldByName('Content')->setRows(20);
     $fields->replaceField('RedirectPageID', TreedropdownField::create('RedirectPageID', 'Choose a redirect page', 'SiteTree'));
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeFieldFromTab('Root', 'Links');
     $fields->addFieldToTab('Root.Main', HeaderField::create('LinksHeader', 'Quick Links'));
     if ($this->ID) {
         $fields->addFieldToTab('Root.Main', GridField::create('Links', 'Links', $this->getItems(), GridFieldConfig_RelationEditor::create()->addComponent(new GridFieldOrderableRows())->removeComponentsByType('GridFieldAddExistingAutocompleter')->addComponent(new GridFieldAddExistingSearchButton())));
     }
     return $fields;
 }
예제 #8
0
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $uploadField = null;
     if (class_exists('SortableUploadField')) {
         $uploadField = SortableUploadField::create('Images', _t('ImageBlock.IMAGES', 'Images'));
     } else {
         $uploadField = UploadField::create('Images', _t('ImageBlock.IMAGES', 'Images'));
     }
     $fields->addFieldToTab('Root.Main', $uploadField);
     $this->extend('updateCMSFields', $fields);
     return $fields;
 }
예제 #9
0
 /**
  * Get CMS Fields
  * 
  * @return FieldList
  */
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->dataFieldByName('Content')->setRows(20);
     $fields->replaceField('RedirectPageID', TreeDropdownField::create('RedirectPageID', 'Choose a redirect page', 'SiteTree'));
     $fields->dataFieldByName('Image')->setTitle('Featured Image')->setFolderName('BlockWidgetImage/' . $this->ID . '/Images');
     $fields->insertAfter($fields->dataFieldByName('Position')->setTitle('Image position'), 'Title');
     $fields->insertAfter($fields->dataFieldByName('Content'), 'Position');
     $fields->insertAfter($fields->dataFieldByName('Image'), 'Content');
     $fields->insertBefore($fields->dataFieldByName('ButtonText'), 'Image');
     $fields->insertBefore($fields->dataFieldByName('RedirectPageID'), 'Image');
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeFieldFromTab('Root', 'Items');
     if ($this->ID) {
         $config = GridFieldConfig_RecordEditor::create()->addComponent(new GridFieldOrderableRows());
         $grid = GridField::create('Items', 'Items', $this->Items()->filter('ParentID', 0), $config);
         $config->getComponentByType('GridFieldDataColumns')->setDisplayFields(array('Title' => 'Menu Item Title', 'Children.Count' => 'Num Children'));
         $fields->addFieldToTab('Root.Main', HeaderField::create('ItemsHeader', 'Menu Items'));
         $fields->addFieldToTab('Root.Main', $grid);
     }
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName(array('PageID', 'SortOrder', 'Active', 'Title', 'Content', 'Blocks', 'YoutubeVideoID', 'Images', 'Media', 'Files', 'Videos'));
     if ($this->ID) {
         $BlockConfig = GridFieldConfig_RelationEditor::create(20);
         $BlockConfig->addComponent(new GridFieldOrderableRows('SortOrder'));
         $BlockGF = new GridField('Blocks', 'Blocks', $this->Blocks(), $BlockConfig);
         $classes = array_values(ClassInfo::subclassesFor($BlockGF->getModelClass()));
         if (count($classes) > 1 && class_exists('GridFieldAddNewMultiClass')) {
             $BlockConfig->removeComponentsByType('GridFieldAddNewButton');
             $BlockConfig->addComponent(new GridFieldAddNewMultiClass());
         }
         $fields->addFieldToTab("Root.Main", $BlockGF);
     }
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName('ExcludeItems');
     $fields->removeByName('SourceID');
     $pageClasses = SiteTree::page_type_classes();
     $pageTypes = array();
     foreach ($pageClasses as $class) {
         $pageTypes[$class] = singleton($class)->i18n_singular_name();
     }
     $fields->addFieldsToTab('Root.Main', array(CheckboxField::create('EnforceShowInMenu', _t('ChildPageListBlock.EXCLUDEITEMSNOTINMENUS', "Exclude items which don't show in menus")), MultiValueListField::create('PageTypes', _t('ChildPageListBock.ONLYINCLUDETYPES', 'Only include these page types'), $pageTypes)->setRightTitle('Leave blank to include all types'), OptionsetField::create('AbsoluteSource', _t('ChildPageListBock.SOURCEOPTION', 'Source option'), array(false => _t('ChildPageListBock.SOURCECURRENTPAGE', 'Current page being viewed'), true => _t('ChildPageListBock.SOURCESPECIFICPAGE', 'A specific page'))), TreeDropdownField::create('SourceID', _t('ChildPageListBock.SOURCEPAGE', 'Source page'), 'SiteTree')->displayIf("AbsoluteSource")->isEqualTo(1)->end()));
     if ($this->AbsoluteSource) {
         $kids = $this->Source()->AllChildren();
         if ($kids && $kids->Count()) {
             $fields->addFieldToTab('Root.Main', MultiValueListField::create('ExcludeItems', _t('ChildPageListBock.EXCLUDECHILDREN', 'Exclude these children'), $kids->map('ID', 'Title'))->displayIf("AbsoluteSource")->isEqualTo(1)->end());
         }
     }
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     // field to enter the video URL
     $externalField = TextField::create('ExternalMedia', _t('VideoBlock.VIDEO_URL', 'Video URL'));
     // field for video aspect-ratio
     $ratios = Config::inst()->get('VideoBlock', 'aspect_ratios');
     $ratioField = null;
     if (is_array($ratios)) {
         $values = array();
         foreach ($ratios as $ratio) {
             if (preg_match('{(\\d+)/(\\d+)}', $ratio, $matches)) {
                 $float = number_format(intval($matches[2]) / intval($matches[1]), 6);
                 $values[$float] = $matches[0];
             } else {
                 if ($ratio == '0') {
                     $values['0'] = 'Automatic';
                 }
             }
         }
         if (count($values) > 0) {
             $ratioField = DropdownField::create('ManualRatio', _t('VideoBlock.ASPECT_RATIO', 'Aspect ratio'), $values);
         }
     }
     // preview thumbnail if media is set
     if ($this->MediaThumbID) {
         $thumb = $this->MediaThumb()->SetWidth(120);
         $fields->addFieldToTab('Root.Main', LiteralField::create('MediaThumb', '<div class="field"><div class="middleColumn">' . $thumb->Tag . '</div></div>'));
     }
     $fields->addFieldToTab('Root.Main', $externalField);
     if ($ratioField) {
         $fields->addFieldToTab('Root.Main', $ratioField);
     }
     $this->extend('updateCMSFields', $fields);
     return $fields;
 }
예제 #14
0
 /**
  * Get CMS Fields
  * 
  * @return FieldList
  */
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     return $fields;
 }
예제 #15
0
 /**
  * Get CMS fields
  * 
  * @return FieldList
  */
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->insertAfter($fields->dataFieldByName('Image')->setFolderName('Banners'), 'Content');
     return $fields;
 }