public function updateSettingsFields(FieldList $fields)
 {
     $fields->removeFieldFromTab("Root.Settings", "CanViewType");
     $fields->removeFieldFromTab("Root.Settings", "ViewerGroups");
     $fields->removeFieldFromTab("Root.Settings", "CanEditType");
     $fields->removeFieldFromTab("Root.Settings", "EditorGroups");
 }
 public function updateCMSFields(FieldList $fields)
 {
     $fields->removeFieldFromTab("Root.Main", "TimeFormat");
     $fields->removeFieldFromTab("Root.Main", "DateFormat");
     $fields->removeFieldFromTab("Root.Main", "HasConfiguredDashboard");
     $fields->removeFieldFromTab("Root.Main", "Locale");
     $fields->removeFieldFromTab("Root.Main", "FailedLoginCount");
 }
 /**
  * Adds variations specific fields to the CMS.
  */
 public function updateCMSFields(FieldList $fields)
 {
     $fields->addFieldsToTab('Root.Variations', array(ListboxField::create("VariationAttributeTypes", _t('ProductVariationsExtension.ATTRIBUTES', "Attributes"), ProductAttributeType::get()->map("ID", "Title")->toArray())->setMultiple(true)->setDescription(_t('ProductVariationsExtension.ATTRIBUTES_DESCRIPTION', "These are fields to indicate the way(s) each variation varies. Once selected, they can be edited on each variation.")), GridField::create("Variations", _t('ProductVariationsExtension.VARIATIONS', "Variations"), $this->owner->Variations(), GridFieldConfig_RecordEditor::create())));
     if ($this->owner->Variations()->exists()) {
         $fields->addFieldToTab('Root.Pricing', LabelField::create('variationspriceinstructinos', _t('ProductVariationsExtension.VARIATIONS_INSTRUCTIONS', "Price - Because you have one or more variations, the price can be set in the \"Variations\" tab.")));
         $fields->removeFieldFromTab('Root.Pricing', 'BasePrice');
         $fields->removeFieldFromTab('Root.Pricing', 'CostPrice');
         $fields->removeFieldFromTab('Root.Main', 'InternalItemID');
     }
 }
 public function updateCMSFields(FieldList $fields)
 {
     $fields->removeFieldFromTab('Root', 'Timezone');
     $field = DropdownField::create('Timezone', 'Timezone', $this->getTimezones())->setEmptyString('For NZ, choose Pacific/Auckland');
     $fields->addFieldToTab('Root.timezone', $field);
     return $fields;
 }
 /**
  * updateCMSFields.
  * Update Silverstripe CMS Fields for SEO Module
  *  	 
  * @param FieldList
  * @return none
  */
 public function updateCMSFields(FieldList $fields)
 {
     // exclude SEO tab from some pages
     if (in_array($this->owner->getClassName(), Config::inst()->get("SeoObjectExtension", "excluded_page_types"))) {
         return;
     }
     Requirements::css(SEO_DIR . '/css/seo.css');
     Requirements::javascript(SEO_DIR . '/javascript/seo.js');
     // better do this below in some init method? :
     $this->getSEOScoreCalculation();
     $this->setSEOScoreTipsUL();
     // lets create a new tab on top
     $fields->addFieldsToTab('Root.SEO', array(LiteralField::create('googlesearchsnippetintro', '<h3>' . _t('SEO.SEOGoogleSearchPreviewTitle', 'Preview google search') . '</h3>'), LiteralField::create('googlesearchsnippet', '<div id="google_search_snippet"></div>'), LiteralField::create('siteconfigtitle', '<div id="ss_siteconfig_title">' . $this->owner->getSiteConfig()->Title . '</div>')));
     // move Metadata field from Root.Main to SEO tab for visualising direct impact on search result
     $fields->removeFieldFromTab('Root.Main', 'Metadata');
     /*$fields->addFieldToTab("Root.SEO", new TabSet('Options', 
     			new Tab('Metadata', _t('SEO.SEOMetaData', 'Meta Data')), 
     			new Tab('HelpAndSEOScore',  _t('SEO.SEOHelpAndScore', 'Help and SEO Score'))   
     		));*/
     $fields->addFieldsToTab('Root.SEO', array(TextareaField::create("MetaDescription", $this->owner->fieldLabel('MetaDescription'))->setRightTitle(_t('SiteTree.METADESCHELP', "Search engines use this content for displaying search results (although it will not influence their ranking)."))->addExtraClass('help'), TextareaField::create("ExtraMeta", $this->owner->fieldLabel('ExtraMeta'))->setRightTitle(_t('SiteTree.METAEXTRAHELP', "HTML tags for additional meta information. For example &lt;meta name=\"customName\" content=\"your custom content here\" /&gt;"))->addExtraClass('help')));
     $fields->addFieldsToTab('Root.SEO', array(GoogleSuggestField::create("SEOPageSubject", _t('SEO.SEOPageSubjectTitle', 'Subject of this page (required to view this page SEO score)')), LiteralField::create('', '<div class="message notice"><p>' . _t('SEO.SEOSaveNotice', "After making changes save this page to view the updated SEO score") . '</p></div>'), LiteralField::create('ScoreTitle', '<h4 class="seo_score">' . _t('SEO.SEOScore', 'SEO Score') . '</h4>'), LiteralField::create('Score', $this->getHTMLStars()), LiteralField::create('ScoreClear', '<div class="score_clear"></div>')));
     if ($this->checkPageSubjectDefined()) {
         $fields->addFieldsToTab('Root.SEO', array(LiteralField::create('SimplePageSubjectCheckValues', $this->getHTMLSimplePageSubjectTest())));
     }
     if ($this->seo_score < 12) {
         $fields->addFieldsToTab('Root.SEO', array(LiteralField::create('ScoreTipsTitle', '<h4 class="seo_score">' . _t('SEO.SEOScoreTips', 'SEO Score Tips') . '</h4>'), LiteralField::create('ScoreTips', $this->seo_score_tips)));
     }
 }
 function updateCMSFields(FieldList $fields)
 {
     $fields->removeFieldFromTab('Root.Members', 'Members');
     $fieldList = array('FirstName' => 'Name', 'Surname' => 'Last Name');
     $password = new ConfirmedPasswordField('Password', null, null, null, true);
     $password->setCanBeEmpty(true);
     $detailFormFields = new FieldList(new TabSet("Root", new Tab('Main', 'Main', new HeaderField('MemberDetailsHeader', "Personal Details"), new TextField("FirstName", "First Name"), new TextField("Surname", "Last Name"), new HeaderField('MemberUserDetailsHeader', "User Details"), $password, new TextField("Email", "Email"), new TextField("SecondEmail", "Second Email"), new TextField("Third Email", "Third Email"), new TextField("FoodPreference", "Food Preference"), new TextField("OtherFood", "Other Food"), new TextField("IRCHandle", "IRC Handle"), new TextField("TwitterName", "Twitter Name"), new TextField("LinkedInProfile", "LinkedIn Profile"), new TextField("JobTitle", "Job Title"), new TextField("Role", "Role"), new TextareaField("StatementOfInterest", "Statement Of Interest"), new HtmlEditorField("Bio", "Bio"))));
     // make table sortable for foundation-staff and supporting-cast
     if ($this->owner->Code == 'openstack-foundation-staff' || $this->owner->Code == 'supporting-cast') {
         $config = GridFieldConfig_RelationEditor::create(10);
         $config->getComponentByType('GridFieldDetailForm')->setFields($detailFormFields);
         $sort = new GridFieldSortableRows('SortOrder');
         $config->addComponent($sort);
         $config->removeComponentsByType('GridFieldPageCount');
         $config->removeComponentsByType('GridFieldPaginator');
         $dataColumns = $config->getComponentByType('GridFieldDataColumns');
         $dataColumns->setDisplayFields(array('SortOrder' => 'Order', 'FirstName' => 'Name', 'Surname' => 'Surname', 'Email' => 'Email'));
     } else {
         $config = GridFieldConfig_RelationEditor::create(10);
         $config->getComponentByType('GridFieldDetailForm')->setFields($detailFormFields);
     }
     $manager = new GridField('Members', 'Members', $this->owner->Members(), $config);
     $fields->addFieldToTab('Root.Members', $manager);
     $fields->push(new HiddenField("GroupEdtion", "GroupEdtion", "1"));
 }
 public function updateCMSFields(FieldList $fields)
 {
     $fields->removeFieldFromTab("Root.Main", $this->SortFieldForDataObjectSorter());
     if (!$this->owner instanceof SiteTree) {
         $link = self::dataObjectSorterPopupLink();
         $fields->addFieldToTab("Root.Sort", new LiteralField("DataObjectSorterPopupLink", $link));
     }
     return $fields;
 }
 /**
  * Checks for frontEndAdmin or HTTP_X_FRONT_END_ADMIN and removes the Content
  * field from the page.
  *
  * To ensure saving pages from within the admin panel does not overwrite content saved from the front end editor
  * set the X-REMOVE-CONTENT header or frontEndAdmin query string and the content field will be removed here
  *
  * @param FieldList $fields
  */
 public function updateCMSFields(FieldList $fields)
 {
     $controller = Controller::curr();
     $isEditController = $controller instanceof CMSPageEditController;
     $xfrontEndAdmin = filter_input(INPUT_SERVER, 'HTTP_X_FRONT_END_ADMIN') == "true";
     $frontEndAdmin = $controller->getRequest()->getVar('frontEndAdmin') == "true";
     if ($isEditController && ($xfrontEndAdmin || $frontEndAdmin)) {
         $fields->removeFieldFromTab("Root.Main", "Content");
     }
 }
 public function updateCMSFields(FieldList $fields)
 {
     if ($themeField = $fields->fieldByName('Root.Main.Theme')) {
         $fields->removeFieldFromTab('Root.Main', 'Theme');
         $fields->addFieldToTab('Root.Appearance.Main', $themeField);
     }
     $fields->addFieldsToTab('Root.Appearance.Main', array(UploadField::create('Logo', 'Logo')->setDescription('Upload the site logo')));
     // Navigation
     $fields->addFieldsToTab('Root.Appearance.Navigation', array(DropdownField::create('NavgationLevel', 'Max navigation level', array(0 => 'Infinite', 1 => '1', 2 => '2', 3 => '3', 4 => '4', 5 => '5', 6 => '6', 7 => '7', 8 => '8', 9 => '9'))));
     return $fields;
 }
