/**
  * Get CMS fields
  *
  * @return FieldList
  */
 function getCMSFields()
 {
     $fields = new FieldList();
     $fields->push(new TextField('Title', _t('Block.TITLE', 'Title')));
     $imageField = new UploadField('Image', _t('Block.IMAGE', 'Image'));
     $imageField->getValidator()->setAllowedExtensions(array('jpg', 'gif', 'png'));
     $fields->push($imageField);
     $fields->push(new TextField('FeedURL', _t('FeedBlock.FEEDURL', 'FeedURL')));
     $fields->push(new NumericField('Results', _t('FeedBlock.RESULTS', 'Results')));
     $fields->push(new NumericField('SummaryMaxLength', _t('FeedBlock.SUMMARYMAXLENGTH', 'SummaryMaxLength')));
     $fields->push(new NumericField('CacheTime', _t('FeedBlock.CACHETIME', 'CacheTime')));
     $fields->push(new CheckboxField('Striptags', _t('FeedBlock.STRIPTAGS', 'Striptags')));
     // Add modifier field (select function to run feed item through before displaying it)
     if ($this->modifier_functions) {
         if (isset($this->modifier_functions)) {
             $options = array('' => 'None');
             foreach ($this->modifier_functions as $f) {
                 $options[$f] = $f;
             }
             $fields->push(new DropdownField('Modifier', _t('FeedBlock.MODIFIER', 'Feed item filter'), $options));
         }
     }
     $fields->push(new TextField('LinkExternal', _t('FeedBlock.LINKEXTERNAL', 'External link URL')));
     if (class_exists('OptionalTreeDropdownField')) {
         $treeField = new OptionalTreeDropdownField('LinkInternalID', _t('Block.LINKINTERNAL', 'Internal link'), 'SiteTree');
         $treeField->setEmptyString('No page');
     } else {
         $treeField = new TreeDropdownField('LinkInternalID', _t('Block.LINKINTERNAL', 'Internal link'), 'SiteTree');
     }
     $fields->push($treeField);
     return $fields;
 }
 /**
  * Get CMS fields
  *
  * @return FieldList
  */
 function getCMSFields()
 {
     $fields = new FieldList();
     $fields->push(new TextField('LinkTitle', _t('Block.LINKTITLE', 'Link title')));
     $fields->push(new TextField('LinkExternal', _t('Block.LINKEXTERNAL', 'External link URL')));
     if (class_exists('OptionalTreeDropdownField')) {
         $treeField = new OptionalTreeDropdownField('LinkInternalID', _t('Block.LINKINTERNAL', 'Internal link'), 'SiteTree');
         $treeField->setEmptyString('No Page');
     } else {
         $treeField = new TreeDropdownField('LinkInternalID', _t('Block.LINKINTERNAL', 'Internal link'), 'SiteTree');
     }
     $fields->push($treeField);
     $fields->push(new TextField('CssClasses', _t('Block.CSSCLASSES', 'Css Classes')));
     $fields->push(new TextareaField('Attributes', _t('Block.ATTRIBUTES', 'Attributes')));
     $imageField = new UploadField('Image', _t('Block.IMAGE', 'Image'));
     $imageField->getValidator()->setAllowedExtensions(array('jpg', 'gif', 'png'));
     $fields->push($imageField);
     return $fields;
 }
Ejemplo n.º 3
0
 /**
  * Get CMS fields
  *
  * @return FieldList
  */
 public function getCMSFields()
 {
     $fields = new FieldList();
     $fields->push(new TextField('Title', _t('Block.TITLE', 'Title')));
     $leadInField = new HTMLEditorField('LeadIn', _t('Block.LEADIN', 'Lead In'));
     $leadInField->setRows(2);
     $fields->push($leadInField);
     $contentField = new HTMLEditorField('Content', _t('Block.CONTENT', 'Content'));
     $contentField->setRows(6);
     $fields->push($contentField);
     $imageField = new UploadField('Image', _t('Block.IMAGE', 'Image'));
     $imageField->getValidator()->setAllowedExtensions(array('jpg', 'gif', 'png'));
     $fields->push($imageField);
     $fields->push(new TextField('LinkTitle', _t('Block.LINKTITLE', 'Link title')));
     $fields->push(new TextField('LinkExternal', _t('Block.LINKEXTERNAL', 'External link URL')));
     if (class_exists('OptionalTreeDropdownField')) {
         $treeField = new OptionalTreeDropdownField('LinkInternalID', _t('Block.LINKINTERNAL', 'Internal link'), 'SiteTree');
         $treeField->setEmptyString('(Choose)');
     } else {
         $treeField = new TreeDropdownField('LinkInternalID', _t('Block.LINKINTERNAL', 'Internal link'), 'SiteTree');
     }
     $fields->push($treeField);
     return $fields;
 }
 /**
  * Standard SS function
  * @return FieldList
  **/
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeFieldFromTab('Root.Messages.Messages.Actions', "ProceedToCheckoutLabel");
     $fields->removeFieldFromTab('Root.Messages.Messages.Actions', "ContinueShoppingLabel");
     $fields->removeFieldFromTab('Root.Messages.Messages.Actions', "ContinuePageID");
     $fields->removeFieldFromTab('Root.Messages.Messages.Actions', "LoadOrderLinkLabel");
     $fields->removeFieldFromTab('Root.Messages.Messages.Actions', "CurrentOrderLinkLabel");
     $fields->removeFieldFromTab('Root.Messages.Messages.Actions', "SaveOrderLinkLabel");
     $fields->removeFieldFromTab('Root.Messages.Messages.Actions', "DeleteOrderLinkLabel");
     $termsPageIDField = OptionalTreeDropdownField::create('TermsPageID', _t("CheckoutPage.TERMSANDCONDITIONSPAGE", "Terms and conditions page"), 'SiteTree');
     $termsPageIDField->setRightTitle(_t("CheckoutPage.TERMSANDCONDITIONSPAGE_RIGHT", "This is optional. To remove this page clear the reminder message below."));
     $fields->addFieldToTab('Root.Terms', $termsPageIDField);
     $fields->addFieldToTab('Root.Terms', $termsPageIDFieldMessage = new TextField('TermsAndConditionsMessage', _t("CheckoutPage.TERMSANDCONDITIONSMESSAGE", "Reminder Message")));
     $termsPageIDFieldMessage->setRightTitle(_t("CheckoutPage.TERMSANDCONDITIONSMESSAGE_RIGHT", "Shown if the user does not tick the 'I agree with the Terms and Conditions' box. Leave blank to allow customer to proceed without ticking this box"));
     //The Content field has a slightly different meaning for the Checkout Page.
     $fields->removeFieldFromTab('Root.Main', "Content");
     $fields->addFieldToTab('Root.Messages.Messages.AlwaysVisible', $htmlEditorField = new HTMLEditorField('Content', _t("CheckoutPage.CONTENT", 'General note - always visible on the checkout page')));
     $htmlEditorField->setRows(3);
     if (OrderModifier_Descriptor::get()->count()) {
         $fields->addFieldToTab('Root.Messages.Messages.OrderExtras', $this->getOrderModifierDescriptionField());
     }
     if (CheckoutPage_StepDescription::get()->count()) {
         $fields->addFieldToTab('Root.Messages.Messages.CheckoutSteps', $this->getCheckoutStepDescriptionField());
     }
     return $fields;
 }