本文整理汇总了PHP中Tab::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Tab::create方法的具体用法?PHP Tab::create怎么用?PHP Tab::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tab
的用法示例。
在下文中一共展示了Tab::create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
$fields->addFieldToTab('Root', Tab::create("GoogleAnalytics", _t('GoogleAnalyzer.TABTITLE', "Google Analytics")));
$fields->addFieldToTab("Root.GoogleAnalytics", TabSet::create("Stats", _t('GoogleAnalyzer.STATS', "Stats")));
$fields->addFieldToTab('Root.GoogleAnalytics.Stats', Tab::create("Performance", _t('GoogleAnalyzer.PERFORMANCE', "Performance")));
$fields->addFieldToTab("Root.GoogleAnalytics.Stats.Performance", new GooglePerformanceChart($this->owner));
}
示例2: getCMSFields
/**
* getCMSFields
* Construct the FieldList used in the CMS. To provide a
* smarter UI we don't use the scaffolding provided by
* parent::getCMSFields.
*
* @return FieldList
*/
public function getCMSFields()
{
Requirements::css('torindul-silverstripe-shop/css/LeftAndMain.css');
//Create the FieldList and push the Root TabSet on to it.
$fields = FieldList::create($root = TabSet::create('Root', Tab::create("Main", HeaderField::create("Add/Edit Currency"), CompositeField::create(DropdownField::create("Enabled", "Enable Currency?", array("1" => "Yes", "2" => "No"))->setRightTitle($this->SystemCreated == 1 ? "DISABLED: You can not disable the default currency." : "Select the country this zone applies to.")->setDisabled($this->SystemCreated == 1 ? true : false), TextField::create("Title", "Currency Name")->setRightTitle("i.e. Great British Pound."), TextField::create("Code", "Currency Code")->setRightTitle("i.e. GBP, USD, EUR."), TextField::create("ExchangeRate", "Exchange Rate")->setRightTitle("i.e. Your new currency is USD, a conversion rate of 1.53 may apply against the local currency."), TextField::create("Symbol", "Currency Symbol")->setRightTitle("i.e. £, \$, €."), DropdownField::create("SymbolLocation", "Symbol Location", array("1" => "On the left, i.e. \$1.00", "2" => "On the right, i.e. 1.00\$", "3" => "Display the currency code instead, i.e. 1 USD."))->setRightTitle("Where should the currency symbol be placed?"), TextField::create("DecimalSeperator", "Decimal Separator")->setRightTitle("What decimal separator does this currency use?"), TextField::create("ThousandsSeparator", "Thousands Separator")->setRightTitle("What thousands separator does this currency use?"), NumericField::create("DecimalPlaces", "Decimal Places")->setRightTitle("How many decimal places does this currency use?")))));
return $fields;
}
示例3: getCMSFields
/**
* getCMSFields
* Construct the FieldList used in the CMS. To provide a
* smarter UI we don't use the scaffolding provided by
* parent::getCMSFields.
*
* @return FieldList
*/
public function getCMSFields()
{
Requirements::css('torindul-silverstripe-shop/css/LeftAndMain.css');
//Create the FieldList and push the Root TabSet on to it.
$fields = FieldList::create($root = TabSet::create('Root', Tab::create("Main", HeaderField::create($this->SystemName), CompositeField::create(TextField::create("Title", "Friendly Name")->setRightTitle("This is the name your customers would see against this courier."), DropdownField::create("Enabled", "Enable this courier?", array("0" => "No", "1" => "Yes"))->setEmptyString("(Select one)")->setRightTitle("Can customers use this courier?")))));
return $fields;
}
示例4: getCMSFields
/**
* getCMSFields
* Construct the FieldList used in the CMS. To provide a
* smarter UI we don't use the scaffolding provided by
* parent::getCMSFields.
*
* @return FieldList
*/
public function getCMSFields()
{
Requirements::css('torindul-silverstripe-shop/css/LeftAndMain.css');
//Create the FieldList and push the Root TabSet on to it.
$fields = FieldList::create($root = TabSet::create('Root', Tab::create("Main", HeaderField::create("Add/Edit Order Status"), CompositeField::create(TextField::create("Title", "Friendly Name")->setRightTitle("The name of your custom order status. i.e. Pending, Awaiting Stock."), TextareaField::create("Content", "Friendly Description")->setRightTitle("This will be shown to your customers. What do you wish to tell them about this status?")))));
return $fields;
}
示例5: getCMSFields
/**
* @return FieldList
*/
public function getCMSFields()
{
// Get NotifiedOn implementors
$types = ClassInfo::implementorsOf('NotifiedOn');
$types = array_combine($types, $types);
unset($types['NotifyOnThis']);
if (!$types) {
$types = array();
}
array_unshift($types, '');
// Available keywords
$keywords = $this->getKeywords();
if (count($keywords)) {
$availableKeywords = '<div class="field"><div class="middleColumn"><p><u>Available Keywords:</u> </p><ul><li>$' . implode('</li><li>$', $keywords) . '</li></ul></div></div>';
} else {
$availableKeywords = "Available keywords will be shown if you select a NotifyOnClass";
}
// Identifiers
$identifiers = $this->config()->get('identifiers');
if (count($identifiers)) {
$identifiers = array_combine($identifiers, $identifiers);
}
$fields = FieldList::create();
$relevantMsg = 'Relevant for (note: this notification will only be sent if the context of raising the notification is of this type)';
$fields->push(TabSet::create('Root', Tab::create('Main', DropdownField::create('Identifier', _t('SystemNotification.IDENTIFIER', 'Identifier'), $identifiers), TextField::create('Title', _t('SystemNotification.TITLE', 'Title')), TextField::create('Description', _t('SystemNotification.DESCRIPTION', 'Description')), DropdownField::create('NotifyOnClass', _t('SystemNotification.NOTIFY_ON_CLASS', $relevantMsg), $types), TextField::create('CustomTemplate', _t('SystemNotification.TEMPLATE', 'Template (Optional)'))->setAttribute('placeholder', $this->config()->get('default_template')), LiteralField::create('AvailableKeywords', $availableKeywords))));
if ($this->config()->html_notifications) {
$fields->insertBefore(HTMLEditorField::create('NotificationHTML', _t('SystemNotification.TEXT', 'Text')), 'AvailableKeywords');
} else {
$fields->insertBefore(TextareaField::create('NotificationText', _t('SystemNotification.TEXT', 'Text')), 'AvailableKeywords');
}
return $fields;
}
示例6: getCMSFields
/**
* getCMSFields
* Construct the FieldList used in the CMS. To provide a
* smarter UI we don't use the scaffolding provided by
* parent::getCMSFields.
*
* @return FieldList
*/
public function getCMSFields()
{
Requirements::css('torindul-silverstripe-shop/css/LeftAndMain.css');
//Create the FieldList and push the Root TabSet on to it.
$fields = FieldList::create($root = TabSet::create('Root', Tab::create("Main", HeaderField::create("Add/Edit Tax Class"), CompositeField::create(TextField::create("Title", "Class Name")->setRightTitle("i.e. Zero Rate, Standard Rate.")))));
return $fields;
}
示例7: getCMSFields
/**
* getCMSFields
* Construct the FieldList used in the CMS. To provide a
* smarter UI we don't use the scaffolding provided by
* parent::getCMSFields.
*
* @return FieldList
*/
public function getCMSFields()
{
Requirements::css('torindul-silverstripe-shop/css/LeftAndMain.css');
//Create the FieldList and push the Root TabSet on to it.
$fields = FieldList::create($root = TabSet::create('Root', Tab::create("Main", HeaderField::create("Add/Edit Tax Zone"), CompositeField::create(DropdownField::create("Enabled", "Enable this zone?", array("1" => "Yes", "2" => "No"))->setRightTitle($this->SystemCreated == 1 && $this->exists() ? "DISABLED: You can not disable the default tax zone." : "If enabled your store will use the rates defined in this zone for customers in the selected country.")->setDisabled($this->SystemCreated == 1 && $this->exists() ? true : false), !$this->exists() ? CountryDropdownField::create("Title", "Country")->setRightTitle($this->SystemCreated == 1 && $this->exists() ? "DISABLED: You can not select a country as this zone applies to all countries." : "Select the country this zone applies to.")->setDisabled($this->SystemCreated == 1 && $this->exists() ? true : false) : "", $this->exists() ? GridField::create("TaxZones_TaxRates", "Tax Rates within the '" . $this->Title . "' Tax Zone", $this->TaxRates(), GridFieldConfig_RecordEditor::create()) : ""))));
return $fields;
}
示例8: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
foreach (['primary', 'secondary'] as $lower) {
$upper = ucfirst($lower);
$config = $this->owner->config()->get("{$lower}_gallery");
if (is_null($config) || isset($config['enabled']) && $config['enabled'] === false) {
continue;
}
$config['title'] = isset($config['title']) ? $config['title'] : "{$upper} Gallery";
$config['folder'] = isset($config['folder']) ? $config['folder'] : "{$upper}-Gallery-Images";
$GridFieldConfig = new GridFieldConfig_RecordEditor();
$GridFieldConfig->removeComponentsByType('GridFieldAddNewButton');
$GridFieldConfig->addComponent($bulkUploadConfig = new GridFieldBulkUpload());
$GridFieldConfig->addComponent(new GridFieldSortableRows('SortOrder'));
$GridFieldConfig->addComponent(new GridFieldGalleryTheme('Image'));
$bulkUploadConfig->setUfSetup('setFolderName', "Images/{$config['folder']}");
$GridField = new GridField("{$upper}GalleryGridField", $config['title'], $this->owner->{"{$upper}GalleryImages"}(), $GridFieldConfig);
/** @var TabSet $rootTab */
//We need to repush Metadata to ensure it is the last tab
$rootTab = $fields->fieldByName('Root');
$rootTab->push($tab = Tab::create("{$upper}Gallery"));
if ($rootTab->fieldByName('Metadata')) {
$metaChildren = $rootTab->fieldByName('Metadata')->getChildren();
$rootTab->removeByName('Metadata');
$rootTab->push(Tab::create('Metadata')->setChildren($metaChildren));
}
$tab->setTitle($config['title']);
$fields->addFieldToTab("Root.{$upper}Gallery", $GridField);
}
}
示例9: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
$fields->insertBefore($shoptab = Tab::create('Shop', 'Shop'), 'Access');
$fields->addFieldsToTab("Root.Shop", TabSet::create("ShopTabs", $maintab = Tab::create("Main", TreeDropdownField::create('TermsPageID', _t("ShopConfig.TERMSPAGE", 'Terms and Conditions Page'), 'SiteTree'), TreeDropdownField::create("CustomerGroupID", _t("ShopConfig.CUSTOMERGROUP", "Group to add new customers to"), "Group"), UploadField::create('DefaultProductImage', _t('ShopConfig.DEFAULTIMAGE', 'Default Product Image'))), $countriestab = Tab::create("Countries", CheckboxSetField::create('AllowedCountries', _t('ShopConfig.ALLOWED_COUNTRIES', 'Allowed Ordering and Shipping Countries'), self::config()->iso_3166_country_codes))));
$fields->removeByName("CreateTopLevelGroups");
$countriestab->setTitle(_t('ShopConfig.ALLOWED_COUNTRIES_TAB_TITLE', "Allowed Countries"));
}
示例10: getCMSFields
/**
* Get the fields that are sent to the CMS. In
* your extensions: updateCMSFields($fields)
*
* @return FieldList
*/
public function getCMSFields()
{
/** @var FieldList $fields */
$fields = FieldList::create(TabSet::create('Root', Tab::create('Main'), Tab::create('Settings')));
$fields->addFieldToTab('Root.Settings', TextField::create('GoogleFontAPI'));
$this->extend('updateCMSFields', $fields);
return $fields;
}
示例11: updateCMSFields
/**
* @todo fix sortorder
*
* @param FieldList $fields
*/
public function updateCMSFields(FieldList $fields)
{
/** Setup new Root Fieldlist */
$fields->removeByName('Main');
$owner = $this->owner;
/** Add the fields */
$fields->addFieldsToTab('Root', Tab::create('Main', _t('Tag.MAIN', 'Main'), $text = TextField::create('Title', $owner->fieldLabel('Title')), $html = HTMLEditorField::create('Description', $owner->fieldLabel('Description')), $uplo = UploadField::create('Impression', $owner->fieldLabel('Impression'))));
}
示例12: createNext7DaysTab
public function createNext7DaysTab()
{
$sevenDaysTab = Tab::create('Next7Days', 'Next 7 Days', $days = TabSet::create('Days'));
for ($i = 0; $i < 7; $i++) {
$data = $this->getFieldsForEventDay($i);
$days->push(Tab::create("Plus{$i}Days", $data['TabTitle'])->setChildren($data['Fields']));
}
return $sevenDaysTab;
}
示例13: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$gfConfig = GridFieldConfig_relationEditor::create();
$gfConfig->removeComponentsByType('GridFieldDeleteAction')->removeComponentsByType('GridFieldDetailForm')->addComponents(new VersionedGridFieldDetailForm());
$articles = Versioned::get_by_stage('NewsArticle', 'Stage');
$fields->insertAfter(Tab::create('Articles'), 'Main');
$fields->addFieldToTab('Root.Articles', GridField::create('Children', 'Articles', $articles, $gfConfig));
return $fields;
}
示例14: updateMediaForm
/**
* Adjusts the media form to include the controls and ui for Vidyard
* @param {Form} $form Form to adjust
*/
public function updateMediaForm(Form $form)
{
$apiKey = Vidyard::config()->api_key;
if (!empty($apiKey)) {
$numericLabelTmpl = '<span class="step-label"><span class="flyout">%d</span><span class="arrow"></span><strong class="title">%s</strong></span>';
$tabs = $form->Fields()->offsetGet(1)->fieldByName('MediaFormInsertMediaTabs');
$tabs->push(Tab::create('FromVidyard', _t('VidyardInsertMedia.FROM_VIDYARD', '_From Vidyard'), CompositeField::create(new LiteralField('headerVidyard', '<h4>' . sprintf($numericLabelTmpl, '1', _t('VidyardInsertMedia.ADD_VIDEO', '_Add Video')) . '</h4>'), TextField::create('VideoURL', 'http://')->addExtraClass('remoteurl')->setDescription(_t('VidyardInsertMedia.ADD_VIDEO_DESC', '_The url you should use in this field is the sharing page, you can also use some of the settings pages for the video in Vidyard')), new LiteralField('addVidyard', '<button class="action ui-action-constructive ui-button field add-url add-vidyard" data-icon="addMedia">' . _t('VidyardInsertMedia.ADD_VIDEO', '_Add Video') . '</button>'))->addExtraClass('content ss-uploadfield'))->addExtraClass('htmleditorfield-from-web')->setTabSet($tabs)->setForm($form));
Requirements::javascript(VIDYARD_BASE . '/javascript/VidyardInsertMedia.js');
}
}
示例15: getCMSFields
/**
* getCMSFields
* Construct the FieldList used in the CMS. To provide a
* smarter UI we don't use the scaffolding provided by
* parent::getCMSFields.
*
* @return FieldList
*/
public function getCMSFields()
{
Requirements::css('torindul-silverstripe-shop/css/LeftAndMain.css');
//Product Item not yet created
$select_product_item = Tab::create("Item", HeaderField::create("Add Order Item"), CompositeField::create(DropdownField::create("OriginalProductID", "Select Product", Product::get()->sort("Title ASC")->map())->setEmptyString("(Select a product)")));
//Product Item has been created
$edit_product_item = Tab::create("Item", HeaderField::create("Order Item"), CompositeField::create(ReadonlyField::create("Title", "Product")->setRightTitle("You will need to remove this item and add another should you wish to change the product."), ReadonlyField::create("SKU", "SKU"), FieldGroup::create(NumericField::create("Price", "Cost per item"), DropdownField::create("Discounted", "Is this the sale price?", array("0" => "No", "1" => "Yes")), NumericField::create("Quantity", "Quantity ordered"))->setTitle("Pricing (" . Product::getDefaultCurrency() . ") "), ReadonlyField::create("SubTotal", "Subtotal (" . Product::getDefaultCurrency() . ")", StoreCurrency::convertToCurrency($this->Price * $this->Quantity)), ReadonlyField::create("TAX", $this->TaxClassName . " (" . Product::getDefaultCurrency() . ")", $this->calculateItemTax())->setRightTitle($this->TaxCalculation == 1 ? "Subtotal is inclusive of this tax." : "Subtotal is exclusive of this tax."), ReadonlyField::create("Total", "Total (" . Product::getDefaultCurrency() . ")", $this->TaxCalculation == 1 ? StoreCurrency::convertToCurrency($this->Price * $this->Quantity) : StoreCurrency::convertToCurrency($this->Price * $this->Quantity + $this->calculateItemTax()))));
//Create the FieldList and push the either of the above Tabs to the Root TabSet based on if Product Item exists yet or not.
$fields = FieldList::create($root = TabSet::create('Root', $this->exists() ? $edit_product_item : $select_product_item));
return $fields;
}