Example #10
0
 /**
  * Caution: Only call on instances, not through a singleton.
  *
  * @return FieldSet
  */
 public function getCMSFields()
 {
     Requirements::javascript(SAPPHIRE_DIR . '/javascript/PermissionCheckboxSetField.js');
     $fields = new FieldList(new TabSet("Root", new Tab('Members', _t('SecurityAdmin.MEMBERS', 'Members'), new TextField("Title", $this->fieldLabel('Title')), $memberList = new MemberTableField(Controller::has_curr() ? Controller::curr() : new Controller(), "Members", $this, null, false)), $permissionsTab = new Tab('Permissions', _t('SecurityAdmin.PERMISSIONS', 'Permissions'), new PermissionCheckboxSetField('Permissions', false, 'Permission', 'GroupID', $this)), new Tab('IPAddresses', _t('Security.IPADDRESSES', 'IP Addresses'), new LiteralField("", _t('SecurityAdmin.IPADDRESSESHELP', "<p>You can restrict this group to a particular \n\t\t\t\t\t\tIP address range (one range per line). <br />Ranges can be in any of the following forms: <br />\n\t\t\t\t\t\t203.96.152.12<br />\n\t\t\t\t\t\t203.96.152/24<br />\n\t\t\t\t\t\t203.96/16<br />\n\t\t\t\t\t\t203/8<br /><br />If you enter one or more IP address ranges in this box, then members will only get\n\t\t\t\t\t\tthe rights of being in this group if they log on from one of the valid IP addresses.  It won't prevent\n\t\t\t\t\t\tpeople from logging in.  This is because the same user might have to log in to access parts of the\n\t\t\t\t\t\tsystem without IP address restrictions.")), new TextareaField("IPRestrictions", "IP Ranges", 10))));
     // Only add a dropdown for HTML editor configurations if more than one is available.
     // Otherwise Member->getHtmlEditorConfigForCMS() will default to the 'cms' configuration.
     $editorConfigMap = HtmlEditorConfig::get_available_configs_map();
     if (count($editorConfigMap) > 1) {
         $fields->addFieldToTab('Root.Permissions', new DropdownField('HtmlEditorConfig', 'HTML Editor Configuration', $editorConfigMap), 'Permissions');
     }
     if (!Permission::check('EDIT_PERMISSIONS')) {
         $fields->removeFieldFromTab('Root', 'Permissions');
         $fields->removeFieldFromTab('Root', 'IP Addresses');
     }
     // Only show the "Roles" tab if permissions are granted to edit them,
     // and at least one role exists
     if (Permission::check('APPLY_ROLES') && DataObject::get('PermissionRole')) {
         $fields->findOrMakeTab('Root.Roles', _t('SecurityAdmin.ROLES', 'Roles'));
         $fields->addFieldToTab('Root.Roles', new LiteralField("", "<p>" . _t('SecurityAdmin.ROLESDESCRIPTION', "This section allows you to add roles to this group. Roles are logical groupings of permissions, which can be editied in the Roles tab") . "</p>"));
         // Add roles (and disable all checkboxes for inherited roles)
         $allRoles = Permission::check('ADMIN') ? DataObject::get('PermissionRole') : DataObject::get('PermissionRole', 'OnlyAdminCanApply = 0');
         $groupRoles = $this->Roles();
         $inheritedRoles = new ArrayList();
         $ancestors = $this->getAncestors();
         foreach ($ancestors as $ancestor) {
             $ancestorRoles = $ancestor->Roles();
             if ($ancestorRoles) {
                 $inheritedRoles->merge($ancestorRoles);
             }
         }
         $fields->findOrMakeTab('Root.Roles', 'Root.' . _t('SecurityAdmin.ROLES', 'Roles'));
         $fields->addFieldToTab('Root.Roles', $rolesField = new CheckboxSetField('Roles', 'Roles', $allRoles));
         $rolesField->setDefaultItems($inheritedRoles->column('ID'));
         $rolesField->setDisabledItems($inheritedRoles->column('ID'));
     }
     $memberList->setPermissions(array('edit', 'delete', 'export', 'add', 'inlineadd'));
     $memberList->setPopupCaption(_t('SecurityAdmin.VIEWUSER', 'View User'));
     $fields->push($idField = new HiddenField("ID"));
     $this->extend('updateCMSFields', $fields);
     return $fields;
 }
