public function updateCMSFields(FieldList $fields)
 {
     // Payment Methods
     $payment_table = GridField::create('PaymentMethods', _t("CheckoutAdmin.PaymentMethods", "Payment Methods"), $this->owner->PaymentMethods(), GridFieldConfig::create()->addComponents(new GridFieldToolbarHeader(), new GridFieldAddNewButton('toolbar-header-right'), new GridFieldSortableHeader(), new GridFieldDataColumns(), new GridFieldPaginator(20), new GridFieldEditButton(), new GridFieldDeleteAction(), new GridFieldDetailForm()));
     // setup compressed payment options
     $payment_fields = ToggleCompositeField::create('PaymentSettings', _t("CheckoutAdmin.Payments", "Payment Settings"), array(TextField::create('PaymentNumberPrefix', _t("CheckoutAdmin.OrderPrefix", "Add prefix to order numbers"), null, 9)->setAttribute("placeholder", _t("CheckoutAdmin.OrderPrefixPlaceholder", "EG 'abc'")), TextAreaField::create('PaymentSuccessContent', _t("CheckoutAdmin.PaymentSuccessContent", "Payment successfull content"))->setRows(4)->setColumns(30)->addExtraClass('stacked'), TextAreaField::create('PaymentFailerContent', _t("CheckoutAdmin.PaymentFailerContent", "Payment failer content"))->setRows(4)->setColumns(30)->addExtraClass('stacked'), $payment_table));
     // Add html description of how to edit contries
     $country_html = "<div class=\"field\">";
     $country_html .= "<p>First select valid countries using the 2 character ";
     $country_html .= "shortcode (see http://fasteri.com/list/2/short-names-of-countries-and-iso-3166-codes).</p>";
     $country_html .= "<p>You can add multiple countries seperating them with";
     $country_html .= "a comma or use a '*' for all countries.</p>";
     $country_html .= "</div>";
     $country_html_field = LiteralField::create("CountryDescription", $country_html);
     // Deal with product features
     $postage_field = new GridField('PostageAreas', '', $this->owner->PostageAreas(), GridFieldConfig::create()->addComponents(new GridFieldButtonRow('before'), new GridFieldToolbarHeader(), new GridFieldTitleHeader(), new GridFieldEditableColumns(), new GridFieldDeleteAction(), new GridFieldAddNewInlineButton('toolbar-header-left')));
     // Add country dropdown to inline editing
     $postage_field->getConfig()->getComponentByType('GridFieldEditableColumns')->setDisplayFields(array('Title' => array('title' => 'Title', 'field' => 'TextField'), 'Country' => array('title' => 'ISO 3166 codes', 'field' => 'TextField'), 'ZipCode' => array('title' => 'Zip/Post Codes', 'field' => 'TextField'), 'Calculation' => array('title' => 'Base unit', 'callback' => function ($record, $column, $grid) {
         return DropdownField::create($column, "Based on", singleton('PostageArea')->dbObject('Calculation')->enumValues())->setValue("Weight");
     }), 'Unit' => array('title' => 'Unit (equals or above)', 'field' => 'NumericField'), 'Cost' => array('title' => 'Cost', 'field' => 'NumericField'), 'Tax' => array('title' => 'Tax (percentage)', 'field' => 'NumericField')));
     // Setup compressed postage options
     $postage_fields = ToggleCompositeField::create('PostageFields', 'Postage Options', array($country_html_field, $postage_field));
     // Setup compressed postage options
     $discount_fields = ToggleCompositeField::create('DiscountFields', 'Discounts', array(GridField::create('Discounts', '', $this->owner->Discounts(), GridFieldConfig_RecordEditor::create())));
     // Add config sets
     $fields->addFieldToTab('Root.Checkout', $payment_fields);
     $fields->addFieldToTab('Root.Checkout', $postage_fields);
     $fields->addFieldToTab('Root.Checkout', $discount_fields);
 }
 public function updateCMSFields(\FieldList $fields)
 {
     $fields->addFieldToTab("Root.FacebookFeed", new \TextField("FBAppID", "Facebook App ID"));
     $fields->addFieldToTab("Root.FacebookFeed", new \TextField("FBAppSecret", "Facebook App Secret"));
     $fields->addFieldToTab("Root.FacebookFeed", new \TextField("FBAccessToken", "Facebook Access Token"));
     $fields->addFieldToTab("Root.FacebookFeed", new \TextField("FBPageID", "Facebook Page ID"));
 }
 public function updateCMSFields(FieldList $fields)
 {
     $fields->addFieldToTab("Root.ContactDetails", new TextField("ContactDetailsName", "Name"));
     $fields->addFieldToTab("Root.ContactDetails", new TextareaField("ContactDetailsAddress", "Address"));
     $fields->addFieldToTab("Root.ContactDetails", new TextField("ContactDetailsPhone", "Phone"));
     $fields->addFieldToTab("Root.ContactDetails", new EmailField("ContactDetailsEmail", "Email"));
 }
 public function getCMSFields()
 {
     $conf = SiteConfig::current_site_config();
     $themes = $conf->getAvailableThemes();
     $theme = new DropdownField('Theme', _t('Multisites.THEME', 'Theme'), $themes);
     $theme->setEmptyString(_t('Multisites.DEFAULTTHEME', '(Default theme)'));
     $fields = new FieldList(new TabSet('Root', new Tab('Main', new HeaderField('SiteConfHeader', _t('Multisites.SITECONF', 'Site Configuration')), new TextField('Title', _t('Multisites.TITLE', 'Title')), new TextField('Tagline', _t('Multisites.TAGLINE', 'Tagline/Slogan')), $theme, new HeaderField('SiteURLHeader', _t('Multisites.SITEURL', 'Site URL')), new OptionsetField('Scheme', _t('Multisites.SCHEME', 'Scheme'), array('any' => _t('Multisites.ANY', 'Any'), 'http' => _t('Multisites.HTTP', 'HTTP'), 'https' => _t('Multisites.HTTPS', 'HTTPS (HTTP Secure)'))), new TextField('Host', _t('Multisites.HOST', 'Host')), new MultiValueTextField('HostAliases', _t('Multisites.HOSTALIASES', 'Host Aliases')), new CheckboxField('IsDefault', _t('Multisites.ISDEFAULT', 'Is this the default site?')), new HeaderField('SiteAdvancedHeader', _t('Multisites.SiteAdvancedHeader', 'Advanced Settings')), TextareaField::create('RobotsTxt', _t('Multisites.ROBOTSTXT', 'Robots.txt'))->setDescription(_t('Multisites.ROBOTSTXTUSAGE', '<p>Please consult <a href="http://www.robotstxt.org/robotstxt.html" target="_blank">http://www.robotstxt.org/robotstxt.html</a> for usage of the robots.txt file.</p>')))));
     $devIDs = Config::inst()->get('Multisites', 'developer_identifiers');
     if (is_array($devIDs)) {
         if (!ArrayLib::is_associative($devIDs)) {
             $devIDs = ArrayLib::valuekey($devIDs);
         }
         $fields->addFieldToTab('Root.Main', DropdownField::create('DevID', _t('Multisites.DeveloperIdentifier', 'Developer Identifier'), $devIDs));
     }
     if (Multisites::inst()->assetsSubfolderPerSite()) {
         $fields->addFieldToTab('Root.Main', new TreeDropdownField('FolderID', _t('Multisites.ASSETSFOLDER', 'Assets Folder'), 'Folder'), 'SiteURLHeader');
     }
     if (!Permission::check('SITE_EDIT_CONFIGURATION')) {
         foreach ($fields->dataFields() as $field) {
             $fields->makeFieldReadonly($field);
         }
     }
     $this->extend('updateSiteCMSFields', $fields);
     return $fields;
 }
 public function updateCMSFields(FieldList $fields)
 {
     $fields->addFieldToTab("Root.Orders", GridField::create("OrderNotifications", "Order status notifications", $this->owner->OrderNotifications(), GridFieldConfig_RecordEditor::create()));
     $fields->addFieldToTab("Root.Orders", HTMLEditorField::create("OrdersHeader", _t("Orders.QuoteInvoiceHeader", "Quote and Invoice Header")));
     $fields->addFieldToTab("Root.Orders", HTMLEditorField::create("QuoteFooter"));
     $fields->addFieldToTab("Root.Orders", HTMLEditorField::create("InvoiceFooter"));
 }
 public function updateCMSFields(FieldList $fields)
 {
     // Add config sets
     $fields->addFieldToTab('Root.Catalogue', UploadField::create('DefaultProductImage', _t("Catalogue.DefaultProductImage", 'Default product image')));
     // Add config sets
     $fields->addFieldToTab('Root.Catalogue', GridField::create('TaxRates', _t("Catalogue.TaxRates", "Tax Rates"), TaxRate::get(), GridFieldConfig::create()->addComponents(new GridFieldToolbarHeader(), new GridFieldAddNewButton('toolbar-header-right'), new GridFieldSortableHeader(), new GridFieldDataColumns(), new GridFieldPaginator(5), new GridFieldEditButton(), new GridFieldDeleteAction(), new GridFieldDetailForm())));
 }
 /**
  * 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 getEditForm($id = null, $fields = null)
 {
     $tabs = new TabSet('Root', new Tab('Main'));
     $fields = new FieldList($tabs);
     $caches = array();
     $all_caches = SimpleCache::$cache_configs;
     foreach ($all_caches as $name => $cacheInfo) {
         $cache = $this->getCache($name);
         if ($cache) {
             $stats = $cache->stats();
             $fields->addFieldToTab('Root.Main', new HeaderField($name . 'header', $name));
             $fields->addFieldToTab('Root.Main', new ReadonlyField($name . 'Hits', 'Hits', $stats->hits));
             $fields->addFieldToTab('Root.Main', new ReadonlyField($name . 'Miss', 'Miss', $stats->misses));
             $fields->addFieldToTab('Root.Main', new ReadonlyField($name . 'Count', 'Count', $stats->count));
             $caches[$name] = $name;
         }
     }
     if (count($caches)) {
         $fields->addFieldToTab('Root.Clear', new CheckboxSetField('ToClear', 'Caches to clear', $caches));
     }
     $actions = new FieldList(new FormAction('clear', 'Clear'));
     $form = new Form($this, 'EditForm', $fields, $actions);
     $form->addExtraClass('cms-edit-form cms-panel-padded center ' . $this->BaseCSSClasses());
     return $form;
 }
 public function updateCMSFields(FieldList $fields)
 {
     if (Permission::check('ADMIN')) {
         $fields->addFieldToTab("Root.PageBuilder", new LiteralField("Instructions", "\n\t\t\t\t\t<p class=\"helpText\">\n\t\t\t\t\t\tEnter your list of initial pages and their page types.  If you do not include a page type, it will default to \"Page\".<br />\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\tTo make a child page, begin the line with a symbol \"~\" for each level.  For example, second level pages would look like this:<br />\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\tAbout Us<br />~Our Services<br />~Our History\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\tTo set the page type, use a bar \"|\" between the page name and page type, like this:<br />\n\t\t\t\t\t\tHome|HomePage<br /><br />\n\t\t\t\t\t\tExisting pages at the same level will not be duplicated, if the page exists at the same level, it will not be changed, but children may be created\n\t\t\t\t\t</p>\n\t\t\t\t"));
         $fields->addFieldToTab("Root.PageBuilder", new TextAreaField("PageStructure", "Page Structure"));
     }
 }
Example #10
0
 function getCMSFields()
 {
     if ($this->ID != 0) {
         $totalCount = $this->getTotalVotes();
     } else {
         $totalCount = 0;
     }
     $fields = new FieldList($rootTab = new TabSet("Root", new Tab("Main", new TextField('Title', 'Poll title (maximum 50 characters)', null, 50), new OptionsetField('MultiChoice', 'Single answer (radio buttons)/multi-choice answer (tick boxes)', array(0 => 'Single answer', 1 => 'Multi-choice answer')), new OptionsetField('IsActive', 'Poll state', array(1 => 'Active', 0 => 'Inactive')), $embargo = new DatetimeField('Embargo', 'Embargo'), $expiry = new DatetimeField('Expiry', 'Expiry'), new HTMLEditorField('Description', 'Description'))));
     $embargo->getDateField()->setConfig('showcalendar', true);
     $embargo->getTimeField()->setConfig('showdropdown', true);
     $embargo->getDateField()->setConfig('dateformat', 'dd/MM/YYYY');
     $embargo->getTimeField()->setConfig('timeformat', 'h:m a');
     $expiry->getDateField()->setConfig('showcalendar', true);
     $expiry->getTimeField()->setConfig('showdropdown', true);
     $expiry->getDateField()->setConfig('dateformat', 'dd/MM/YYYY');
     $expiry->getTimeField()->setConfig('timeformat', 'h:m a');
     // Add the fields that depend on the poll being already saved and having an ID
     if ($this->ID != 0) {
         $config = GridFieldConfig::create();
         $config->addComponent(new GridFieldToolbarHeader());
         $config->addComponent(new GridFieldAddNewButton('toolbar-header-right'));
         $config->addComponent(new GridFieldDataColumns());
         $config->addComponent(new GridFieldEditButton());
         $config->addComponent(new GridFieldDeleteAction());
         $config->addComponent(new GridFieldDetailForm());
         $config->addComponent(new GridFieldSortableHeader());
         $pollChoicesTable = new GridField('Choices', 'Choices', $this->Choices(), $config);
         $fields->addFieldToTab('Root.Data', $pollChoicesTable);
         $fields->addFieldToTab('Root.Data', new ReadonlyField('Total', 'Total votes', $totalCount));
     } else {
         $fields->addFieldToTab('Root.Choices', new ReadOnlyField('ChoicesPlaceholder', 'Choices', 'You will be able to add options once you have saved the poll for the first time.'));
     }
     $this->extend('updateCMSFields', $fields);
     return $fields;
 }
 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));
 }
 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 updateSettingsFields(FieldList $fields)
 {
     $changeFreq = Singleton('Page')->dbObject('ChangeFreq')->enumValues();
     $fields->addFieldToTab('Root.Settings', DropDownField::create('ChangeFreq', 'Change Frequency', $changeFreq));
     $priority = Singleton('Page')->dbObject('Priority')->enumValues();
     $fields->addFieldToTab('Root.Settings', DropDownField::create('Priority', 'Priority', $priority));
 }
 public function getCMSFields()
 {
     $fields = new FieldList(new TabSet('Root'));
     $fields->addFieldToTab('Root.Main', new TextField('Name', 'Name'));
     $fields->addFieldToTab('Root.Main', new TextField('Alias', 'Alias (Unique reference)'));
     return $fields;
 }
 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;
 }
 public function updateCMSFields(FieldList $fields)
 {
     $fields->removeByName(array('Lat', 'Lng'));
     // Adds Lat/Lng fields for viewing in the CMS
     $compositeField = CompositeField::create();
     $compositeField->push($overrideField = CheckboxField::create('LatLngOverride', 'Override Latitude and Longitude?'));
     $overrideField->setDescription('Check this box and save to be able to edit the latitude and longitude manually.');
     if ($this->owner->Lng && $this->owner->Lat) {
         $googleMapURL = 'http://maps.google.com/?q=' . $this->owner->Lat . ',' . $this->owner->Lng;
         $googleMapDiv = '<div class="field"><label class="left" for="Form_EditForm_MapURL_Readonly">Google Map</label><div class="middleColumn"><a href="' . $googleMapURL . '" target="_blank">' . $googleMapURL . '</a></div></div>';
         $compositeField->push(LiteralField::create('MapURL_Readonly', $googleMapDiv));
     }
     if ($this->owner->LatLngOverride) {
         $compositeField->push(TextField::create('Lat', 'Lat'));
         $compositeField->push(TextField::create('Lng', 'Lng'));
     } else {
         $compositeField->push(ReadonlyField::create('Lat_Readonly', 'Lat', $this->owner->Lat));
         $compositeField->push(ReadonlyField::create('Lng_Readonly', 'Lng', $this->owner->Lng));
     }
     if ($this->owner->hasExtension('Addressable')) {
         // If using addressable, put the fields with it
         $fields->addFieldToTab('Root.Address', ToggleCompositeField::create('Coordinates', 'Coordinates', $compositeField));
     } else {
         if ($this->owner instanceof SiteTree) {
             // If SIteTree but not using Addressable, put after 'Metadata' toggle composite field
             $fields->insertAfter($compositeField, 'ExtraMeta');
         } else {
             $fields->addFieldToTab('Root.Main', ToggleCompositeField::create('Coordinates', 'Coordinates', $compositeField));
         }
     }
 }
 /**
  * CMS Fields
  * @return FieldList
  */
 public function updateCMSFields(FieldList $fields)
 {
     if (!Permission::check("VIEW_SECTIONS")) {
         return $fields;
     }
     $SectionGrid = GridFieldConfig_RelationEditor::create()->removeComponentsByType('GridFieldAddNewButton')->addComponent(new GridFieldAddNewMultiClass())->addComponent(new GridFieldOrderableRows());
     $SectionGrid->getComponentByType('GridFieldAddExistingAutocompleter')->setSearchFields(array('AdminTitle', 'MenuTitle'))->setResultsFormat('$AdminTitle - $Type');
     $AvailableTypes = $this->AvailableSectionTypes();
     foreach ($AvailableTypes as $key => $value) {
         if ($value['selectable_option'] && !$value['limit_reached']) {
             $AvailableTypes[$key] = $value['type'];
         }
     }
     $SectionGrid->getComponentByType('GridFieldAddNewMultiClass')->setClasses($AvailableTypes);
     // Limit total sections
     $LimitSectionTotal = Config::inst()->get($this->owner->ClassName, 'LimitSectionTotal');
     if (isset($LimitSectionTotal) && $this->owner->Sections()->Count() >= $LimitSectionTotal) {
         // remove the buttons if we don't want to allow more records to be added/created
         $SectionGrid->removeComponentsByType('GridFieldAddNewButton');
         $SectionGrid->removeComponentsByType('GridFieldAddExistingAutocompleter');
         $SectionGrid->removeComponentsByType('GridFieldAddNewMultiClass');
     }
     if (!Permission::check("LINK_SECTIONS")) {
         $SectionGrid->removeComponentsByType('GridFieldAddExistingAutocompleter');
     }
     if (!Permission::check("REORDER_SECTIONS")) {
         $SectionGrid->removeComponentsByType('GridFieldOrderableRows');
     }
     if (!Permission::check("UNLINK_SECTIONS")) {
         $SectionGrid->removeComponentsByType('GridFieldDeleteAction');
     }
     $fields->addFieldToTab('Root.Section', GridField::create('Sections', 'Current Section(s)', $this->owner->Sections(), $SectionGrid));
     $fields->addFieldToTab('Root.Preview', UploadField::create('PreviewImage', 'Preview image')->setFolderName('Preview'));
     return $fields;
 }
 public function updateCMSFields(FieldList $fields)
 {
     // check if the insertbefore field is present (may be added later, in which case the above
     // fields never get added
     //$insertOnTab = $this->owner->getFilterableArchiveConfigValue('pagination_control_tab');
     //$insertBefore = $this->owner->getFilterableArchiveConfigValue('pagination_insert_before');
     $insertOnTab = Config::inst()->get($this->owner->className, 'pagination_control_tab');
     $insertBefore = Config::inst()->get($this->owner->className, 'pagination_insert_before');
     if (!$fields->fieldByName("{$insertOnTab}.{$insertBefore}")) {
         $insertBefore = null;
     }
     //if($this->owner->getFilterableArchiveConfigValue('datearchive_active')){
     if (Config::inst()->get($this->owner->className, 'datearchive_active')) {
         //$fields->addFieldToTab($this->owner->getFilterableArchiveConfigValue('pagination_control_tab'),
         $fields->addFieldToTab(Config::inst()->get($this->owner->className, 'pagination_control_tab'), DropdownField::create('ArchiveUnit', _t('filterablearchive.ARCHIVEUNIT', 'Archive unit'), array('year' => _t('filterablearchive.YEAR', 'Year'), 'month' => _t('filterablearchive.MONTH', 'Month'), 'day' => _t('filterablearchive.DAY', 'Day'))), $insertBefore);
     }
     $pagerField = NumericField::create("ItemsPerPage", _t("filterablearchive.ItemsPerPage", "Pagination: items per page"))->setRightTitle(_t("filterablearchive.LeaveEmptyForNone", "Leave empty or '0' for no pagination"));
     $fields->addFieldToTab($insertOnTab, $pagerField, $insertBefore);
     //
     // Create categories and tag config
     //
     //		$config = GridFieldConfig_RecordEditor::create();
     //		$config->removeComponentsByType("GridFieldAddNewButton");
     //		$config->addComponent(new GridFieldAddByDBField("buttons-before-left"));
     // Lets just use what others have made already...
     $config = GridFieldConfig::create()->addComponent(new GridFieldButtonRow('before'))->addComponent(new GridFieldToolbarHeader())->addComponent(new GridFieldTitleHeader())->addComponent(new GridFieldEditableColumns())->addComponent(new GridFieldDeleteAction())->addComponent(new GridFieldAddNewInlineButton('toolbar-header-right'));
     //if($this->owner->getFilterableArchiveConfigValue('categories_active')){
     if (Config::inst()->get($this->owner->className, 'categories_active')) {
         $fields->addFieldToTab($insertOnTab, $categories = GridField::create("Categories", _t("FilterableArchive.Categories", "Categories"), $this->owner->Categories(), $config), $insertBefore);
     }
     //if($this->owner->getFilterableArchiveConfigValue('tags_active')){
     if (Config::inst()->get($this->owner->className, 'tags_active')) {
         $fields->addFieldToTab($insertOnTab, $tags = GridField::create("Tags", _t("FilterableArchive.Tags", "Tags"), $this->owner->Tags(), $config), $insertBefore);
     }
 }
 public function updateSettingsFields(FieldList $fields)
 {
     $systemThemes = SiteConfig::current_site_config()->getAvailableThemes();
     $partials = $themes = array('' => '', 'none' => '(none)');
     foreach ($systemThemes as $key => $themeName) {
         if (file_exists(Director::baseFolder() . '/themes/' . $themeName . '/templates/Page.ss')) {
             $themes[$key] = $themeName;
         } else {
             $partials[$key] = $themeName;
         }
     }
     $themeDropdownField = new DropdownField("AppliedTheme", 'Applied Theme', $themes);
     $fields->addFieldToTab('Root.Theme', $themeDropdownField);
     $current = $this->appliedTheme();
     if ($current) {
         $themeDropdownField->setRightTitle('Current effective theme: ' . $current);
     } else {
         $themeDropdownField->setRightTitle('Using default site theme');
     }
     $themeDropdownField = new DropdownField("PartialTheme", 'Partial Theme', $partials);
     $fields->addFieldToTab('Root.Theme', $themeDropdownField);
     $current = $this->appliedPartialTheme();
     if ($current) {
         $themeDropdownField->setRightTitle('Current effective partial theme: ' . $current);
     } else {
         $themeDropdownField->setRightTitle('Please only use a specific applied theme OR a partial theme, not both!');
     }
 }
 function updateSettingsFields(FieldList $fields)
 {
     $children = FieldGroup::create(CheckboxField::create('ShowChildren', 'Show children in the content area?'))->setTitle('Children of this page');
     $fields->addFieldToTab('Root.Settings', $children);
     $contact = FieldGroup::create(CheckboxField::create('ShowContact', 'Show contact info on this page?'))->setTitle('Contact Info (from settings)');
     $fields->addFieldToTab('Root.Settings', $contact);
 }
 public function updateCMSFields(FieldList $fields)
 {
     $fields->addFieldToTab("Root.PageElements", $editor = new HTMLEditorField($name = "CopyrightNotice", $title = "Copyright notice."));
     $fields->addFieldToTab("Root.PageElements", new UploadField($name = "BackgroundImage", $title = "Background Image"));
     $editor->setRows(10);
     return $fields;
 }
 function updateCMSFields(FieldList $fields)
 {
     $subsites = Subsite::accessible_sites("CMS_ACCESS_CMSMain");
     $subsitesMap = array();
     if ($subsites && $subsites->Count()) {
         $subsitesMap = $subsites->map('ID', 'Title');
         unset($subsitesMap[$this->owner->SubsiteID]);
     }
     // Master page edit field (only allowed from default subsite to avoid inconsistent relationships)
     $isDefaultSubsite = $this->owner->SubsiteID == 0 || $this->owner->Subsite()->DefaultSite;
     if ($isDefaultSubsite && $subsitesMap) {
         $fields->addFieldToTab('Root.Main', new DropdownField("CopyToSubsiteID", _t('SiteTreeSubsites.CopyToSubsite', "Copy page to subsite"), $subsitesMap, ''));
         $fields->addFieldToTab('Root.Main', $copyAction = new InlineFormAction("copytosubsite", _t('SiteTreeSubsites.CopyAction', "Copy")));
         $copyAction->includeDefaultJS(false);
     }
     // replace readonly link prefix
     $subsite = $this->owner->Subsite();
     $nested_urls_enabled = Config::inst()->get('SiteTree', 'nested_urls');
     if ($subsite && $subsite->ID) {
         $baseUrl = Director::protocol() . $subsite->domain() . '/';
         $baseLink = Controller::join_links($baseUrl, $nested_urls_enabled && $this->owner->ParentID ? $this->owner->Parent()->RelativeLink(true) : null);
         $urlsegment = $fields->dataFieldByName('URLSegment');
         $urlsegment->setURLPrefix($baseLink);
     }
 }
 /**
  * @return FieldList
  */
 public function getCMSFields()
 {
     $f = new FieldList($rootTab = new TabSet("Root", $tabMain = new Tab('Main')));
     $f->addFieldToTab('Root.Main', new TextField('Name', 'Name'));
     $f->addFieldToTab('Root.Main', $ddl = new DropdownField('ListType', 'ListType', $this->dbObject('ListType')->enumValues()));
     $f->addFieldToTab('Root.Main', $ddl2 = new DropdownField('CategoryID', 'Category', PresentationCategory::get()->filter('SummitID', $_REQUEST['SummitID'])->map('ID', 'Title')));
     $ddl->setEmptyString('-- Select List Type --');
     $ddl2->setEmptyString('-- Select Track  --');
     if ($this->ID > 0) {
         $config = GridFieldConfig_RecordEditor::create(25);
         $config->addComponent(new GridFieldAjaxRefresh(1000, false));
         $config->addComponent(new GridFieldPublishSummitEventAction());
         $config->removeComponentsByType('GridFieldDeleteAction');
         $config->removeComponentsByType('GridFieldAddNewButton');
         $config->addComponent($bulk_summit_types = new GridFieldBulkActionAssignSummitTypeSummitEvents());
         $bulk_summit_types->setTitle('Set Summit Types');
         $result = DB::query("SELECT DISTINCT SummitEvent.*, Presentation.*\nFROM SummitEvent\nINNER JOIN Presentation ON Presentation.ID = SummitEvent.ID\nINNER JOIN SummitSelectedPresentation ON SummitSelectedPresentation.PresentationID = Presentation.ID\nINNER JOIN SummitSelectedPresentationList ON SummitSelectedPresentation.SummitSelectedPresentationListID = {$this->ID}\nORDER BY SummitSelectedPresentation.Order ASC\n");
         $presentations = new ArrayList();
         foreach ($result as $row) {
             $presentations->add(new Presentation($row));
         }
         $gridField = new GridField('SummitSelectedPresentations', 'Selected Presentations', $presentations, $config);
         $gridField->setModelClass('Presentation');
         $f->addFieldToTab('Root.Main', $gridField);
     }
     return $f;
 }
 /**
  * standard SS method
  * @var Array
  **/
 public function updateCMSFields(FieldList $fields)
 {
     //separate MetaTitle
     if (Config::inst()->get("MetaTagsContentControllerEXT", "use_separate_metatitle") == 1) {
         $fields->addFieldToTab('Root.Main.Metadata', $allowField0 = new TextField('MetaTitle', _t('SiteTree.METATITLE', 'Meta Title')), "MetaDescription");
         $allowField0->setRightTitle(_t("SiteTree.METATITLE_EXPLANATION", "Leave this empty to use the page title"));
     }
     //info about automation
     $fields->addFieldToTab('Root.Main.Metadata', $allowField1 = new CheckboxField('AutomateMetatags', _t('MetaManager.UPDATEMETA', 'Automatically update Meta Description and Navigation Label? ')));
     $automatedFields = $this->updatedFieldsArray();
     $updatedFieldString = "";
     if (count($automatedFields)) {
         $updatedFieldString = "" . _t("MetaManager.UPDATED_EXTERNALLY", "Based on your current settings, the following fields will be automatically updated at all times") . ": <em>" . implode("</em>, <em>", $automatedFields) . "</em>.";
         foreach ($automatedFields as $fieldName => $fieldTitle) {
             $oldField = $fields->dataFieldByName($fieldName);
             if ($oldField) {
                 $newField = $oldField->performReadonlyTransformation();
                 //$newField->setTitle($newField->Title());
                 $newField->setRightTitle(_t("MetaTags.AUTOMATICALLY_UPDATED", "Automatically updated when you save this page (see metadata settings)."));
                 $fields->replaceField($fieldName, $newField);
             }
         }
     }
     $fields->removeByName('ExtraMeta');
     $linkToManager = Config::inst()->get("MetaTagCMSControlPages", "url_segment") . '/';
     $fields->addFieldToTab('Root.Main.Metadata', new LiteralField("LinkToManagerHeader", "<blockquote style='padding-left: 12px;'>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tOpen the Meta Tag Manager to\n\t\t\t\t\t\t<a href=\"{$linkToManager}\" target=\"_blank\">Review and Edit</a>\n\t\t\t\t\t\tthe Meta Data for all pages on this site.\n\t\t\t\t\t\tAlso make sure to review the general settings for\n\t\t\t\t\t\t<a href=\"/admin/settings/\">Search Engines</a>. {$updatedFieldString}\n\t\t\t\t\t</p>\n\t\t\t\t</blockquote>"));
     if ($this->owner->URLSegment == RootURLController::get_default_homepage_link()) {
         $newField = $fields->dataFieldByName('URLSegment');
         $newField->setRightTitle("Careful: changing the URL from 'home' to anything else means that this page will no longer be the home page");
         $fields->replaceField('URLSegment', $newField);
     }
     return $fields;
 }
 public function updateCMSFields(FieldList $fields)
 {
     $templatei18n = _t('TemplateOverride.TEMPLATE', 'Template');
     $fields->addFieldToTab('Root.' . $templatei18n, new TextField('AlternativeTemplate', _t('TemplateOverride.ALTERNATIVE_TEMPLATE_NAME', 'Alternative template name')));
     $info_field = new LiteralField($name = 'infofield', $content = '<p class="message">' . _t('TemplateOverride.INFO', 'If you wish to change' . ' the default template, type the name of the template here.  Otherwise ' . ' the normal default template will be used.  Normally this will not ' . ' require changing.') . '</p>');
     $fields->addFieldToTab('Root.' . $templatei18n, $info_field);
 }
 function updateCMSFields(FieldList $fields)
 {
     $fields->addFieldToTab('Root.RSS', new CheckboxField('EmergencyFeed', 'Is this Blog Holder an MCD Emergency Feed'));
     $fields->addFieldToTab('Root.RSS', new TextField('RSSTitle', 'RSS Title'));
     $fields->addFieldToTab('Root.RSS', new TextField('RSSDescription', 'RSS Description'));
     $fields->addFieldToTab('Root.RSS', new ReadonlyField('RSSURL', 'MCDEM RSS Address', $this->EmergencyFeedLink()));
 }
 public function updateCMSFields(FieldList $fields)
 {
     $fields->remove("PhoneNumber");
     $fields->addFieldToTab("Root.Main", TextField::create("PhoneNumber"), "Password");
     $fields->addFieldToTab("Root.Main", TextField::create("Company"), "FirstName");
     return $fields;
 }
    function updateCMSFields(FieldList $fields)
    {
        $linkToManagerForPages = Config::inst()->get("MetaTagCMSControlPages", "url_segment") . '/';
        $linkToManagerForFiles = Config::inst()->get("MetaTagCMSControlFiles", "url_segment") . '/';
        $fields->addFieldToTab('Root.SearchEngines', new TabSet('Options', new Tab('Help', new LiteralField('HelpExplanation', '
						<h3>Search Engine - How to use ...</h3>
						<p>
							To improve your visibility with search engines, we provide a number of tools here.
							Improving your rankings with Search Engines can work as follows:
						</p>
						<ul>
							<li> - decide on a few keywords for each page - basically the words that people would search for on Google (e.g. <i>feed elderly cat</i>))</li>
							<li> - ensure that these words are seen in strategic places on this page</li>
							<li> - create links to the page from <i>third-party</i> websites</li>
						</ul>
						<p>
							<br />The tools provided here help you to achieve these goals by ensuring:
						</p>
						<ul>
							<li> - easy addition of keywords to key field (navigation label, meta description)</li>
							<li> - you can adjust the file image names and descriptions to match the keywords</li>
						</ul>
						')), new Tab('Menus', new LiteralField('MenuTitleExplanation', '<h3>Menu Title</h3><p>To improve consistency, you can set the menu title to automatically match the page title for any page on the site. </p>'), new CheckboxField('UpdateMenuTitle', 'Automatically update the Menu Title / Navigation Label to match the Page Title?')), new Tab('Meta Title', new TextField('PrependToMetaTitle', 'Prepend (add in front) of Meta Title'), new TextField('AppendToMetaTitle', 'Append (add at the end) of Meta Title')), new Tab('Meta Description', new LiteralField('MetaDescriptionExplanation', '<h3>&ldquo;Meta Description&rdquo;: Summary for Search Engines</h3><p>The Meta Description is not visible on the website itself. However, it is picked up by search engines like google.  They display it as the short blurb underneath the link to your pages. It will not get you much higher in the rankings, but it will entice people to click on your link.</p>'), new CheckboxField('UpdateMetaDescription', 'Automatically fill every meta description on every Page (using the first ' . Config::inst()->get("MetaTagsContentControllerEXT", "meta_desc_length") . ' words of the Page Content field).')), new Tab('Other Meta Data', new LiteralField('MetaOtherExplanation', '<h3>Other &ldquo;Meta Data&rdquo;: More hidden information about the page</h3><p>You can add some other <i>hidden</i> information to your pages - which can be picked up by Search Engines and other automated readers decyphering your website.</p>'), new TextField('MetaDataCountry', 'Country'), new TextField('MetaDataCopyright', 'Content Copyright'), new TextField('MetaDataDesign', 'Design provided by ...'), new TextField('MetaDataCoding', 'Website Coding carried out by ...'), new TextareaField('ExtraMeta', 'Custom Meta Tags (advanced users only)')), new Tab('Pages', new LiteralField('LinkToManagerHeaderForPages', "<p><a href=\"{$linkToManagerForPages}\" target=\"_blank\">Review and Edit</a> pages in a new window ...</p>")), new Tab('Files', new LiteralField('LinkToManagerHeaderForFiles', "<p><a href=\"{$linkToManagerForFiles}\" target=\"_blank\">Review and Edit</a> files in a new window ...</p>"))));
        $fields->addFieldToTab("Root.Icons", $uploadField = new UploadField('Favicon', 'Icon'));
        $uploadField->setAllowedExtensions(array("png"));
        $uploadField->setRightTitle("Upload a 480px wide x 480px high non-transparent PNG file. Ask your developer for help if unsure. Icons can also be loaded onto the server directly into the /themes/mytheme/icons/ folder and as a favicon.ico in the root directory.");
        return $fields;
    }
 public function updateCMSFields(FieldList $fields)
 {
     $fields->addFieldToTab("Root.Main", $checkboxField = CheckboxField::create('DebugToolsDisabled', 'Disable debug tools'));
     $checkboxField->setDescription('When enabled, debug will only show if set to <code>DEV</code> or <code>TEST</code> in <code>_ss_environment.php</code>');
     $fields->addFieldToTab("Root.Main", $checkboxField = CheckboxField::create('EmulateUserDisabled', 'Disable user emulation'));
     $checkboxField->setDescription('When enabled, <strong>only admins</strong> can log in as any other <code>Member</code> object');
 }
 public function getCMSFields()
 {
     $fields = new FieldList();
     $fields->push(new TabSet('Root', new Tab('Main', _t('SiteTree.TABMAIN', 'Main'), new TextField('Title', _t('UniadsObject.db_Title', 'Title')))));
     if ($this->ID) {
         $previewLink = Director::absoluteBaseURL() . 'admin/' . UniadsAdmin::config()->url_segment . '/UniadsObject/preview/' . $this->ID;
         $fields->addFieldToTab('Root.Main', new ReadonlyField('Impressions', _t('UniadsObject.db_Impressions', 'Impressions')), 'Title');
         $fields->addFieldToTab('Root.Main', new ReadonlyField('Clicks', _t('UniadsObject.db_Clicks', 'Clicks')), 'Title');
         $fields->addFieldsToTab('Root.Main', array(DropdownField::create('CampaignID', _t('UniadsObject.has_one_Campaign', 'Campaign'), DataList::create('UniadsCampaign')->map())->setEmptyString(_t('UniadsObject.Campaign_none', 'none')), DropdownField::create('ZoneID', _t('UniadsObject.has_one_Zone', 'Zone'), DataList::create('UniadsZone')->map())->setEmptyString(_t('UniadsObject.Zone_select', 'select one')), new NumericField('Weight', _t('UniadsObject.db_Weight', 'Weight (controls how often it will be shown relative to others)')), new TextField('TargetURL', _t('UniadsObject.db_TargetURL', 'Target URL')), new Treedropdownfield('InternalPageID', _t('UniadsObject.has_one_InternalPage', 'Internal Page Link'), 'Page'), new CheckboxField('NewWindow', _t('UniadsObject.db_NewWindow', 'Open in a new Window')), $file = new UploadField('File', _t('UniadsObject.has_one_File', 'Advertisement File')), $AdContent = new TextareaField('AdContent', _t('UniadsObject.db_AdContent', 'Advertisement Content')), $Starts = new DateField('Starts', _t('UniadsObject.db_Starts', 'Starts')), $Expires = new DateField('Expires', _t('UniadsObject.db_Expires', 'Expires')), new NumericField('ImpressionLimit', _t('UniadsObject.db_ImpressionLimit', 'Impression Limit')), new CheckboxField('Active', _t('UniadsObject.db_Active', 'Active')), new LiteralField('Preview', '<a href="' . $previewLink . '" target="_blank">' . _t('UniadsObject.Preview', 'Preview this advertisement') . "</a>")));
         $app_categories = File::config()->app_categories;
         $file->setFolderName($this->config()->files_dir);
         $file->getValidator()->setAllowedMaxFileSize(array('*' => $this->config()->max_file_size));
         $file->getValidator()->setAllowedExtensions(array_merge($app_categories['image'], $app_categories['flash']));
         $AdContent->setRows(10);
         $AdContent->setColumns(20);
         $Starts->setConfig('showcalendar', true);
         $Starts->setConfig('dateformat', i18n::get_date_format());
         $Starts->setConfig('datavalueformat', 'yyyy-MM-dd');
         $Expires->setConfig('showcalendar', true);
         $Expires->setConfig('dateformat', i18n::get_date_format());
         $Expires->setConfig('datavalueformat', 'yyyy-MM-dd');
         $Expires->setConfig('min', date('Y-m-d', strtotime($this->Starts ? $this->Starts : '+1 days')));
     }
     $this->extend('updateCMSFields', $fields);
     return $fields;
 }