public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab("Root.Main", $editor = new HTMLEditorField('Content', 'Intro Text'), "Metadata");
     $editor->setRows(20);
     return $fields;
 }
 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;
 }
 public function getFieldConfiguration()
 {
     $textAreaField = new HTMLEditorField($this->getSettingName('Content'), "HTML", $this->getContent());
     $textAreaField->setRows(4);
     $textAreaField->setColumns(20);
     return new FieldList($textAreaField, new CheckboxField($this->getSettingName('HideFromReports'), _t('EditableLiteralField.HIDEFROMREPORT', 'Hide from reports?'), $this->getSetting('HideFromReports')));
 }
 function updateCMSFields(FieldList $fields)
 {
     $footerTabName = 'Root.' . _t('SiteConfig.FOOTER', 'Footer');
     $fields->addFieldToTab($footerTabName, $h1 = new HTMLEditorField('FooterText', _t('SiteConfig.FOOTER_TEXT', "Text to display in the footer")));
     $options1 = singleton('SiteConfig')->dbObject('ColumnStart')->EnumValues();
     $options2 = singleton('SiteConfig')->dbObject('ColumnWidth')->EnumValues();
     $columnStartField = new DropdownField('ColumnStart', _t('SiteConfig.FOOTER_TEXT_START_COLUMN', 'Which column (of four) should the footer text start in', $options1));
     $columnWidthField = new DropdownField('ColumnStart', _t('SiteConfig.FOOTER_TEXT_WIDTH_COLUMN', 'How many, of four columns, should the footer text take up', $options2));
     //$fields->addFieldToTab("Root.Footer", $columnStartField);
     //$fields->addFieldToTab("Root.Footer", $h1=new HTMLEditorField('FooterText', _t('SiteConfig.FOOTER_TEXT', "Text to display in the footer")));
     $h1->setRows(6);
 }