Example #11
0
 public function updateCMSFields(FieldList $f)
 {
     $f->addFieldToTab('Root.Main', TextField::create('Phone', 'Phone'));
     $f->addFieldToTab('Root.Main', TextField::create('Fax', 'Fax'));
     $f->addFieldToTab('Root.Main', TextField::create('Address', 'Address'));
     $f->addFieldToTab('Root.Main', TextField::create('City', 'City'));
     $f->addFieldToTab('Root.Main', TextField::create('Province', 'Province'));
     $f->addFieldToTab('Root.Main', TextField::create('Postal', 'Postal'));
     $f->addFieldToTab('Root.Main', EmailField::create('Email', 'Email'));
     $f->removeFieldFromTab('Root.Main', 'Theme');
     return $f;
 }
Example #12
0
 function updateCMSFields(FieldList $fields)
 {
     $fields->removeFieldFromTab('Root.Members', 'Members');
     $fieldList = array('FirstName' => 'Name', 'Surname' => 'Last Name');
     $password = new ConfirmedPasswordField('Password', null, null, null, true);
     $password->setCanBeEmpty(true);
     $detailFormFields = new FieldList(new TabSet("Root", new Tab('Main', 'Main', new HeaderField('MemberDetailsHeader', "Personal Details"), new TextField("FirstName", "First Name"), new TextField("Surname", "Last Name"), new HeaderField('MemberUserDetailsHeader', "User Details"), $password, new TextField("Email", "Email"), new TextField("SecondEmail", "Second Email"), new TextField("Third Email", "Third Email"), new TextField("FoodPreference", "Food Preference"), new TextField("OtherFood", "Other Food"), new TextField("IRCHandle", "IRC Handle"), new TextField("TwitterName", "Twitter Name"), new TextField("LinkedInProfile", "LinkedIn Profile"), new TextField("JobTitle", "Job Title"), new TextField("Role", "Role"), new TextareaField("StatementOfInterest", "Statement Of Interest"), new HtmlEditorField("Bio", "Bio"))));
     $config = GridFieldConfig_RelationEditor::create(10);
     $config->getComponentByType('GridFieldDetailForm')->setFields($detailFormFields);
     $manager = new GridField('Members', 'Members', $this->owner->Members(), $config);
     $fields->addFieldToTab('Root.Members', $manager);
     $fields->push(new HiddenField("GroupEdtion", "GroupEdtion", "1"));
 }
