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


PHP Block::getCMSFields方法代码示例

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


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

示例1: getCMSFields

 /**
  * 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;
 }
开发者ID:sentromedia,项目名称:letsfund,代码行数:12,代码来源:BlockTeam.php

示例2: getCMSFields

 /**
  * 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;
 }
开发者ID:sentromedia,项目名称:letsfund,代码行数:13,代码来源:BlockActionBox.php

示例3: getCMSFields

 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;
 }
开发者ID:bummzack,项目名称:page-blocks,代码行数:8,代码来源:TextBlock.php

示例4: getCMSFields

 /**
  * 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;
 }
开发者ID:sentromedia,项目名称:letsfund,代码行数:13,代码来源:BlockSpinningBanner.php

示例5: getCMSFields

 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;
 }
开发者ID:sb-relaxt-at,项目名称:Silverstripe-Content-Blocks,代码行数:8,代码来源:_Employee.php

示例6: getCMSFields

 /**
  * 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;
 }
开发者ID:sentromedia,项目名称:letsfund,代码行数:14,代码来源:BlockText.php

示例7: getCMSFields

 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;
 }
开发者ID:helpfulrobot,项目名称:silverstripe-australia-ba-sis,代码行数:10,代码来源:LinksBlock.php

示例8: getCMSFields

 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;
 }
开发者ID:VisionaerAG,项目名称:page-blocks,代码行数:13,代码来源:ImageBlock.php

示例9: getCMSFields

 /**
  * 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;
 }
开发者ID:sentromedia,项目名称:letsfund,代码行数:18,代码来源:BlockImage.php

示例10: getCMSFields

 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;
 }
开发者ID:helpfulrobot,项目名称:silverstripe-australia-ba-sis,代码行数:13,代码来源:CustomMenuBlock.php

示例11: getCMSFields

 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;
 }
开发者ID:helpfulrobot,项目名称:kendu-silverstripe-content-blocks,代码行数:17,代码来源:MultiColumn.php

示例12: getCMSFields

 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;
 }
开发者ID:helpfulrobot,项目名称:silverstripe-australia-ba-sis,代码行数:19,代码来源:ChildPageListBlock.php

示例13: getCMSFields

 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;
 }
开发者ID:helpfulrobot,项目名称:bummzack-page-blocks,代码行数:36,代码来源:VideoBlock.php

示例14: getCMSFields

 /**
  * Get CMS Fields
  * 
  * @return FieldList
  */
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     return $fields;
 }
开发者ID:sentromedia,项目名称:letsfund,代码行数:10,代码来源:BlockForm.php

示例15: getCMSFields

 /**
  * Get CMS fields
  * 
  * @return FieldList
  */
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->insertAfter($fields->dataFieldByName('Image')->setFolderName('Banners'), 'Content');
     return $fields;
 }
开发者ID:sentromedia,项目名称:letsfund,代码行数:11,代码来源:BlockBanner.php


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