當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。