Esempio n. 5
0
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->insertAfter(HTMLEditorField::create('ExtraContent'), 'Content');
     $fields->insertBefore(DropdownField::create('Type', 'Type', $this->dbObject('Type')->enumValues()), 'Intro');
     return $fields;
 }
 public function getCMSFields()
 {
     if ($this->ID == 0) {
         $categorydropdown = TextField::create('CategoryDisclaimer')->setTitle('Category')->setDisabled(true)->setValue('You can assign a category once you have saved the record for the first time.');
     } else {
         $categories = ListCategory::get()->filter("ListPageID", "{$this->ListPageID}")->sort("Category ASC");
         $map = $categories ? $categories->map('ID', 'Category', 'Please Select') : array();
         if ($map) {
             $categorydropdown = new DropdownField('ListCategoryID', 'Category', $map);
             $categorydropdown->setEmptyString("-- Please Select --");
         } else {
             $categorydropdown = new DropdownField('ListCategoryID', 'Category', $map);
             $categorydropdown->setEmptyString("There are no categories created yet");
         }
     }
     $ImageField = UploadField::create('Photo')->setDescription('(Allowed filetypes: jpg, jpeg, png, gif)');
     $ImageField->folderName = 'ListPage';
     $ImageField->getValidator()->allowedExtensions = array('jpg', 'jpeg', 'gif', 'png');
     $DocumentField = UploadField::create('Resource')->setTitle('Resource/Document')->setDescription('(Allowed filetypes: pdf, doc, docx, txt, ppt, or pptx)');
     $DocumentField->folderName = "ListPage";
     $DocumentField->getValidator()->allowedExtensions = array('pdf', 'doc', 'docx', 'txt', 'ppt', 'pptx');
     $LinkField = TextField::create('Link')->setTitle('Link URL');
     $fields = FieldList::create(TabSet::create('Root'));
     $fields->addFieldsToTab('Root.Main', array($categorydropdown, TextField::create('Title'), OptionSetField::create('LinkType')->setTitle('')->setSource($this->dbObject('LinkType')->enumValues()), TextField::create('Link')->setTitle('Link URL')->displayIf('LinkType')->isEqualTo('Link')->andIf('LinkType')->isNotEqualTo('Resource')->end(), DisplayLogicWrapper::create($DocumentField)->displayIf('LinkType')->isEqualTo('Resource')->andIf('LinkType')->isNotEqualTo('Link')->end(), $ImageField, HTMLEditorField::create('Content')));
     return $fields;
 }
 /**
  * @return FieldList 
  */
 public function getCMSFields()
 {
     // Get NotifiedOn implementors
     $types = ClassInfo::implementorsOf('NotifiedOn');
     $types = array_combine($types, $types);
     unset($types['NotifyOnThis']);
     if (!$types) {
         $types = array();
     }
     array_unshift($types, '');
     // Available keywords
     $keywords = $this->getKeywords();
     if (count($keywords)) {
         $availableKeywords = '<div class="field"><div class="middleColumn"><p><u>Available Keywords:</u> </p><ul><li>$' . implode('</li><li>$', $keywords) . '</li></ul></div></div>';
     } else {
         $availableKeywords = "Available keywords will be shown if you select a NotifyOnClass";
     }
     // Identifiers
     $identifiers = $this->config()->get('identifiers');
     if (count($identifiers)) {
         $identifiers = array_combine($identifiers, $identifiers);
     }
     $fields = FieldList::create();
     $relevantMsg = 'Relevant for (note: this notification will only be sent if the context of raising the notification is of this type)';
     $fields->push(TabSet::create('Root', Tab::create('Main', DropdownField::create('Identifier', _t('SystemNotification.IDENTIFIER', 'Identifier'), $identifiers), TextField::create('Title', _t('SystemNotification.TITLE', 'Title')), TextField::create('Description', _t('SystemNotification.DESCRIPTION', 'Description')), DropdownField::create('NotifyOnClass', _t('SystemNotification.NOTIFY_ON_CLASS', $relevantMsg), $types), TextField::create('CustomTemplate', _t('SystemNotification.TEMPLATE', 'Template (Optional)'))->setAttribute('placeholder', $this->config()->get('default_template')), LiteralField::create('AvailableKeywords', $availableKeywords))));
     if ($this->config()->html_notifications) {
         $fields->insertBefore(HTMLEditorField::create('NotificationHTML', _t('SystemNotification.TEXT', 'Text')), 'AvailableKeywords');
     } else {
         $fields->insertBefore(TextareaField::create('NotificationText', _t('SystemNotification.TEXT', 'Text')), 'AvailableKeywords');
     }
     return $fields;
 }
 public function getCMSFields()
 {
     $datetimeField = DatetimeField::create("Date")->setTitle($this->fieldLabel("Date"));
     $datetimeField->getDateField()->setConfig("dmyfields", true);
     // Check if NewsImage should be saved in a seperate folder
     if (self::config()->save_image_in_seperate_folder == false) {
         $UploadField = UploadField::create("NewsImage")->setTitle($this->fieldLabel("NewsImage"))->setFolderName("news");
     } else {
         if ($this->ID == "0") {
             $UploadField = FieldGroup::create(LiteralField::create("Save", $this->fieldLabel("SaveHelp")))->setTitle($this->fieldLabel("NewsImage"));
         } else {
             $UploadField = UploadField::create("NewsImage")->setTitle($this->fieldLabel("NewsImage"))->setFolderName("news/" . $this->URLSegment);
         }
     }
     // Create direct link to NewsArticle
     if ($this->ID == "0") {
         // Little hack to hide $urlsegment when article isn't saved yet.
         $urlsegment = LiteralField::create("NoURLSegmentYet", "");
     } else {
         if ($NewsHolder = $this->NewsHolder()) {
             $baseLink = Controller::join_links(Director::absoluteBaseURL(), $NewsHolder->Link(), $this->URLSegment);
         }
         $urlsegment = Fieldgroup::create(LiteralField::create("URLSegment", "URLSegment")->setContent('<a href="' . $baseLink . '" target="_blank">' . $baseLink . '</a>'))->setTitle("URLSegment");
     }
     $fields = FieldList::create(new TabSet("Root", new Tab("Main", $urlsegment, TextField::create("Title")->setTitle($this->fieldLabel("Title")), $datetimeField, HTMLEditorField::create("Content")->setTitle($this->fieldLabel("Content")), $UploadField)));
     $this->extend("updateCMSFields", $fields);
     return $fields;
 }
