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


PHP FieldList::hasTabSet方法代码示例

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


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

示例1: testHasTabSet

 public function testHasTabSet()
 {
     $untabbedFields = new FieldList(new TextField('Field1'));
     $this->assertFalse($untabbedFields->hasTabSet());
     $tabbedFields = new FieldList(new TabSet('Root', new Tab('Tab1')));
     $this->assertTrue($tabbedFields->hasTabSet());
 }
开发者ID:normann,项目名称:sapphire,代码行数:7,代码来源:FieldListTest.php

示例2: updateCMSFields

 /**
  * Add FocusPoint field for selecting focus
  */
 public function updateCMSFields(FieldList $fields)
 {
     $f = new FocusPointField($this->owner);
     if ($fields->hasTabSet()) {
         $fields->addFieldToTab('Root.Main', $f);
     } else {
         $fields->add($f);
     }
 }
开发者ID:kashifmsidd,项目名称:silverstripe-focuspoint,代码行数:12,代码来源:FocusPointImage.php

示例3: updateCMSFields

 public function updateCMSFields(FieldList $fields)
 {
     if ($fields->hasTabSet()) {
         $fields->addFieldsToTab('Root.Address', $this->getAddressFields());
     } else {
         $newFields = $this->getAddressFields();
         foreach ($newFields as $field) {
             $fields->push($field);
         }
     }
 }
开发者ID:alexoconner,项目名称:silverstripe-addressable,代码行数:11,代码来源:Addressable.php

示例4: updateCMSFields

 public function updateCMSFields(FieldList $fields)
 {
     //Add FocusPoint field for selecting focus
     $f = new FocusPointField($name = "FocusXY", $title = "Focus point", $value = $this->owner->FocusX . ',' . $this->owner->FocusY, $imageID = $this->owner->ID);
     //$f->setValue(FocusPointField::sourceCoordsToFieldValue($this->owner->FocusX,$this->owner->FocusY));
     if ($fields->hasTabSet()) {
         $fields->addFieldToTab('Root.Main', $f);
     } else {
         $fields->add($f);
     }
 }
开发者ID:helpfulrobot,项目名称:jonom-focuspoint,代码行数:11,代码来源:FocusPointImage.php

示例5: updateFields

 /**
  * Extracts out the field updating since that could happen at a couple
  * different extension points.
  * @param FieldList $fields
  */
 protected function updateFields(FieldList $fields)
 {
     // This seemed to cause problems. Moved to config.yml.
     //Requirements::javascript(SHOP_EXTENDEDPRICING_FOLDER . '/javascript/ExtendedPricingAdmin.js');
     $newFields = array(new CheckboxField("PromoActive", "Promotional pricing active?"), new OptionsetField("PromoDisplay", "Display Settings", array("ShowDiscount" => "Show base price crossed out", "HideDiscount" => "Hide base price")), new OptionsetField("PromoType", "Type of discount", array("Percent" => "Percentage of subtotal (eg 25%)", "Amount" => "Fixed amount (eg \$25.00)")), new PercentageField("PromoPercent", "Percent discount"), new NumericField("PromoAmount", "Fixed discount (e.g. 5 = \$5 off)"), new FieldGroup("Valid date range (optional):", array(PromoDatetimeField::create("PromoStartDate", "Start Date / Time"), PromoDatetimeField::create("PromoEndDate", "End Date / Time (you should set the end time to 23:59:59, if you want to include the entire end day)"))));
     $f = new ToggleCompositeField('PromoFields', 'Promotional Pricing', $newFields);
     $f->setStartClosed(!$this->getOwner()->PromoActive);
     if ($fields->hasTabSet()) {
         $fields->addFieldToTab('Root.Pricing', $f);
     } else {
         $fields->push($f);
     }
 }
开发者ID:markguinn,项目名称:silverstripe-shop-extendedpricing,代码行数:18,代码来源:HasPromotionalPricing.php

示例6: updateFields

 /**
  * Extracts out the field updating since that could happen at a couple
  * different extension points.
  * @param FieldList $fields
  */
 protected function updateFields(FieldList $fields)
 {
     // pricing is handled on the variations instead if they are present
     if ($this->getOwner() instanceof Product && $this->getOwner()->Variations()->exists()) {
         return;
     }
     foreach (self::get_levels() as $code => $fieldName) {
         $newField = new TextField($fieldName, $this->getOwner()->fieldLabel($fieldName), '', 12);
         if ($fields->hasTabSet()) {
             $fields->addFieldToTab('Root.Pricing', $newField, 'CostPrice');
         } else {
             $fields->insertAfter($newField, 'Price');
         }
     }
 }
开发者ID:markguinn,项目名称:silverstripe-shop-extendedpricing,代码行数:20,代码来源:HasGroupPricing.php