Example #13
0
 /**
  * Test removing a single field from a tab in a set.
  */
 public function testRemoveSingleFieldFromTab()
 {
     $fields = new FieldList();
     $tab = new Tab('Root');
     $fields->push($tab);
     /* We add a field to the "Root" tab */
     $fields->addFieldToTab('Root', new TextField('Country'));
     /* We have 1 field inside the tab, which is the field we just created */
     $this->assertEquals(1, $tab->Fields()->Count());
     /* We remove the field from the tab */
     $fields->removeFieldFromTab('Root', 'Country');
     /* We'll have no fields in the tab now */
     $this->assertEquals(0, $tab->Fields()->Count());
 }
 /**
  * {@inheritdoc}
  */
 public function updateCMSFields(FieldList $fields)
 {
     $fields->removeByName('URLSegment');
     // Remove the automatically-generated posts tab.
     $fields->removeFieldFromTab('Root', 'BlogPosts');
     // Construct a better posts tab.
     Requirements::css(BLOGGER_DIR . '/css/cms.css');
     Requirements::javascript(BLOGGER_DIR . '/js/cms.js');
     $tab = new Tab('BlogPosts', 'Blog Posts');
     $gridField = new GridField('BlogPosts', 'Blog Posts', $this->owner->BlogPosts(), new GridFieldConfig_BlogPost());
     $tab->Fields()->add($gridField);
     $fields->addFieldToTab('Root', $tab);
     return $fields;
 }
    public function afterUpdateCMSFields(FieldList $fields)
    {
        self::$runs++;
        /** @var ToggleCompositeField $metaDataChildren */
        $metaDataChildren = $fields->fieldByName('Root.Main.Metadata');
        $length = $this->owner->config()->MetaDescriptionLength ?: $this->MetaDescriptionLength;
        $metaDataChildren->fieldByName('MetaDescription')->setAttribute('maxlength', $length);
        $children = array_merge([$metaTitle = TextField::create('MetaTitle')], $metaDataChildren->getChildren()->toArray());
        $fields->removeFieldFromTab('Root.Main', 'Metadata');
        $fields->addFieldToTab('Root', Tab::create('Metadata'), 'Content');
        //Add META Title tag to METADATA
        $fields->addFieldsToTab('Root.Metadata', $children);
        $metaTitle->setDescription('Displayed as the tab/window name; Also displayed in search engine result listings as the page title.<br />
									Falls back to the Primary Heading field if not provided.');
    }
 function updateCMSFields(FieldList $fields)
 {
     $lists = CampaignMonitorSignupPage::get_ready_ones();
     if ($lists && $lists->count()) {
         $options = array(0 => _t("EcommerceNewsletterCampaignMonitorSignup.PLEASE_SELECT", "-- please select --")) + $lists->map()->toArray();
         if ($this->owner->CampaignMonitorSignupPageID) {
             $fields->addFieldsToTab("Root.Newsletter", array(new DropdownField("CampaignMonitorSignupPageID", _t("EcommerceNewsletterCampaignMonitorSignup.SIGN_UP_TO", "Sign-up for ..."), $options), new TextField("CampaignMonitorSignupHeader", _t("EcommerceNewsletterCampaignMonitorSignup.HEADER", "Header")), new TextField("CampaignMonitorSignupIntro", _t("EcommerceNewsletterCampaignMonitorSignup.INTRO", "Intro")), new TextField("CampaignMonitorSignupLabel", _t("EcommerceNewsletterCampaignMonitorSignup.LABEL", "Label"))));
         } else {
             $fields->addFieldsToTab("Root.Newsletter", array(new DropdownField("CampaignMonitorSignupPageID", _t("EcommerceNewsletterCampaignMonitorSignup.SIGN_UP_TO", "Sign-up for ..."), $options)));
             $fields->removeFieldsFromTab("Root.Main", array("CampaignMonitorSignupHeader", "CampaignMonitorSignupIntro", "CampaignMonitorSignupLabel"));
         }
     } else {
         $fields->addFieldsToTab("Root.Newsletter", array(new LiteralField("ListExplanation", "<p class=\"message warning\">\n\t\t\t\t\t\t" . _t("EcommerceNewsletterCampaignMonitorSignup.RECOMMENDATION_TO_SETUP", "It is recommended you set up a Campaign Monitor Page with a valid list to subscribe to.") . "\n\t\t\t\t\t\t</p>"), new TextField("CampaignMonitorSignupHeader", _t("EcommerceNewsletterCampaignMonitorSignup.HEADER", "Header")), new TextField("CampaignMonitorSignupIntro", _t("EcommerceNewsletterCampaignMonitorSignup.INTRO", "Intro")), new TextField("CampaignMonitorSignupLabel", _t("EcommerceNewsletterCampaignMonitorSignup.LABEL", "Label"))));
         $fields->removeFieldFromTab("Root.Main", "CampaignMonitorSignupPageID");
     }
 }
 public function updateCMSFields(FieldList $fields)
 {
     if (Permission::check('ADMIN')) {
         // get a list of all page types.
         $SubClasses = ClassInfo::getValidSubClasses('SiteTree');
         $ClassOptions = array();
         foreach ($SubClasses as $SubClass) {
             if ($SubClass != 'SiteTree') {
                 $ClassOptions[$SubClass] = $SubClass;
             }
         }
         $fields->addFieldToTab("Root.Permissions", new CheckboxSetField("BlockPageTypes", "Block these page type so users cannot create", $ClassOptions));
     } else {
         $fields->removeByName('Access');
         $fields->removeFieldFromTab('Root.Main', 'Theme');
     }
 }
    public function updateCMSFields(FieldList $fields)
    {
        //change Page Name label to Primary Heading - H1 - Only if the title hasn't already been changed
        /** @var TextField $titleField */
        $titleField = $fields->dataFieldByName('Title');
        if ($titleField->Title() == 'Page Name') {
            $fields->renameField('Title', 'Primary Heading');
        }
        //Add secondary heading - H2
        $fields->insertAfter(TextField::create('SubTitle', 'Secondary Heading'), 'Title');
        //Move meta fields to their own tab
        /** @var ToggleCompositeField $metaDataChildren */
        $metaDataChildren = $fields->fieldByName('Root.Main.Metadata');
        $children = array_merge([$metaTitle = TextField::create('MetaTitle')], $metaDataChildren->getChildren()->toArray());
        $fields->removeFieldFromTab('Root.Main', 'Metadata');
        $fields->addFieldToTab('Root', Tab::create('Metadata'), 'Content');
        //Add META Title tag to METADATA
        $fields->addFieldsToTab('Root.Metadata', $children);
        $metaTitle->setDescription('Displayed as the tab/window name; Also displayed in search engine result listings as the page title.<br />
									Falls back to the Primary Heading field if not provided.');
    }
 public function updateSettingsFields(FieldList $fields)
 {
     $fields->addFieldToTab("Root.Settings", new Checkboxfield('DisplayFullPosts', 'Display full posts on Blog page?'));
     $fields->removeFieldFromTab("Root.Settings", "ProvideComments");
     return $fields;
 }
Example #20
0
	/**
	 * Returns a FieldList with which to create the main editing form.
	 *
	 * You can override this in your child classes to add extra fields - first
	 * get the parent fields using parent::getCMSFields(), then use
	 * addFieldToTab() on the FieldList.
	 * 
	 * See {@link getSettingsFields()} for a different set of fields
	 * concerned with configuration aspects on the record, e.g. access control
	 *
	 * @return FieldList The fields to be displayed in the CMS.
	 */
	function getCMSFields() {
		require_once("forms/Form.php");
		// Status / message
		// Create a status message for multiple parents
		if($this->ID && is_numeric($this->ID)) {
			$linkedPages = $this->VirtualPages();

			$parentPageLinks = array();

			if($linkedPages->Count() > 0) {
				foreach($linkedPages as $linkedPage) {
					$parentPage = $linkedPage->Parent;
					if($parentPage) {
						if($parentPage->ID) {
							$parentPageLinks[] = "<a class=\"cmsEditlink\" href=\"admin/show/$linkedPage->ID\">{$parentPage->Title}</a>";
						} else {
							$parentPageLinks[] = "<a class=\"cmsEditlink\" href=\"admin/show/$linkedPage->ID\">" .
								_t('SiteTree.TOPLEVEL', 'Site Content (Top Level)') .
								"</a>";
						}
					}
				}

				$lastParent = array_pop($parentPageLinks);
				$parentList = "'$lastParent'";

				if(count($parentPageLinks) > 0) {
					$parentList = "'" . implode("', '", $parentPageLinks) . "' and "
						. $parentList;
				}

				$statusMessage[] = sprintf(
					_t('SiteTree.APPEARSVIRTUALPAGES', "This content also appears on the virtual pages in the %s sections."),
					$parentList
				);
			}
		}

		if($this->HasBrokenLink || $this->HasBrokenFile) {
			$statusMessage[] = _t('SiteTree.HASBROKENLINKS', "This page has broken links.");
		}
		
		$dependentNote = '';
		$dependentTable = new LiteralField('DependentNote', '<p></p>');
		
		// Create a table for showing pages linked to this one
		$dependentPagesCount = $this->DependentPagesCount();
		if($dependentPagesCount) {
			$dependentColumns = array(
				'Title' => $this->fieldLabel('Title'),
				'AbsoluteLink' => _t('SiteTree.DependtPageColumnURL', 'URL'),
				'DependentLinkType' => _t('SiteTree.DependtPageColumnLinkType', 'Link type'),
			);
			if(class_exists('Subsite')) $dependentColumns['Subsite.Title'] = singleton('Subsite')->i18n_singular_name();
			
			$dependentNote = new LiteralField('DependentNote', '<p>' . _t('SiteTree.DEPENDENT_NOTE', 'The following pages depend on this page. This includes virtual pages, redirector pages, and pages with content links.') . '</p>');
			$dependentTable = new TableListField(
				'DependentPages',
				$this->DependentPages(),
				$dependentColumns
			);
			$dependentTable->setFieldFormatting(array(
				'Title' => '<a href=\"admin/show/$ID\">$Title</a>',
				'AbsoluteLink' => '<a href=\"$value\">$value</a>',
			));
			$dependentTable->setPermissions(array(
				'show',
				'export'
			));
		}
		
		$baseLink = Controller::join_links (
			Director::absoluteBaseURL(),
			(self::nested_urls() && $this->ParentID ? $this->Parent()->RelativeLink(true) : null)
		);
		
		
		
		$url = (strlen($baseLink) > 36) ? "..." .substr($baseLink, -32) : $baseLink;
		$urlsegment = new SiteTreeURLSegmentField("URLSegment", $this->fieldLabel('URLSegment'));
		$urlsegment->setURLPrefix($url);
		$urlsegment->setHelpText(self::nested_urls() && count($this->Children()) ? $this->fieldLabel('LinkChangeNote'): false);
		
		$fields = new FieldList(
			$rootTab = new TabSet("Root",
				$tabMain = new Tab('Main',
					new TextField("Title", $this->fieldLabel('Title')),
					new TextField("MenuTitle", $this->fieldLabel('MenuTitle')),
					$htmlField = new HtmlEditorField("Content", _t('SiteTree.HTMLEDITORTITLE', "Content", 'HTML editor title'))
				),
				$tabMeta = new Tab('Metadata',
					$urlsegment,
					new TextField("MetaTitle", $this->fieldLabel('MetaTitle')),
					new TextareaField("MetaKeywords", $this->fieldLabel('MetaKeywords'), 1),
					new TextareaField("MetaDescription", $this->fieldLabel('MetaDescription')),
					new TextareaField("ExtraMeta",$this->fieldLabel('ExtraMeta'))
				),
				$tabDependent = new Tab('Dependent',
					$dependentNote,
					$dependentTable
				)
			)
		);
		$htmlField->addExtraClass('stacked');
		
		// Conditional dependent pages tab
		if($dependentPagesCount) $tabDependent->setTitle(_t('SiteTree.TABDEPENDENT', "Dependent pages") . " ($dependentPagesCount)");
		else $fields->removeFieldFromTab('Root', 'Dependent');
		
		$tabMain->setTitle(_t('SiteTree.TABCONTENT', "Main Content"));
		$tabMeta->setTitle(_t('SiteTree.TABMETA', "Metadata"));

		if(file_exists(BASE_PATH . '/install.php')) {
			$fields->addFieldToTab("Root.Main", new LiteralField("InstallWarningHeader", 
				"<p class=\"message warning\">" . _t("SiteTree.REMOVE_INSTALL_WARNING", 
				"Warning: You should remove install.php from this SilverStripe install for security reasons.")
				. "</p>"), "Title");
		}

		
		if(self::$runCMSFieldsExtensions) {
			$this->extend('updateCMSFields', $fields);
		}

		return $fields;
	}
 /**
  * @param FieldList $fields
  */
 public function updateCMSFields(FieldList $fields)
 {
     $fields->replaceField('GUID', new ReadonlyField('GUID'));
     $fields->removeFieldFromTab('Root', 'SAMLSessionIndex');
 }
Example #22
0
 /**
  * Return the FieldSet used to edit this folder in the CMS.
  * You can modify this fieldset by subclassing folder, or by creating a {@link DataExtension}
  * and implemeting updateCMSFields(FieldList $fields) on that extension.
  */
 function getCMSFields()
 {
     $fileList = new AssetTableField($this, "Files", "File", array("Title" => _t('Folder.TITLE', "Title"), "Filename" => _t('Folder.FILENAME', "Filename")), "");
     $fileList->setFolder($this);
     $fileList->setPopupCaption(_t('Folder.VIEWEDITASSET', "View/Edit Asset"));
     $titleField = $this->ID && $this->ID != "root" ? new TextField("Title", _t('Folder.TITLE')) : new HiddenField("Title");
     if ($this->canEdit()) {
         $deleteButton = new InlineFormAction('deletemarked', _t('Folder.DELSELECTED', 'Delete selected files'), 'delete');
         $deleteButton->includeDefaultJS(false);
     } else {
         $deleteButton = new HiddenField('deletemarked');
     }
     $fields = new FieldList(new HiddenField("Name"), new TabSet("Root", new Tab("Files", _t('Folder.FILESTAB', "Files"), $titleField, $fileList, new HiddenField("DestFolderID")), new Tab("Details", _t('Folder.DETAILSTAB', "Details"), new ReadonlyField("URL", _t('Folder.URL', 'URL')), new ReadonlyField("ClassName", _t('Folder.TYPE', 'Type')), new ReadonlyField("Created", _t('Folder.CREATED', 'First Uploaded')), new ReadonlyField("LastEdited", _t('Folder.LASTEDITED', 'Last Updated'))), new Tab("Upload", _t('Folder.UPLOADTAB', "Upload"), new LiteralField("UploadIframe", $this->getUploadIframe()))), new HiddenField("ID"));
     if (!$this->canEdit()) {
         $fields->removeFieldFromTab("Root", "Upload");
     }
     $this->extend('updateCMSFields', $fields);
     return $fields;
 }
Example #23
0
 /**
  * Returns a FieldList with which to create the main editing form.
  *
  * You can override this in your child classes to add extra fields - first get the parent fields using
  * parent::getCMSFields(), then use addFieldToTab() on the FieldList.
  *
  * See {@link getSettingsFields()} for a different set of fields concerned with configuration aspects on the record,
  * e.g. access control.
  *
  * @return FieldList The fields to be displayed in the CMS
  */
 public function getCMSFields()
 {
     require_once "forms/Form.php";
     // Status / message
     // Create a status message for multiple parents
     if ($this->ID && is_numeric($this->ID)) {
         $linkedPages = $this->VirtualPages();
         $parentPageLinks = array();
         if ($linkedPages->Count() > 0) {
             foreach ($linkedPages as $linkedPage) {
                 $parentPage = $linkedPage->Parent;
                 if ($parentPage) {
                     if ($parentPage->ID) {
                         $parentPageLinks[] = "<a class=\"cmsEditlink\" href=\"admin/pages/edit/show/{$linkedPage->ID}\">{$parentPage->Title}</a>";
                     } else {
                         $parentPageLinks[] = "<a class=\"cmsEditlink\" href=\"admin/pages/edit/show/{$linkedPage->ID}\">" . _t('SiteTree.TOPLEVEL', 'Site Content (Top Level)') . "</a>";
                     }
                 }
             }
             $lastParent = array_pop($parentPageLinks);
             $parentList = "'{$lastParent}'";
             if (count($parentPageLinks) > 0) {
                 $parentList = "'" . implode("', '", $parentPageLinks) . "' and " . $parentList;
             }
             $statusMessage[] = _t('SiteTree.APPEARSVIRTUALPAGES', "This content also appears on the virtual pages in the {title} sections.", array('title' => $parentList));
         }
     }
     if ($this->HasBrokenLink || $this->HasBrokenFile) {
         $statusMessage[] = _t('SiteTree.HASBROKENLINKS', "This page has broken links.");
     }
     $dependentNote = '';
     $dependentTable = new LiteralField('DependentNote', '<p></p>');
     // Create a table for showing pages linked to this one
     $dependentPages = $this->DependentPages();
     $dependentPagesCount = $dependentPages->Count();
     if ($dependentPagesCount) {
         $dependentColumns = array('Title' => $this->fieldLabel('Title'), 'AbsoluteLink' => _t('SiteTree.DependtPageColumnURL', 'URL'), 'DependentLinkType' => _t('SiteTree.DependtPageColumnLinkType', 'Link type'));
         if (class_exists('Subsite')) {
             $dependentColumns['Subsite.Title'] = singleton('Subsite')->i18n_singular_name();
         }
         $dependentNote = new LiteralField('DependentNote', '<p>' . _t('SiteTree.DEPENDENT_NOTE', 'The following pages depend on this page. This includes virtual pages, redirector pages, and pages with content links.') . '</p>');
         $dependentTable = GridField::create('DependentPages', false, $dependentPages);
         $dependentTable->getConfig()->getComponentByType('GridFieldDataColumns')->setDisplayFields($dependentColumns)->setFieldFormatting(array('Title' => function ($value, &$item) {
             return sprintf('<a href="admin/pages/edit/show/%d">%s</a>', (int) $item->ID, Convert::raw2xml($item->Title));
         }, 'AbsoluteLink' => function ($value, &$item) {
             return sprintf('<a href="%s" target="_blank">%s</a>', Convert::raw2xml($value), Convert::raw2xml($value));
         }));
     }
     $baseLink = Controller::join_links(Director::absoluteBaseURL(), self::config()->nested_urls && $this->ParentID ? $this->Parent()->RelativeLink(true) : null);
     $urlsegment = new SiteTreeURLSegmentField("URLSegment", $this->fieldLabel('URLSegment'));
     $urlsegment->setURLPrefix($baseLink);
     $helpText = self::config()->nested_urls && count($this->Children()) ? $this->fieldLabel('LinkChangeNote') : '';
     if (!Config::inst()->get('URLSegmentFilter', 'default_allow_multibyte')) {
         $helpText .= $helpText ? '<br />' : '';
         $helpText .= _t('SiteTreeURLSegmentField.HelpChars', ' Special characters are automatically converted or removed.');
     }
     $urlsegment->setHelpText($helpText);
     $fields = new FieldList($rootTab = new TabSet("Root", $tabMain = new Tab('Main', new TextField("Title", $this->fieldLabel('Title')), $urlsegment, new TextField("MenuTitle", $this->fieldLabel('MenuTitle')), $htmlField = new HtmlEditorField("Content", _t('SiteTree.HTMLEDITORTITLE', "Content", 'HTML editor title')), ToggleCompositeField::create('Metadata', _t('SiteTree.MetadataToggle', 'Metadata'), array($metaFieldDesc = new TextareaField("MetaDescription", $this->fieldLabel('MetaDescription')), $metaFieldExtra = new TextareaField("ExtraMeta", $this->fieldLabel('ExtraMeta'))))->setHeadingLevel(4)), $tabDependent = new Tab('Dependent', $dependentNote, $dependentTable)));
     $htmlField->addExtraClass('stacked');
     // Help text for MetaData on page content editor
     $metaFieldDesc->setRightTitle(_t('SiteTree.METADESCHELP', "Search engines use this content for displaying search results (although it will not influence their ranking)."))->addExtraClass('help');
     $metaFieldExtra->setRightTitle(_t('SiteTree.METAEXTRAHELP', "HTML tags for additional meta information. For example &lt;meta name=\"customName\" content=\"your custom content here\" /&gt;"))->addExtraClass('help');
     // Conditional dependent pages tab
     if ($dependentPagesCount) {
         $tabDependent->setTitle(_t('SiteTree.TABDEPENDENT', "Dependent pages") . " ({$dependentPagesCount})");
     } else {
         $fields->removeFieldFromTab('Root', 'Dependent');
     }
     $tabMain->setTitle(_t('SiteTree.TABCONTENT', "Main Content"));
     if ($this->ObsoleteClassName) {
         $obsoleteWarning = _t('SiteTree.OBSOLETECLASS', "This page is of obsolete type {type}. Saving will reset its type and you may lose data", array('type' => $this->ObsoleteClassName));
         $fields->addFieldToTab("Root.Main", new LiteralField("ObsoleteWarningHeader", "<p class=\"message warning\">{$obsoleteWarning}</p>"), "Title");
     }
     if (file_exists(BASE_PATH . '/install.php')) {
         $fields->addFieldToTab("Root.Main", new LiteralField("InstallWarningHeader", "<p class=\"message warning\">" . _t("SiteTree.REMOVE_INSTALL_WARNING", "Warning: You should remove install.php from this SilverStripe install for security reasons.") . "</p>"), "Title");
     }
     // Backwards compat: Rewrite nested "Content" tabs to toplevel
     $fields->setTabPathRewrites(array('/^Root\\.Content\\.Main$/' => 'Root.Main', '/^Root\\.Content\\.([^.]+)$/' => 'Root.\\1'));
     if (self::$runCMSFieldsExtensions) {
         $this->extend('updateCMSFields', $fields);
     }
     return $fields;
 }
 /**
  * Caution: Only call on instances, not through a singleton.
  * The "root group" fields will be created through {@link SecurityAdmin->EditForm()}.
  *
  * @return FieldList
  */
 public function getCMSFields()
 {
     Requirements::javascript(FRAMEWORK_DIR . '/javascript/PermissionCheckboxSetField.js');
     $fields = new FieldList(new TabSet("Root", new Tab('Members', _t('SecurityAdmin.MEMBERS', 'Members'), new TextField("Title", $this->fieldLabel('Title')), $parentidfield = DropdownField::create('ParentID', $this->fieldLabel('Parent'), Group::get()->exclude('ID', $this->ID)->map('ID', 'Breadcrumbs'))->setEmptyString(' '), new TextareaField('Description', $this->fieldLabel('Description'))), $permissionsTab = new Tab('Permissions', _t('SecurityAdmin.PERMISSIONS', 'Permissions'), $permissionsField = new PermissionCheckboxSetField('Permissions', false, 'Permission', 'GroupID', $this))));
     $parentidfield->setDescription(_t('Group.GroupReminder', 'If you choose a parent group, this group will take all it\'s roles'));
     // Filter permissions
     // TODO SecurityAdmin coupling, not easy to get to the form fields through GridFieldDetailForm
     $permissionsField->setHiddenPermissions((array) Config::inst()->get('SecurityAdmin', 'hidden_permissions'));
     if ($this->ID) {
         $group = $this;
         $config = GridFieldConfig_RelationEditor::create();
         $config->addComponent(new GridFieldButtonRow('after'));
         $config->addComponents(new GridFieldExportButton('buttons-after-left'));
         $config->addComponents(new GridFieldPrintButton('buttons-after-left'));
         $config->getComponentByType('GridFieldAddExistingAutocompleter')->setResultsFormat('$Title ($Email)')->setSearchFields(array('FirstName', 'Surname', 'Email'));
         $config->getComponentByType('GridFieldDetailForm')->setValidator(new Member_Validator())->setItemEditFormCallback(function ($form, $component) use($group) {
             $record = $form->getRecord();
             $groupsField = $form->Fields()->dataFieldByName('DirectGroups');
             if ($groupsField) {
                 // If new records are created in a group context,
                 // set this group by default.
                 if ($record && !$record->ID) {
                     $groupsField->setValue($group->ID);
                 } elseif ($record && $record->ID) {
                     // TODO Mark disabled once chosen.js supports it
                     // $groupsField->setDisabledItems(array($group->ID));
                     $form->Fields()->replaceField('DirectGroups', $groupsField->performReadonlyTransformation());
                 }
             }
         });
         $memberList = GridField::create('Members', false, $this->DirectMembers(), $config)->addExtraClass('members_grid');
         // @todo Implement permission checking on GridField
         //$memberList->setPermissions(array('edit', 'delete', 'export', 'add', 'inlineadd'));
         $fields->addFieldToTab('Root.Members', $memberList);
     }
     // Only add a dropdown for HTML editor configurations if more than one is available.
     // Otherwise Member->getHtmlEditorConfigForCMS() will default to the 'cms' configuration.
     $editorConfigMap = HtmlEditorConfig::get_available_configs_map();
     if (count($editorConfigMap) > 1) {
         $fields->addFieldToTab('Root.Permissions', new DropdownField('HtmlEditorConfig', 'HTML Editor Configuration', $editorConfigMap), 'Permissions');
     }
     if (!Permission::check('EDIT_PERMISSIONS')) {
         $fields->removeFieldFromTab('Root', 'Permissions');
     }
     // Only show the "Roles" tab if permissions are granted to edit them,
     // and at least one role exists
     if (Permission::check('APPLY_ROLES') && DataObject::get('PermissionRole')) {
         $fields->findOrMakeTab('Root.Roles', _t('SecurityAdmin.ROLES', 'Roles'));
         $fields->addFieldToTab('Root.Roles', new LiteralField("", "<p>" . _t('SecurityAdmin.ROLESDESCRIPTION', "Roles are predefined sets of permissions, and can be assigned to groups.<br />" . "They are inherited from parent groups if required.") . '<br />' . sprintf('<a href="%s" class="add-role">%s</a>', singleton('SecurityAdmin')->Link('show/root#Root_Roles'), _t('Group.RolesAddEditLink', 'Manage roles')) . "</p>"));
         // Add roles (and disable all checkboxes for inherited roles)
         $allRoles = PermissionRole::get();
         if (!Permission::check('ADMIN')) {
             $allRoles = $allRoles->filter("OnlyAdminCanApply", 0);
         }
         if ($this->ID) {
             $groupRoles = $this->Roles();
             $inheritedRoles = new ArrayList();
             $ancestors = $this->getAncestors();
             foreach ($ancestors as $ancestor) {
                 $ancestorRoles = $ancestor->Roles();
                 if ($ancestorRoles) {
                     $inheritedRoles->merge($ancestorRoles);
                 }
             }
             $groupRoleIDs = $groupRoles->column('ID') + $inheritedRoles->column('ID');
             $inheritedRoleIDs = $inheritedRoles->column('ID');
         } else {
             $groupRoleIDs = array();
             $inheritedRoleIDs = array();
         }
         $rolesField = ListboxField::create('Roles', false, $allRoles->map()->toArray())->setDefaultItems($groupRoleIDs)->setAttribute('data-placeholder', _t('Group.AddRole', 'Add a role for this group'))->setDisabledItems($inheritedRoleIDs);
         if (!$allRoles->Count()) {
             $rolesField->setAttribute('data-placeholder', _t('Group.NoRoles', 'No roles found'));
         }
         $fields->addFieldToTab('Root.Roles', $rolesField);
     }
     $fields->push($idField = new HiddenField("ID"));
     $this->extend('updateCMSFields', $fields);
     return $fields;
 }
 public function updateSettingsFields(FieldList $fields)
 {
     $fields->removeFieldFromTab("Root.Settings", "Visibility");
 }
 public function updateCMSFields(FieldList $fields)
 {
     $fields->removeFieldFromTab("Root.Main", "MetaKeywords");
     $fields->removeFieldFromTab("Root.Main", "ExtraMeta");
     $fields->removeByName("Dependent");
 }
 /**
  * Return the FieldSet used to edit a dynamic template in the CMS.
  */
 function getCMSFields()
 {
     // // delete files button
     // if( $this->canEdit() ) {
     // 	$deleteButton = new InlineFormAction('deletemarked',_t('Folder.DELSELECTED','Delete selected files'), 'delete');
     // 	$deleteButton->includeDefaultJS(false);
     // } else {
     // 	$deleteButton = new HiddenField('deletemarked');
     // }
     // link file button
     if ($this->canEdit()) {
         $fileButtons = new CompositeField($linkFileButton = new InlineFormAction('linkfile', _t('DynamicTemplate.LINKFILE', 'Link file(s) from theme'), 'link'), $copyFileButton = new InlineFormAction('copyfile', _t('DynamicTemplate.COPYFILE', 'Copy file(s) from theme'), 'copy'), $newFileButton = new InlineFormAction('newfile', _t('DynamicTemplate.NEWFILE', 'New file'), 'newfile'));
         $linkFileButton->includeDefaultJS(false);
         $copyFileButton->includeDefaultJS(false);
         $newFileButton->includeDefaultJS(false);
     } else {
         $fileButtons = new HiddenField('linkfile');
     }
     $propButtons = new CompositeField();
     //		$propButtons->push($exportButton = new InlineFormAction('exporttemplate', _t('DynamicTemplate.EXPORTTEMPLATE', 'Export'), 'export'));
     //		$exportButton->includeDefaultJS(false);
     //		if ($this->canEdit()) {
     //			$propButtons->push($saveButton = new InlineFormAction('savetemplate', _t('DynamicTemplate.SAVETEMPLATE', 'Save'), 'save'));
     //			$saveButton->includeDefaultJS(false);
     //		}
     if (DynamicTemplateAdmin::tarball_available()) {
         $exportTarballButton = new InlineFormAction('exportastarball', _t('DynamicTemplate.EXPORT', 'Export as tarball'), 'exportastarball');
         $exportTarballButton->includeDefaultJS(false);
         $propButtons->push($exportTarballButton);
     }
     if (DynamicTemplateAdmin::zip_available()) {
         $exportZipButton = new InlineFormAction('exportaszip', _t('DynamicTemplate.EXPORT', 'Export as zip'), 'exportaszip');
         $exportZipButton->includeDefaultJS(false);
         $propButtons->push($exportZipButton);
     }
     //		$titleField = ($this->ID && $this->ID != "root") ? new TextField("Title", _t('Folder.TITLE', 'Title')) : new HiddenField("Title");
     $titleField = new TextField("Title", _t('Folder.TITLE', 'Title'));
     if (!$this->canEdit()) {
         $titleField->setReadOnly(true);
     }
     $nameField = new TextField("Name");
     if (!$this->canEdit()) {
         $titleField->setReadOnly(true);
     }
     $fields = new FieldList($rootTabSet = new TabSet("Root", new Tab("Properties", _t('DynamicTemplate.PROPERTIESTAB', 'Properties'), $titleField, new ReadonlyField("URL", _t('Folder.URL', 'URL')), new ReadonlyField("Created", _t('Folder.CREATED', 'First Uploaded')), new ReadonlyField("LastEdited", _t('Folder.LASTEDITED', 'Last Updated')), new HiddenField("ID"), new HiddenField("ClassName", null, "DynamicTemplate"), $propButtons), new Tab("Upload", _t('Folder.UPLOADTAB', "Upload"), new LabelField('UploadPrompt', _t('DynamicTemplate.UPLOADPROMPT', 'Upload files to your template. Uploads will automatically be added to the right place.')), $this->getUploadField())));
     // A DT can only have files if it has been saved at least once. This is also to avoid time out issue where DynamicTemplatesFileField::calc_tree
     // tries to find files from a DT with ID=0
     if ($this->ID) {
         $fileList = new DynamicTemplateFilesField("Files", "Files", $this);
         $rootTabSet->push(new Tab("Files", _t('Folder.FILESTAB', "Files"), $fileList, $fileButtons, new HiddenField("FileIDs"), new HiddenField("DestFolderID")));
     }
     if (!$this->canEdit()) {
         $fields->removeFieldFromTab("Root", "Upload");
     }
     $this->extend('updateCMSFields', $fields);
     Session::set("dynamictemplates_currentID", $this->ID);
     return $fields;
 }
 public function updateSettingsFields(FieldList $fields)
 {
     $fields->removeFieldFromTab("Root.Settings", "ShowInSearch");
 }
 public function updateCMSFields(FieldList $fields)
 {
     $fields->removeFieldFromTab("Root", "DeliverySpecialChargedProducts");
     $fields->removeFieldFromTab("Root", "SpecialPricePostalCodes");
     $fields->addFieldsToTab("Root.Delivery", array(new TextField("DeliveryChargeTitle", "Delivery Charge Title"), new CurrencyField("PriceWithoutApplicableProducts", "Standard Delivery Charge without Special Products in order"), new CurrencyField("PriceWithApplicableProducts", "Standard Delivery Charge with Special Products in order"), new GridField("DeliverySpecialChargedProducts", "Products with special Delivery Charge", $this->owner->DeliverySpecialChargedProducts(), GridFieldEditOriginalPageConfigWithDelete::create()), new GridField("SpecialPricePostalCodes", "Special Price Postal Codes", $this->owner->SpecialPricePostalCodes(), GridFieldConfig_RelationEditor::create())));
 }