Esempio n. 9
0
 public function getCMSFields()
 {
     $fields = FieldList::create(TabSet::create('Root'));
     $fields->addFieldsToTab('Root.Main', array(TextField::create('Title'), HTMLEditorField::create('Description'), $upload = UploadField::create('DownloadFile', 'Download File')));
     $upload->setFolderName('downloads');
     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 getCMSFields()
    {
        $fields = parent::getCMSFields();
        $fields->addFieldToTab('Root.EnquiryForm', HeaderField::create('Enquiry Form Setup', 2));
        $gridFieldConfig = GridFieldConfig_RecordEditor::create(100);
        $gridFieldConfig->addComponent(new GridFieldSortableRows('SortOrder'));
        /* Unset field-sorting hack */
        $gridFieldConfig->getComponentByType('GridFieldSortableHeader')->setFieldSorting(array('FieldName' => 'FieldNameNoSorting', 'FieldType' => 'FieldTypeNoSorting'));
        $gridField = GridField::create('EnquiryFormFields', false, $this->EnquiryFormFields(), $gridFieldConfig);
        $fields->addFieldToTab('Root.EnquiryForm', $gridField);
        $email_settings = array(EmailField::create('EmailTo', 'Send email to'), EmailField::create('EmailFrom', 'Send email from')->setRightTitle('For example website@yourdomain.com'), TextField::create('EmailSubject', 'Email subject'), HeaderField::create('Message on website once completed', 5), HTMLEditorField::create('EmailSubmitCompletion', '')->setRows(10), EmailField::create('EmailBcc', 'Send BCC copy to (optional)')->setRightTitle('If you would like a copy of the enquiry to be sent elsewhere, fill that in here.'), TextField::create('EmailSubmitButtonText', 'Submit button text'));
        $toggleSettings = ToggleCompositeField::create('FormSettings', 'Enquiry Form Settings', $email_settings);
        $fields->addFieldsToTab('Root.EnquiryForm', $toggleSettings);
        $spam_settings = array();
        array_push($spam_settings, DropdownField::create('AddCaptcha', 'Add captcha image (optional)', array(0 => 'No', 1 => 'Yes'))->setRightTitle('You can optionally enable an anti-spam "captcha" image.
			             This adds a small image with 4 random numbers which needs to be filled in correctly.'));
        if (!$this->CaptchaText) {
            $this->CaptchaText = 'Verification Image';
        }
        array_push($spam_settings, TextField::create('CaptchaText', 'Field name'));
        array_push($spam_settings, TextField::create('CaptchaHelp', 'Captcha help (optional)')->setRightTitle('If you would like to explain what the captcha is, please explain briefly what it is.
                    This is only used if you have selected to add the captcha image.'));
        $toggleSpam = ToggleCompositeField::create('SpamSettings', 'Anti-Spam Settings', $spam_settings);
        $fields->addFieldsToTab('Root.EnquiryForm', $toggleSpam);
        return $fields;
    }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldsToTab("Root.SuccessContent", array(TextField::create("Currency"), TextField::create("SuccessTitle"), HTMLEditorField::create("SuccessContent")));
     $fields->addFieldToTab("Root.Invoices", GridField::create("Invoices", "Invoices", $this->Invoices(), GridFieldConfig_RecordEditor::create()));
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     // Remove fields
     $fields->removeByName(array('Unique', 'Permanent', 'CanClose', 'CloseColor', 'LinkID'));
     // Add fields
     // Main tab
     $fields->addFieldToTab("Root.Main", $test = TextField::create("ButtonText")->setTitle(_t("SiteMessage.LABELBUTTONTEXT", "Button Text")));
     $fields->addFieldToTab("Root.Main", TreeDropdownField::create("PageID")->setTitle(_t("SiteMessage.LABELLINKTO", "Link to"))->setSourceObject("SiteTree"));
     $fields->addFieldToTab("Root.Main", HTMLEditorField::create("Content")->setTitle(_t("SiteMessage.LABELCONTENT", "Message content"))->setRows(15));
     // Design tab
     $fields->addFieldToTab("Root.Design", HeaderField::create("ColorSettings")->setTitle(_t("SiteMessage.HEADERCOLORSETTINGS", "Color settings")));
     $fields->addFieldToTab("Root.Design", ColorField::create("BackgroundColor")->setTitle(_t("SiteMessage.LABELBACKGROUNDCOLOR", "Background Color")));
     $fields->addFieldToTab("Root.Design", ColorField::create("TextColor")->setTitle(_t("SiteMessage.LABELTEXTCOLOR", "Text Color")));
     $fields->addFieldToTab("Root.Design", ColorField::create("ButtonColor")->setTitle(_t("SiteMessage.LABELBUTTONCOLOR", "Button Color")));
     $fields->addFieldToTab("Root.Design", ColorField::create("ButtonTextColor")->setTitle(_t("SiteMessage.LABELBUTTONTEXTCOLOR", "Button Text Color")));
     $fields->addFieldToTab("Root.Design", HeaderField::create("CloseSettings")->setTitle(_t("SiteMessage.HEADERCLOSESETTINGS", "Close button settings")));
     $fields->addFieldToTab("Root.Design", FieldGroup::create(_t("SiteMessage.LABELCANCLOSE", "Show close button?"), Checkboxfield::create("CanClose", "")));
     $fields->addFieldToTab("Root.Design", ColorField::create("CloseColor")->setTitle(_t("SiteMessage.LABELCLOSECOLOR", "Close button color")));
     // Schedule tab
     $fields->addFieldToTab("Root.Schedule", FieldGroup::create(_t("SiteMessage.LABELPERMANENT", "Is this message permanent?"), CheckboxField::create("Permanent", "")));
     $fields->addFieldToTab("Root.Schedule", $Start = new DatetimeField("Start"));
     $fields->addFieldToTab("Root.Schedule", $End = new DatetimeField("End"));
     $Start->setConfig('datavalueformat', 'YYYY-MM-dd HH:mm')->setTitle(_t("SiteMessage.LABELSTART", "Start Date"))->getDateField('Start')->setConfig('showcalendar', TRUE);
     $End->setConfig('datavalueformat', 'YYYY-MM-dd HH:mm')->setTitle(_t("SiteMessage.LABELSTART", "End Date"))->getDateField('End')->setConfig('showcalendar', TRUE);
     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;
 }
Esempio n. 15
0
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->insertBefore(TextareaField::create('Intro', 'Intro'), 'Content');
     $fields->insertAfter(ColorPaletteField::create("Colour", "Colour", array('night' => '#333333', 'air' => '#009EE2', 'earth' => ' #79c608', 'passion' => '#b02635', 'people' => '#de347f', 'inspiration' => '#783980')), "Intro");
     $fields->insertBefore($image = UploadField::create('SplashImage', 'Splash Image'), 'Content');
     $image->setFolderName('Uploads/Splash-Images');
     if ($this->ClassName === "Page" || $this->ClassName === "HomePage") {
         $fields->insertAfter(HTMLEditorField::create('ExtraContent'), 'Content');
         $gridField = new GridField('FeatureItems', 'FeatureItems', $this->FeatureItems()->sort(array('Sort' => 'ASC', 'Archived' => 'ASC')), $config = GridFieldConfig_RelationEditor::create());
         $gridField->setModelClass('FeatureItem');
         $fields->addFieldToTab('Root.Features', $gridField);
         $config->addComponent(new GridFieldOrderableRows());
     } else {
         if ($this->ClassName === "CalendarPage") {
             $content = $fields->dataFieldByName('Content');
             $content->addExtraClass('no-pagebreak');
             $events = Event::get()->sort(array('StartDateTime' => 'Desc'))->filterByCallback(function ($record) {
                 return !$record->getIsPastEvent();
             });
             $gridField = new GridField('Event', 'Upcoming Events', $events, $config = GridFieldConfig_RecordEditor::create());
             $gridField->setModelClass('Event');
             $dataColumns = $config->getComponentByType('GridFieldDataColumns');
             $dataColumns->setDisplayFields(array('Title' => 'Title', 'StartDateTime' => 'Date and Time', 'DatesAndTimeframe' => 'Presentation String'));
             $fields->addFieldToTab('Root.UpcomingEvents', $gridField);
         }
     }
     return $fields;
 }
 /**
  * CMS Fields
  * @var FieldList
  */
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldsToTab("Root.Main", array(TextareaField::create('Title')->setRows(1), HTMLEditorField::create('Content')));
     $this->extend('updateCMSFields', $fields);
     return $fields;
 }
 /**
  * CMS Fields
  * @return array
  */
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldsToTab("Root.Main", array(UploadField::create('Image')->setFolderName('Person'), TextField::create('Name'), TextField::create('Title'), TextField::create('Email'), TextField::create('Phone'), TextField::create('Mobile'), HTMLEditorField::create('Description')));
     $this->extend('updateCMSFields', $fields);
     return $fields;
 }
 /**
  * @todo fix sortorder
  *
  * @param FieldList $fields
  */
 public function updateCMSFields(FieldList $fields)
 {
     /** Setup new Root Fieldlist */
     $fields->removeByName('Main');
     $owner = $this->owner;
     /** Add the fields */
     $fields->addFieldsToTab('Root', Tab::create('Main', _t('Tag.MAIN', 'Main'), $text = TextField::create('Title', $owner->fieldLabel('Title')), $html = HTMLEditorField::create('Description', $owner->fieldLabel('Description')), $uplo = UploadField::create('Impression', $owner->fieldLabel('Impression'))));
 }
Esempio n. 19
0
 /**
  * Update CMS fields
  * 
  * @param  FieldList $fields
  * @return FieldList
  */
 public function updateCMSFields(FieldList $fields)
 {
     $fields = $this->getContactfields($fields);
     $fields->addFieldToTab('Root.Main', HTMLEditorField::create('CopyrightText', 'Copyright')->setRows(20));
     $fields->addFieldToTab('Root.Main', UploadField::create('Logo', 'Logo'));
     $fields->addFieldToTab('Root.FooterMenus', GridField::create('FooterMenus', 'Footer Menus', $this->owner->FooterMenus(), GridFieldConfig_RecordEditor::create()->addComponent(new GridFieldSortableRows('SortOrder'))));
     $fields->addFieldToTab('Root.SocialMediaServices', GridField::create('SocialMediaServices', 'Social Icons', $this->owner->SocialMediaServices(), GridFieldConfig_RecordEditor::create()->addComponent(new GridFieldSortableRows('SortOrder'))));
 }
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     // Main Tab
     $fields->addFieldsToTab('Root.Main', array(HTMLEditorField::create('ExtraContent', 'Extra Content Area')), 'Metadata');
     // Google Map
     $fields->addFieldsToTab('Root.GoogleMap', array(TextField::create('GoogleMap', 'Google Map URL')));
     return $fields;
 }