示例7: updateCMSFields

 public function updateCMSFields(FieldList $fields)
 {
     // Present a set of checkboxes for filtering this item by locale
     $filterField = FieldGroup::create()->setTitle(_t('Fluent.LocaleFilter', 'Locale Filter'))->setDescription(_t('Fluent.LocaleFilterDescription', 'Check a locale to show this item on that locale'));
     foreach (Fluent::locales() as $locale) {
         $id = Fluent::db_field_for_locale("LocaleFilter", $locale);
         $fields->removeByName($id, true);
         // Remove existing (in case it was auto scaffolded)
         $title = i18n::get_locale_name($locale);
         $filterField->push(new CheckboxField($id, $title));
     }
     if ($fields->hasTabSet()) {
         $fields->findOrMakeTab('Root.Locales', _t('Fluent.TABLOCALES', 'Locales'));
         $fields->addFieldToTab('Root.Locales', $filterField);
     } else {
         $fields->add($filterField);
     }
 }
开发者ID:tractorcow,项目名称:silverstripe-fluent,代码行数:18,代码来源:FluentFilteredExtension.php

示例8: updateCMSFields

 public function updateCMSFields(FieldList $fields)
 {
     if (!($apiKey = Config::inst()->get('Aviary', 'ClientID'))) {
         return;
     }
     // load Aviary (js+css)
     Aviary::loadAviary();
     // Image pointer
     $aviaryImage = LiteralField::create('AviaryImage', '<img class="aviary_image" id="aviary_image_' . $this->owner->ID . '" src="' . $this->owner->URL . '" style="display: none;" />');
     // create edit button
     $editButton = FormAction::create('AviaryEditImage', _t('Aviary.EditImage', 'Edit Image'))->setAttribute('data-apikey', $apiKey)->setAttribute('data-localprocessing', Config::inst()->get('Aviary', 'LocalProcessing'));
     if ($fields->hasTabSet()) {
         $fields->insertAfter(CompositeField::create($editButton)->setName('AviaryEditImageWrapper'), 'ImageFull');
         $fields->insertAfter($aviaryImage, 'FilePreviewImage');
     } else {
         $fields->add(CompositeField::create($aviaryImage, $editButton));
     }
 }
开发者ID:novatio,项目名称:silverstripe-aviary,代码行数:18,代码来源:AviaryImageExtension.php

示例9: updateCMSFields

 public function updateCMSFields(FieldList $fields)
 {
     if (!$fields->hasTabSet()) {
         return $fields;
     }
     $tab = $fields->fieldByName('Root.Content') ? 'Root.Content.Media' : 'Root.Media';
     $fields->removeByName(SiteMedia::$plural_name);
     if ($this->owner->ShowSiteMedia() && $this->owner->ID) {
         //@todo implement shared
         $shared = false;
         $field = new GridField(SiteMedia::$plural_name, 'SiteMedia', $this->owner->SiteMedias(), GridFieldConfig_RelationEditor::create());
         $config = $field->getConfig();
         $config->removeComponentsByType('GridFieldDeleteAction');
         $config->addComponents(new GridFieldOrderableRows('SortOrder'), new GridFieldDeleteAction($shared));
         if (!$shared) {
             $config->removeComponentsByType('GridFieldAddExistingAutocompleter');
         }
         $config->getComponentByType('GridFieldAddNewButton')->setButtonName('Add Media');
         $field->setTitle('Media');
         $fields->addFieldToTab($tab, $field);
     }
     return $fields;
 }
开发者ID:helpfulrobot,项目名称:briceburg-silverstripe-sitemedia,代码行数:23,代码来源:SiteMediaDecoration.php

示例10: updateModerationFields

 /**
  * Add moderation functions to the current fieldlist
  *
  * @param FieldList $fields
  */
 protected function updateModerationFields(FieldList $fields)
 {
     Requirements::css(COMMENTS_DIR . '/css/cms.css');
     $newComments = $this->owner->AllComments()->filter('Moderated', 0);
     $newGrid = new CommentsGridField('NewComments', _t('CommentsAdmin.NewComments', 'New'), $newComments, CommentsGridFieldConfig::create());
     $approvedComments = $this->owner->AllComments()->filter('Moderated', 1)->filter('IsSpam', 0);
     $approvedGrid = new CommentsGridField('ApprovedComments', _t('CommentsAdmin.Comments', 'Approved'), $approvedComments, CommentsGridFieldConfig::create());
     $spamComments = $this->owner->AllComments()->filter('Moderated', 1)->filter('IsSpam', 1);
     $spamGrid = new CommentsGridField('SpamComments', _t('CommentsAdmin.SpamComments', 'Spam'), $spamComments, CommentsGridFieldConfig::create());
     $newCount = '(' . count($newComments) . ')';
     $approvedCount = '(' . count($approvedComments) . ')';
     $spamCount = '(' . count($spamComments) . ')';
     if ($fields->hasTabSet()) {
         $tabs = new TabSet('Comments', new Tab('CommentsNewCommentsTab', _t('CommentAdmin.NewComments', 'New') . ' ' . $newCount, $newGrid), new Tab('CommentsCommentsTab', _t('CommentAdmin.Comments', 'Approved') . ' ' . $approvedCount, $approvedGrid), new Tab('CommentsSpamCommentsTab', _t('CommentAdmin.SpamComments', 'Spam') . ' ' . $spamCount, $spamGrid));
         $fields->addFieldToTab('Root', $tabs);
     } else {
         $fields->push($newGrid);
         $fields->push($approvedGrid);
         $fields->push($spamGrid);
     }
 }
开发者ID:bhavesh1212310,项目名称:silverstripe-comments,代码行数:26,代码来源:CommentsExtension.php


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