function updateCMSFields(FieldList $fields)
 {
     $fields->removeByName("SummaryContent");
     $fields->removeByName("SummaryImage");
     $summary_fields = ToggleCompositeField::create('Summary', 'Summary Info.', array(TextareaField::create("SummaryContent", $this->owner->fieldLabel('SummaryContent')), UploadField::create("SummaryImage", $this->owner->fieldLabel('SummaryImage'))))->setHeadingLevel(4);
     $fields->addFieldToTab('Root.Main', $summary_fields, 'Metadata');
 }
 public function updateCMSFields(FieldList $fields)
 {
     $fields->removeByName("IsSpam");
     $fields->removeByName("URL");
     $fields->addFieldToTab("Root.Main", new ReadonlyField("Email"), "Moderated");
     $fields->addFieldToTab("Root.Main", new ReadonlyField("ParentTitle", "Blog Post"), "Name");
 }
 public function updateCMSFields(FieldList $fields)
 {
     if ($this->owner->Schema()->Name != 'AGLS') {
         $fields->removeByName('Scheme');
         $fields->removeByName('Lang');
     }
 }
Example #4
0
 public function updateCMSFields(FieldList $fields)
 {
     $logo = $fields->dataFieldByName('Logo');
     $fields->removeByName('ParentID');
     $fields->removeByName('Sort');
     $fields->insertAfter($logo, 'Title');
 }
 public function updateFrontendFields(FieldList $fields)
 {
     $fields->removeByName('MasterNode');
     $fields->removeByName('ContentID');
     $fields->removeByName('OriginalID');
     $fields->removeByName('LastEditedUTC');
 }
 public function updateCMSFields(FieldList $fields)
 {
     $fields->removeFieldFromTab("Root.Main", "MenuTitle");
     $fields->addFieldToTab('Root.Main', new LiteralField("manage", "<a style='margin-bottom:15px' class='backlink ss-ui-button cms-panel-link ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary ui-state-hover ui-state-active' data-icon='back' href='" . Director::absoluteBaseURL() . "admin/pages/edit/show/" . $this->owner->Parent()->ID . "' role='button' aria-disabled='false'><span class='ui-button-icon-primary ui-icon btn-icon-back'></span><span style='padding-left:5px' >\n\t\t\tManage Posts\n\t\t</span></a>"), 'Title');
     $image = $fields->dataFieldByName("FeaturedImage");
     if ($image) {
         $image->setFolderName('Managed/BlogPosts/Featured');
         $image->setCanPreviewFolder(false);
     }
     // Get config options for using tags / categories
     $use_categories = Config::inst()->get("Blog", 'use_categories');
     $use_tags = Config::inst()->get("Blog", 'use_tags');
     $use_featured_image = Config::inst()->get("Blog", 'use_featured_image');
     // Adds message below tags/categories fields if none exist telling user where to create them
     if (!$this->owner->Parent()->Categories()->count() && $use_categories) {
         $cats = $fields->dataFieldByName("Categories");
         $cats->setRightTitle("You must first add categories via the <strong>Blog Options</strong> tab on the <a href='admin/pages/edit/show/" . $this->owner->Parent()->ID . "'>main Blog page</a>.");
     }
     if (!$this->owner->Parent()->Tags()->count() && $use_tags) {
         $cats = $fields->dataFieldByName("Tags");
         $cats->setRightTitle("You must first add tags via the <strong>Blog Options</strong> tab on the <a href='admin/pages/edit/show/" . $this->owner->Parent()->ID . "'>main Blog page</a>.");
     }
     // Hide tags/categories fields if turned off in config
     if (!$use_categories) {
         $fields->removeByName("Categories");
     }
     if (!$use_tags) {
         $fields->removeByName("Tags");
     }
     if (!$use_featured_image && !$this->owner->FeaturedImage()->exists()) {
         $fields->removeFieldFromTab("Root.Main", "FeaturedImage");
     }
     // Need to add proper support for this, removing for now, needs to play nicely with my "Disply Full Posts" option:
     $fields->removeFieldFromTab("Root.Main", "CustomSummary");
 }
 /**
  * standard SS method
  * @param Object - $fields (FieldList)
  * @return Object - FieldList
  */
 function updateCMSFields(FieldList $fields)
 {
     $additionalWhereForDefault = "";
     $fields->removeByName("ExcludedFrom");
     $fields->removeByName("AdditionalTax");
     $tabName = "Root.Tax";
     if ($this->owner instanceof ProductVariation) {
         $fields->addFieldToTab($tabName, new LiteralField("SeeProductForAdditionalTax", _t("GSTTaxModifier.SEE_PARENT", "See parent Product for Additional Tax")));
     } else {
         //additional taxes
         $additionalOptions = GSTTaxModifierOptions::get()->filter(array("DoesNotApplyToAllProducts" => 1));
         if ($additionalOptions->count()) {
             $additionalOptionsList = $additionalOptions->map()->toArray();
             $fields->addFieldToTab($tabName, new CheckboxSetField("AdditionalTax", _t("GSTTaxMofidifier.ADDITIONAL_TAXES", "Additional taxes ..."), $additionalOptionsList));
         }
     }
     if ($this->owner instanceof ProductVariation) {
         $fields->addFieldToTab($tabName, new LiteralField("SeeProductForExcludedFrom", _t("GSTTaxModifier.SEE_PARRENT", "See parent product for excluded taxes")));
     } else {
         //excluded options
         $excludedOptions = GSTTaxModifierOptions::get()->filter(array("DoesNotApplyToAllProducts" => 0));
         if ($excludedOptions->count()) {
             $excludedOptionsList = $excludedOptions->map()->toArray();
             $fields->addFieldToTab($tabName, new CheckboxSetField("ExcludedFrom", _t("GSTTaxMofidifier.EXCLUDE_TAXES", "Taxes that do not apply ..."), $excludedOptionsList));
             $additionalWhereForDefault = " \"GSTTaxModifierOptions\".\"ID\" NOT IN (" . implode(", ", $excludedOptions->map("ID", "ID")->toArray()) . ")";
         }
     }
     //default options
     $defaultOptions = GSTTaxModifierOptions::get()->filter(array("DoesNotApplyToAllProducts" => 0))->where($additionalWhereForDefault);
     if ($defaultOptions->count()) {
         $fields->addFieldToTab($tabName, new ReadonlyField("AlwaysApplies", "+ " . implode(", ", $defaultOptions->map()->toArray()) . "."));
     }
 }
    public function updateSettingsFields(FieldList $fields)
    {
        //removing view settings
        $fields->removeByName("CanViewType");
        $fields->removeByName("ViewerGroups");
        //adding view settings displaying the custom hard coded view settings
        $groups = $this->owner->DictatedViewerGroups();
        $groupsStr = '';
        if ($groups) {
            foreach ($groups as $g) {
                $groupsStr .= "{$g->Title}, ";
            }
            $groupsStr = rtrim($groupsStr, ', ');
        } else {
            $groupsStr = _t('SiteTree.ACCESSLOGGEDIN', "Logged-in users");
        }
        $fields->addFieldToTab('Root', LiteralField::create('CanViewTypeExpl', '
<div class="field fieldgroup fieldgroup">
	<label class="left">' . _t('SiteTree.ACCESSHEADER', "Who can view this page?") . '</label>
	<div class="middleColumn fieldgroup ">
		<p>
			<em>' . $groupsStr . '</em>
		</p>

	</div>
</div>
			'), 'CanEditType');
    }
 /**
  * Adds our SEO Meta fields to the page field list
  *
  * @since version 1.0.0
  *
  * @param string $fields The current FieldList object
  *
  * @return object Return the FieldList object
  **/
 public function updateCMSFields(FieldList $fields)
 {
     $fields->removeByName('HeadTags');
     $fields->removeByName('SitemapImages');
     if (!$this->owner instanceof Page) {
         $fields->addFieldToTab('Root.Page', HeaderField::create('Page'));
         $fields->addFieldToTab('Root.Page', TextField::create('Title', 'Page name'));
     }
     $fields->addFieldToTab('Root.PageSEO', $this->preview());
     $fields->addFieldToTab('Root.PageSEO', TextField::create('MetaTitle'));
     $fields->addFieldToTab('Root.PageSEO', TextareaField::create('MetaDescription'));
     $fields->addFieldToTab('Root.PageSEO', HeaderField::create(false, 'Indexing', 2));
     $fields->addFieldToTab('Root.PageSEO', TextField::create('Canonical'));
     $fields->addFieldToTab('Root.PageSEO', DropdownField::create('Robots', 'Robots', SEO_FieldValues::IndexRules()));
     $fields->addFieldToTab('Root.PageSEO', NumericField::create('Priority'));
     $fields->addFieldToTab('Root.PageSEO', DropdownField::create('ChangeFrequency', 'Change Frequency', SEO_FieldValues::SitemapChangeFrequency()));
     $fields->addFieldToTab('Root.PageSEO', CheckboxField::create('SitemapHide', 'Hide in sitemap? (XML and HTML)'));
     $fields->addFieldToTab('Root.PageSEO', HeaderField::create('Social Meta'));
     $fields->addFieldToTab('Root.PageSEO', CheckboxField::create('HideSocial', 'Hide Social Meta?'));
     $fields->addFieldToTab('Root.PageSEO', DropdownField::create('OGtype', 'Open Graph Type', SEO_FieldValues::OGtype()));
     $fields->addFieldToTab('Root.PageSEO', DropdownField::create('OGlocale', 'Open Graph Locale', SEO_FieldValues::OGlocale()));
     $fields->addFieldToTab('Root.PageSEO', DropdownField::create('TwitterCard', 'Twitter Card', SEO_FieldValues::TwitterCardTypes()));
     $fields->addFieldToTab('Root.PageSEO', $this->SharingImage());
     $fields->addFieldToTab('Root.PageSEO', HeaderField::create('Other Meta Tags'));
     $fields->addFieldToTab('Root.PageSEO', $this->OtherHeadTags());
     $fields->addFieldToTab('Root.PageSEO', HeaderField::create('Sitemap Images'));
     $fields->addFieldToTab('Root.PageSEO', $this->SitemapImagesGrid());
     $fields->addFieldToTab('Root.PageSEO', LiteralField::create(false, '<br><br>Silverstripe SEO v1.0'));
     return $fields;
 }
 public function updateCMSFields(FieldList $fields)
 {
     $fields->removeByName('Country');
     $fields->removeByName("DefaultShippingAddressID");
     $fields->removeByName("DefaultBillingAddressID");
     $fields->addFieldToTab('Root.Main', DropdownField::create('Country', _t('Address.db_Country', 'Country'), SiteConfig::current_site_config()->getCountriesList()));
 }
 /**
  * Allow other admins to turn off 2FA if it is set & admins_can_disable is set in the config.
  * 2FA in general is managed in the user's own profile.
  *
  * @param \FieldList $fields
  */
 public function updateCMSFields(\FieldList $fields)
 {
     $fields->removeByName('TOTPToken');
     $fields->removeByName('BackupTokens');
     if (!(\Config::inst()->get(__CLASS__, 'admins_can_disable') && $this->owner->Has2FA && \Permission::check('ADMIN'))) {
         $fields->removeByName('Has2FA');
     }
 }
 public function updateCMSFields(FieldList $fields)
 {
     $fields->insertBefore(new CheckboxField('GenerateMetaData', _t('MetaManager.GENERATEMETADATA', 'Generate Meta-data automatically from the page content'), $this->owner->GenerateMetaData), 'MetaDescription');
     if (self::$hide_extra_meta == 1) {
         $fields->removeByName('ExtraMeta');
         $fields->removeByName('ExtraMeta_original');
     }
 }
 /**
  * This method holds the functionality to complete the oauth flow through the CMS
  *
  * @param $fields FieldList
  **/
 public function updateCMSFields(FieldList $fields)
 {
     // Remove fields that may have been added elsewhere.
     $fields->removeByName("FacebookUser");
     $fields->removeByName("FacebookUserID");
     $fields->removeByName("FacebookAccessToken");
     // Add our new fields.
     $fields->addFieldsToTab("Root.Main", ToggleCompositeField::create('FacebookUser', 'Facebook User', array(TextField::create("FacebookUserID", "User ID"), TextField::create("FacebookAccessToken", "Access Token")))->setHeadingLevel(4));
 }
Example #14
0
 /**
  * Fields to display this {@link Payment} in the CMS, removed some of the 
  * unnecessary fields.
  * 
  * @see DataObjectDecorator::updateCMSFields()
  * @return FieldList
  */
 function updateCMSFields(FieldList $fields)
 {
     $fields->removeByName('OrderID');
     $fields->removeByName('HTTPStatus');
     $fields->removeByName('Amount');
     $str = $this->owner->dbObject('Amount')->Nice();
     $fields->insertBefore(TextField::create('Amount_', 'Amount', $str), 'Method');
     return $fields;
 }
 /**
  * Add extra fields to a File object if in SEO Admin
  *
  * @since version 1.0.0
  *
  * @param object $fields The current FieldList object
  *
  * @return object
  **/
 public function updateCMSFields(FieldList $fields)
 {
     if (Controller::curr() instanceof SEO_ModelAdmin) {
         $fields->removeByName('Name');
         $fields->removeByName('ParentID');
         $fields->removeByName('OwnerID');
     }
     return $fields;
 }
 public function updateCMSFields(FieldList $fields)
 {
     $fields->addFieldToTab("Root.Main", new UploadField('Image', 'Main Image'), 'Content');
     $fields->removeByName("Author");
     if ($this->owner->ClassName == "BlogEntry") {
         $fields->removeByName("Date");
     } else {
         $fields->renameField("Date", "Published Date");
     }
 }
 /**
  * This method holds the functionality to complete the oauth flow through the CMS
  *
  * @param $fields FieldList
  **/
 public function updateCMSFields(FieldList $fields)
 {
     // Remove fields that may have been added elsewhere.
     $fields->removeByName("TwitterUser");
     $fields->removeByName("TwitterScreenName");
     $fields->removeByName("TwitterUserID");
     $fields->removeByName("TwitterAccessToken");
     $fields->removeByName("TwitterAccessSecret");
     // Add our new fields.
     $fields->push(ToggleCompositeField::create('TwitterUser', 'Twitter User', array(TextField::create("TwitterScreenName", "Screen Name"), TextField::create("TwitterUserID", "User ID"), TextField::create("TwitterAccessToken", "Access Token"), PasswordField::create("TwitterAccessSecret", "Access Secret")))->setHeadingLevel(4));
 }
 public function updateCMSFields(FieldList $fields)
 {
     $fields->removeByName('LastSignificantChange');
     $fields->removeByName('ChangeDescription');
     if ($this->owner->LastSignificantChange !== NULL) {
         $dateTime = new DateTime($this->owner->LastSignificantChange);
         //Put these fields on the top of the First Tab's form
         $fields->first()->Tabs()->first()->getChildren()->unshift(LabelField::create("infoLastSignificantChange", "<strong>Last Significant change was at: " . "{$dateTime->Format('d/m/Y H:i')}</strong>"));
         $fields->insertAfter(CheckboxField::create("isSignificantChange", "CLEAR Last Significant change: {$dateTime->Format('d/m/Y H:i')}")->setDescription('Check and save this Record again to clear the Last Significant change date.')->setValue(FALSE), 'infoLastSignificantChange');
         $fields->insertAfter(TextField::create('ChangeDescription', 'Description of Changes')->setDescription('This is an automatically generated list of changes to important fields.'), 'isSignificantChange');
     }
 }
 /**
  * @param FieldList $fields
  */
 public function updateCMSFields(FieldList $fields)
 {
     if ($this->owner->Identifier == '') {
         $fields->removeByName('Identifier');
     } else {
         $fields->makeFieldReadonly('Identifier');
     }
     $fields->removeByName('Images');
     $fields->addFieldToTab('Root.Images', new UploadField('Images', 'Images', $this->owner->Images()));
     $fields->removeByName('Files');
     $fields->addFieldToTab('Root.Files', new UploadField('Files', 'Files', $this->owner->Files()));
 }
 public function updateCMSFields(FieldList $fields)
 {
     $fields->addFieldToTab("Root.Settings", DropdownField::create("ProductGroupID", _t("GroupedProduct.AddToGroup", "Add this product to a group"), Product::get()->filter("ClassName", "GroupedProduct")->map())->setEmptyString(_t("GroupedProduct.SelectProduct", "Select a Product")));
     // If this is a child product, remove some fields we don't need
     if ($this->owner->ProductGroupID) {
         $fields->removeByName("Content");
         $fields->removeByName("Metadata");
         $fields->removeByName("Related");
         $fields->removeByName("Categories");
         $fields->removeByName("TaxRate");
     }
 }
 public function updateCMSFields(FieldList $fields)
 {
     // These fields need removed, as they may have already been created by the form scaffolding
     $fields->removeByName('Lat');
     $fields->removeByName('Lon');
     $fields->removeByName('ZoomLevel');
     $fields->removeByName('MapPinIcon');
     $fields->removeByName('MapPinEdited');
     $fields->addFieldToTab("Root.Location", $this->getMapField());
     $fields->addFieldToTab('Root.Location', $uf = new UploadField('MapPinIcon', _t('Mappable.MAP_PIN', 'Map Pin Icon.  Leave this blank for default pin to show')));
     $uf->setFolderName('mapicons');
 }
 public function updateSettingsFields(FieldList $fields)
 {
     // Present a set of checkboxes for filtering this item by locale
     $menuFilterField = FieldGroup::create()->setTitle($this->owner->fieldLabel('ShowInMenus'))->setDescription(_t('Fluent.LocaleMenuFilterDescription', 'Select the locales where this item is visible in the menu'));
     foreach (Fluent::locales() as $locale) {
         $id = Fluent::db_field_for_locale("ShowInMenus", $locale);
         $fields->removeByName($id, true);
         // Remove existing (in case it was auto scaffolded)
         $title = i18n::get_locale_name($locale);
         $menuFilterField->push(new CheckboxField($id, $title));
     }
     $fields->removeByName('ShowInMenus', true);
     $fields->addFieldToTab('Root.Settings', $menuFilterField, 'CanViewType');
 }
 /**
  * @param FieldList $fields
  */
 public function updateCMSFields(FieldList $fields)
 {
     $fields->removeByName('HierarchyTitle');
     $fields->removeByName('Parent');
     $fields->addFieldToTab('Root.Children', new GridField('Children', 'Children', $this->owner->Children(), $config = GridFieldConfig_RecordEditor::create()));
     $where = sprintf("ParentID = '%s'", $this->owner->ID);
     if ($this->owner->hasExtension('VersionedDataObject')) {
         $config->addComponent(new GridFieldWhereableVersionedOrderableRows('Sort', $where));
         $config->removeComponentsByType('GridFieldDetailForm');
         $config->addComponent(new VersionedDataObjectDetailsForm());
     } else {
         $config->addComponent(new GridFieldWhereableOrderableRows('Sort', $where));
     }
 }
 /**
  * Hook updateMemberProfileCMSFields to make sure the new fields only show on the Email proffile field.
  * @param  FieldList $fields
  */
 public function updateMemberProfileCMSFields(FieldList $fields)
 {
     // If this is the Email Profile Field
     if ($this->getOwner()->MemberField == 'Email') {
         // Add a header
         $fields->insertBefore(HeaderField::create('DomainValidationHeader', _t('DomainSpecificMemberProfileFieldExtension.DomainValidationHeader', 'Domain Validation'), 3), 'AllowedDomains');
         // Add some helper text
         $fields->insertBefore(LiteralField::create('DomainValidationHelper', _t('DomainSpecificMemberProfileFieldExtension.DomainValidationHelper', 'Allow or disallow profile registration based on the domain of the user\'s email address. One domain can be specified per line. You can use the wildcards (e.g.: <em>*.example.com</em>) to catch subdomains.')), 'AllowedDomains');
     } else {
         // If it's any other Member profile field remove the additional field.
         $fields->removeByName('AllowedDomains');
         $fields->removeByName('DisallowedDomains');
         $fields->removeByName('ShowDomainsOnError');
     }
 }
 public function updateCMSFields(FieldList $fields)
 {
     foreach (['primary', 'secondary'] as $lower) {
         $upper = ucfirst($lower);
         $fields->removeByName("{$upper}GalleryImages");
         $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 GridFieldOrderableRows('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');
         if ($this->owner->exists()) {
             $rootTab->push($tab = Tab::create("{$upper}Gallery"));
         }
         if ($this->owner->exists()) {
             $fields->addFieldToTab("Root.{$upper}Gallery", $GridField);
             $tab->setTitle($config['title']);
         }
     }
 }
 public function updateCMSFields(FieldList $fields)
 {
     $fields->insertBefore($shoptab = new Tab('Shop', 'Shop'), 'Access');
     $fields->addFieldsToTab("Root.Shop", new TabSet("ShopTabs", $maintab = new Tab("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 = new Tab("Countries", CheckboxSetField::create('AllowedCountries', 'Allowed Ordering and Shipping Countries', self::config()->iso_3166_country_codes))));
     $fields->removeByName("CreateTopLevelGroups");
     $countriestab->setTitle("Allowed Countries");
 }
 public function updateCMSFields(FieldList $fields)
 {
     // Remove Configurable Page Tab
     if (!$this->owner->ConfigurablePages) {
         $fields->removeByName('ConfigurablePages');
     }
 }
 public function updateCMSFields(FieldList $fields)
 {
     if ($this->owner->ShowTimeline) {
         // Create add button
         $add_button = new GridFieldAddNewButton('toolbar-header-left');
         $add_button->setButtonName('Add Event');
         // Add timeline editor
         $grid_config = GridFieldConfig_RecordEditor::create()->removeComponentsByType('GridFieldAddNewButton')->removeComponentsByType('GridFieldFilterHeader')->addComponent(new GridFieldOrderableRows('Sort'))->addComponent($add_button);
         $timeline_table = GridField::create('Events', false, $this->owner->Events(), $grid_config);
         $fields->addFieldToTab('Root.Timeline', $timeline_table);
     } else {
         $fields->removeByName('Events');
     }
     $fields->removeByName('ShowTimeline');
     parent::updateCMSFields($fields);
 }
 public function updateFields(FieldList $fields)
 {
     if (!$this->owner->ID) {
         return $fields;
     }
     $tab = $fields->fieldByName('Root') ? $fields->findOrMakeTab('Root.Workflow') : $fields;
     if (Permission::check('APPLY_WORKFLOW')) {
         $definition = new DropdownField('WorkflowDefinitionID', _t('WorkflowApplicable.DEFINITION', 'Applied Workflow'));
         $definitions = $this->workflowService->getDefinitions()->map()->toArray();
         $definition->setSource($definitions);
         $definition->setEmptyString(_t('WorkflowApplicable.INHERIT', 'Inherit from parent'));
         $tab->push($definition);
         // Allow an optional selection of additional workflow definitions.
         if ($this->owner->WorkflowDefinitionID) {
             $fields->removeByName('AdditionalWorkflowDefinitions');
             unset($definitions[$this->owner->WorkflowDefinitionID]);
             $tab->push($additional = ListboxField::create('AdditionalWorkflowDefinitions', _t('WorkflowApplicable.ADDITIONAL_WORKFLOW_DEFINITIONS', 'Additional Workflows')));
             $additional->setSource($definitions);
             $additional->setMultiple(true);
         }
     }
     // Display the effective workflow definition.
     if ($effective = $this->getWorkflowInstance()) {
         $title = $effective->Definition()->Title;
         $tab->push(ReadonlyField::create('EffectiveWorkflow', _t('WorkflowApplicable.EFFECTIVE_WORKFLOW', 'Effective Workflow'), $title));
     }
     if ($this->owner->ID) {
         $config = new GridFieldConfig_Base();
         $config->addComponent(new GridFieldEditButton());
         $config->addComponent(new GridFieldDetailForm());
         $insts = $this->owner->WorkflowInstances();
         $log = new GridField('WorkflowLog', _t('WorkflowApplicable.WORKFLOWLOG', 'Workflow Log'), $insts, $config);
         $tab->push($log);
     }
 }
 public function updateCMSFields(FieldList $fields)
 {
     if ($this->owner->ID) {
         // Relation handler for Blocks
         $SConfig = GridFieldConfig_RelationEditor::create(25);
         $SConfig->addComponent(new GridFieldOrderableRows('SortOrder'));
         $SConfig->addComponent(new GridFieldDeleteAction());
         // If the copy button module is installed, add copy as option
         if (class_exists('GridFieldCopyButton')) {
             $SConfig->addComponent(new GridFieldCopyButton(), 'GridFieldDeleteAction');
         }
         $gridField = new GridField("Blocks", "Content blocks", $this->owner->Blocks(), $SConfig);
         $classes = array_values(ClassInfo::subclassesFor($gridField->getModelClass()));
         if (count($classes) > 1 && class_exists('GridFieldAddNewMultiClass')) {
             $SConfig->removeComponentsByType('GridFieldAddNewButton');
             $SConfig->addComponent(new GridFieldAddNewMultiClass());
         }
         if (self::$create_block_tab) {
             $fields->addFieldToTab("Root.Blocks", $gridField);
         } else {
             // Downsize the content field
             $fields->removeByName('Content');
             $fields->addFieldToTab('Root.Main', HTMLEditorField::create('Content')->setRows(self::$contentarea_rows), 'Metadata');
             $fields->addFieldToTab("Root.Main", $gridField, 'Metadata');
         }
     }
     return $fields;
 }