Esempio n. 21
0
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab('Root.Featured', TextField::create('FeaturedTitle', 'Title'));
     $fields->addFieldToTab('Root.Featured', HTMLEditorField::create('FeaturedContent', 'Content')->setRows(20));
     $fields->addFieldToTab('Root.Featured', UploadField::create('FeaturedImage', 'Image')->setFolderName('Services'));
     $fields->addFieldToTab('Root.Features', GridField::create('Features', 'Features', $this->Features(), GridFieldConfig_RecordEditor::create()->addComponent(new GridFieldSortableRows('SortOrder'))));
     return $fields;
 }
Esempio n. 22
0
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->insertAfter(HTMLEditorField::create('ExtraContent'), 'Content');
     $gridField = new GridField('Region', 'Regions', Region::get(), $config = GridFieldConfig_RecordEditor::create());
     $gridField->setModelClass('Region');
     $fields->addFieldToTab('Root.Regions', $gridField);
     return $fields;
 }
 public function updateCMSFields(FieldList $fields)
 {
     $fields->insertAfter(TextField::create("Website"), "Email");
     $fields->insertAfter(TextField::create("Twitter", "Twitter User Name")->setDescription("Do NOT include the '@'"), "Website");
     $fields->insertAfter(TextField::create("Facebook", "Facebook Page or Profile"), "Twitter");
     $fields->insertAfter(TextField::create("GooglePlus", "Google+ Profile"), "Facebook");
     $fields->insertAfter(UploadField::create("Headshot"), "Facebook");
     $fields->insertAfter(HTMLEditorField::create("Bio"), "Headshot");
 }
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     // Main Tab
     $fields->addFieldsToTab('Root.Main', array(HTMLEditorField::create('ExtraContent', 'Extra Content Area')), 'Metadata');
     $fields->addFieldsToTab('Root.Phone', array(GridField::create('Phones', 'Current phone number(s)', $this->Phones(), GridFieldConfig_RelationEditor::create()->removeComponentsByType('GridFieldAddNewButton')->addComponent(new GridFieldEditableColumns())->addComponent(new GridFieldDeleteAction())->addComponent(new GridFieldAddNewInlineButton())->addComponent(new GridFieldOrderableRows()))));
     // Google Map
     $fields->addFieldsToTab('Root.GoogleMap', array(TextField::create('GoogleMap', 'Google Map URL')));
     return $fields;
 }
 public function updateCMSFields(FieldList $fields)
 {
     $fields->addFieldToTab('Root.Main', UploadField::create('Logo')->setFolderName('logos'));
     $footer_fields = ToggleCompositeField::create('FoooterInfo', 'Footer', array(HTMLEditorField::create('FooterContent', 'Content to appear in footer')->setRows(15)->addExtraClass('stacked')))->setHeadingLevel(4);
     $contact_fields = ToggleCompositeField::create('ContactInfo', 'Contact Info.', array(TextAreaField::create('ContactAddress', $this->owner->fieldLabel('ContactAddress')), TextField::create('ContactEmail', $this->owner->fieldLabel('ContactEmail')), TextField::create('ContactPhone', $this->owner->fieldLabel('ContactPhone')), TextAreaField::create('MiscContactInfo', $this->owner->fieldLabel('MiscContactInfo')), TextAreaField::create('MapHTML', "HTML to be loaded for mapping info")))->setHeadingLevel(4);
     $theme_custom_fields = ToggleCompositeField::create('CustomTheme', 'Theme Customisation', array(TextField::create('CustomMainBackground', $this->owner->fieldLabel('CustomMainBackground')), TextField::create('CustomBodyBackground', $this->owner->fieldLabel('CustomBodyBackground')), TextField::create('CustomHeadBackground', $this->owner->fieldLabel('CustomHeadBackground')), TextField::create('CustomFootBackground', $this->owner->fieldLabel('CustomFootBackground')), TextField::create('CustomMaxWidth', $this->owner->fieldLabel('CustomMaxWidth'))))->setHeadingLevel(4);
     $fields->addFieldToTab('Root.Main', $footer_fields);
     $fields->addFieldToTab('Root.Main', $contact_fields);
     $fields->addFieldToTab('Root.Main', $theme_custom_fields);
 }
 public function updateCMSFields(FieldList $fields)
 {
     $group = Group::get()->filter(array('code' => BlogEntry::config()->defaultGroup))->first();
     $contentAuthors = $group->Members()->map('ID', 'Title');
     $fields->insertAfter(HTMLEditorField::create("Summary")->setRows(4), "Content");
     $fields->insertAfter(UploadField::create("FeatureImage"), "Summary");
     $fields->insertAfter(DropdownField::create('AuthorMemberID', 'Author (Member)', $contentAuthors)->setEmptyString('(Select one)'), 'Date');
     $fields->removeByName('Author');
     $fields->insertAfter(TextField::create('Author', "Guest Author"), "AuthorMemberID");
 }
 /**
  * CMS Fields
  * @return array
  */
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $PeopleConfig = GridFieldConfig_RecordEditor::create();
     if ($this->People()->Count() > 0) {
         $PeopleConfig->addComponent(new GridFieldOrderableRows());
     }
     $fields->addFieldsToTab('Root.Main', array(TextareaField::create('Title')->setRows(1), HTMLEditorField::create('Content'), GridField::create('People', 'Current People(s)', $this->People(), $PeopleConfig)));
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->insertAfter($gameFormContent = new HTMLEditorField('GameLiveContent', 'Game selection form detail'), 'Content');
     $gameFormContent->setRows(20);
     $regOpen = new CheckboxField('OpenGameReg', '');
     $fields->insertBefore($cField = new CompositeField(array($label = new LabelField('OpenGameRegLabel', 'Open game selection (all)'), $regOpen)), 'Content');
     $cField->addExtraClass('field');
     $regOpen->addExtraClass('mts');
     $label->addExtraClass('left');
     $groupsMap = array();
     foreach (Group::get() as $group) {
         // Listboxfield values are escaped, use ASCII char instead of &raquo;
         $groupsMap[$group->ID] = $group->getBreadcrumbs(' > ');
     }
     asort($groupsMap);
     $fields->insertBefore(ListboxField::create('OpenGameRegForGroups', "Open game selection for group (limited)")->setMultiple(true)->setSource($groupsMap)->setAttribute('data-placeholder', _t('Member.ADDGROUP', 'Add group', 'Placeholder text for a dropdown')), 'Content');
     return $fields;
 }
 /**
  * CMS Fields
  * @return array
  */
 public function getCMSFields()
 {
     $linksGridConfig = GridFieldConfig_RelationEditor::create();
     if ($this->Links()->Count() > 0) {
         $linksGridConfig->addComponent(new GridFieldOrderableRows());
     }
     $fields = parent::getCMSFields();
     $fields->addFieldsToTab("Root.Main", array(TextareaField::create('Title')->setRows(1), HTMLEditorField::create('Content'), SortableUploadField::create('Images', 'Current Image(s)'), GridField::create('Links', 'Links', $this->Links(), $linksGridConfig)));
     return $fields;
 }
Esempio n. 30
0
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab('Root.Main', CheckboxField::create('ProductLive', 'Enable this product'));
     $fields->addFieldToTab('Root.Main', TextField::create('ProductName', 'Product name'));
     $fields->addFieldToTab('Root.Main', TextField::create('ProductPrice', 'Price without currency symbol (example: 25.99)'));
     $fields->addFieldToTab('Root.Main', TextField::create('ProductCode', 'Product number'));
     $fields->addFieldToTab('Root.Details', UploadField::create('ProductImage', 'Product Image'));
     $fields->addFieldToTab('Root.Details', HTMLEditorField::create('ProductDescription', 'Product Description'));
     return $fields;
 }