function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->replaceField("Content", new TextareaField("Content", _t("SiteTree.Content", "%Content%")));
     $fields->addFieldsToTab('Root.Content.Shop', array(new Textfield("PriceValue", _t("Shop.ItemOption.PriceValue", "%PriceValue%")), new DropdownField("Modus", _t("Shop.ItemOption.Modus", "%Modus%"), singleton($this->ClassName)->dbObject('Modus')->enumValues()), new Textfield("OptionKey", _t("Shop.ItemOption.OptionKey", "%Option Key%")), new FileIFrameField('Download', _t("Shop.ItemOption.Download", "%Download%"))));
     return $fields;
 }
Exemple #2
0
	function getCMSFields() {
		$fields = parent::getCMSFields();
		$fields->addFieldToTab("Root.Content.Widgets", 
			new WidgetAreaEditor("SideBar")
		);
		return $fields;
	}
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     //get all the fields...
     $fields->addFieldToTab('Root.Main', new TextField('MetaTitle', 'Meta Title'), 'MetaDescription');
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab('Root.Main', new CheckboxField('InMainNavigation', 'In Main Navigation anzeigen'));
     $fields->addFieldToTab('Root.Main', new CheckboxField('InFooterNavigation', 'In Footer Navigation anzeigen'));
     return $fields;
 }
Exemple #5
0
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldsToTab("Root.Content.Shop", array(new TextField('ProductKey', _t("Shop.Item.ProductKey", "%ProductKey%")), new NumericField('Price', _t("Shop.Item.Price", "%Price%")), new CheckboxField('Featured', _t("Shop.Item.Featured", "%Featured%")), new TextareaField('Summary', _t("Shop.Item.Summary", "%Summary%"), 5), new TextField('StockQuantity', _t("Shop.Item.StockQuantity", "%StockQuantity%")), new DateField('StockDate', _t("Shop.Item.StockDate", "%StockDate%")), new DropdownField('Currency', _t("Shop.Item.Currency", "%Currency%"), singleton($this->ClassName)->dbObject('Currency')->enumValues()), new ReadonlyField('OrderCount', _t("Shop.Item.OrderCount", "%Orders count%", $this->OrderCount))));
     $fields->addFieldsToTab('Root.Content.' . _t("Shop.Item.Pictures", "%Pictures%"), array(new FileIFrameField('Picture', _t("Shop.Item.Picture", "%Picture%")), new TreeDropdownField('PictureFolderID', _t("Shop.Item.PictureFolder", "%PictureFolder%"), "Folder")));
     return $fields;
 }
Exemple #6
0
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab('Root.SideBarRight', new HTMLEditorField('ContentRight', 'Content Right'));
     $fields->addFieldToTab('Root.Main', new TextField('TitleBarTitle', 'Browser Title'), 'URLSegment');
     return $fields;
 }
Exemple #7
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;
 }
Exemple #8
0
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $imageField = new UploadField('PrimaryImage', 'Image');
     $imageField->getValidator()->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'));
     $fields->addFieldToTab('Root.Main', $imageField, 'Content');
     return $fields;
 }
Exemple #9
0
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $gridField = new GridField('CarouselItems', 'Carousel', $this->CarouselItems(), GridFieldConfig_RelationEditor::create());
     $gridField->setModelClass('CarouselItem');
     $fields->addFieldToTab('Root.Carousel', $gridField);
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     //we use ToggleCompositeFields instead of tabs. it looks cleaner and 'lite'
     $fields->addFieldToTab("Root.Main", ToggleCompositeField::create('Options', _t('Page.OPTIONS', 'Options'), array(CheckboxField::create('ShowInMenus', _t('Page.SHOWREGULARMENU', 'Show in regular Menu')), $tabBehaviour = new Tab('Settings', new DropdownField("ClassName", $this->fieldLabel('ClassName'), $this->getClassDropdown()), $parentTypeSelector = new CompositeField(new OptionsetField("ParentType", _t("SiteTree.PAGELOCATION", "Page location"), array("root" => _t("SiteTree.PARENTTYPE_ROOT", "Top-level page"), "subpage" => _t("SiteTree.PARENTTYPE_SUBPAGE", "Sub-page underneath a parent page"))), $parentIDField = new TreeDropdownField("ParentID", $this->fieldLabel('ParentID'), 'SiteTree', 'ID', 'MenuTitle')))))->setHeadingLevel(4), 'Metadata');
     $fields->removeByName("ExtraMeta");
     return $fields;
 }
Exemple #11
0
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab('Root.ContactForm', new CheckboxField('ContactFormDisplay', 'Show'));
     $fields->addFieldToTab('Root.ContactForm', new EmailField('ContactFormSendTo', 'Send To Email'));
     $fields->addFieldToTab('Root.ContactForm', new TextField('ContactFormSubject', 'Subject'));
     return $fields;
 }
Exemple #12
0
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     // Add the banner image
     $fields->addFieldToTab('Root.Main', new HeaderField('BannerSection', 'Banner'), 'Content');
     $fields->addFieldToTab('Root.Main', new UploadField('BannerImage', 'Banner image'), 'Content');
     return $fields;
 }
Exemple #13
0
 /**
  * @return FieldList
  */
 public function getCMSFields()
 {
     /** =========================================
      * @var FieldList $fields
      * ========================================*/
     $fields = parent::getCMSFields();
     return $fields;
 }
Exemple #14
0
 public function getCMSFields()
 {
     $f = parent::getCMSFields();
     $img = new UploadField('Banner', 'Banner Image');
     $img->setFolderName('Banners');
     $f->addFieldToTab('Root.Main', $img, 'Content');
     $f->addFieldToTab('Root.Main', new HTMLEditorField('BannerText', 'Banner Text'), 'Content');
     return $f;
 }
 public function getCMSFields()
 {
     // Get the fields from the parent implementation
     $fields = parent::getCMSFields();
     //google map module
     $subtitle = new TextField('Subtitle', 'Subtitle');
     $fields->addFieldToTab('Root.Main', $subtitle, 'Content');
     return $fields;
 }
Exemple #16
0
	function getCMSFields() {
		$fields = parent::getCMSFields();

		$fields->addFieldsToTab(
			'Root.Content.Main',
			new TextField('LegacyURL', 'Old URL')
		);
		return $fields;
	}
Exemple #17
0
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab('Root.Settings', new TextField('PageCSS', 'Custom CSS File For This Page (must be in CSS directory)'));
     $fields->addFieldToTab('Root.Settings', new CheckboxField('IncludeJquery', 'Include JQuery In This Page'));
     $fields->addFieldToTab('Root.Settings', new CheckboxField('IncludeShadowBox', 'Include ShadowBox Javascript and CSS'));
     $fields->addFieldToTab('Root.Settings', new TextareaField('PageJavaScript', 'Custom JavaScript For This Page'));
     return $fields;
 }
 function getCMSFields()
 {
     $oFields = parent::getCMSFields();
     $oFields->addFieldToTab('Root.Content.Summary', new TextareaField('Summary', 'Summary of this page'));
     $oLearnDocumentsManager = new ManyManyDataObjectManager($this, 'LearnDownloads', 'LearnDownload', array('Title' => 'Title', 'Description' => 'Description'), 'getCMSFields_forPopup');
     //$oLearnDocumentsManager->setConfirmDelete(true);
     $oFields->addFieldToTab("Root.Content.Downloads", $oLearnDocumentsManager);
     return $oFields;
 }
 public function testUpdateCMSFields()
 {
     // Add custom translation for testing
     i18n::get_translator('core')->getAdapter()->addTranslation(array('SiteTree.METATITLEHELP' => 'TRANS-EN Meta Title Help'), 'en');
     $siteTree = new SiteTree();
     $fields = $siteTree->getCMSFields();
     $metaTitleField = $fields->dataFieldByName('MetaTitle');
     $this->assertNotNull($metaTitleField);
     $this->assertEquals('TRANS-EN Meta Title Help', $metaTitleField->RightTitle());
 }
Exemple #20
0
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->insertAfter(new HTMLEditorField('Sidebar', 'Sidebar Content'), 'Content');
     // Slider tab
     $gridField = new GridField('PromotionalBanners', 'Promotional Banners', $this->PromotionalBanners()->sort(array('Sort' => 'ASC', 'Archived' => 'ASC')), $conf = GridFieldConfig_RelationEditor::create());
     $gridField->setModelClass('PromotionalBanner');
     $fields->addFieldToTab('Root.PromotionalBanners', $gridField);
     $conf->addComponent(new GridFieldOrderableRows());
     return $fields;
 }
Exemple #21
0
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     // metadata
     $fields->fieldByName('Root.Main.Metadata')->push(new UploadField("MetaImage", $this->fieldLabel('MetaImage')));
     $fields->fieldByName('Root.Main.Metadata')->push(new TextField("MetaTitle", $this->fieldLabel('MetaTitle')));
     $fields->addFieldToTab('Root.Settings', new TextField('PageCSS', 'Custom CSS File For This Page (must be in CSS directory)'));
     $fields->addFieldToTab('Root.Settings', new CheckboxField('IncludeJquery', 'Include JQuery In This Page'));
     $fields->addFieldToTab('Root.Settings', new CheckboxField('IncludeShadowBox', 'Include ShadowBox Javascript and CSS'));
     $fields->addFieldToTab('Root.Settings', new TextareaField('PageJavaScript', 'Custom JavaScript For This Page'));
     return $fields;
 }
 /**
  *	Display the appropriate CMS media page fields and respective media type attributes.
  */
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     // Display the media type as read only.
     $fields->addFieldToTab('Root.Main', ReadonlyField::create('Type', 'Type', $this->MediaType()->Title), 'Title');
     // Display a notification that the parent holder contains mixed children.
     $parent = $this->getParent();
     if ($parent && $parent->getMediaHolderChildren()->exists()) {
         Requirements::css(MEDIAWESOME_PATH . '/css/mediawesome.css');
         $fields->addFieldToTab('Root.Main', LiteralField::create('MediaNotification', "<p class='mediawesome notification'><strong>Mixed {$this->MediaType()->Title} Holder</strong></p>"), 'Type');
     }
     // Display the remaining media page fields.
     $fields->addFieldToTab('Root.Main', TextField::create('ExternalLink')->setRightTitle('An <strong>optional</strong> redirect URL to the media source'), 'URLSegment');
     $fields->addFieldToTab('Root.Main', $date = DatetimeField::create('Date'), 'Content');
     $date->getDateField()->setConfig('showcalendar', true);
     // Allow customisation of categories and tags respective to the current page.
     $tags = MediaTag::get()->map()->toArray();
     $fields->findOrMakeTab('Root.CategoriesTags', 'Categories and Tags');
     $fields->addFieldToTab('Root.CategoriesTags', $categoriesList = ListboxField::create('Categories', 'Categories', $tags)->setMultiple(true));
     $fields->addFieldToTab('Root.CategoriesTags', $tagsList = ListboxField::create('Tags', 'Tags', $tags)->setMultiple(true));
     if (!$tags) {
         $categoriesList->setAttribute('disabled', 'true');
         $tagsList->setAttribute('disabled', 'true');
     }
     // Allow customisation of media type attribute content respective to the current page.
     if ($this->MediaAttributes()->exists()) {
         foreach ($this->MediaAttributes() as $attribute) {
             if (strripos($attribute->Title, 'Time') || strripos($attribute->Title, 'Date') || stripos($attribute->Title, 'When')) {
                 // Display an attribute as a date time field where appropriate.
                 $fields->addFieldToTab('Root.Main', $custom = DatetimeField::create("{$attribute->ID}_MediaAttribute", $attribute->Title, $attribute->Content), 'Content');
                 $custom->getDateField()->setConfig('showcalendar', true);
             } else {
                 $fields->addFieldToTab('Root.Main', $custom = TextField::create("{$attribute->ID}_MediaAttribute", $attribute->Title, $attribute->Content), 'Content');
             }
             $custom->setRightTitle('Custom <strong>' . strtolower($this->MediaType()->Title) . '</strong> attribute');
         }
     }
     // Display an abstract field for content summarisation.
     $fields->addfieldToTab('Root.Main', $abstract = TextareaField::create('Abstract'), 'Content');
     $abstract->setRightTitle('A concise summary of the content');
     $abstract->setRows(6);
     // Allow customisation of images and attachments.
     $type = strtolower($this->MediaType()->Title);
     $fields->findOrMakeTab('Root.ImagesAttachments', 'Images and Attachments');
     $fields->addFieldToTab('Root.ImagesAttachments', $images = UploadField::create('Images'));
     $images->getValidator()->setAllowedExtensions(array('jpg', 'jpeg', 'png', 'gif', 'bmp'));
     $images->setFolderName("media-{$type}/{$this->ID}/images");
     $fields->addFieldToTab('Root.ImagesAttachments', $attachments = UploadField::create('Attachments'));
     $attachments->setFolderName("media-{$type}/{$this->ID}/attachments");
     // Allow extension customisation.
     $this->extend('updateMediaPageCMSFields', $fields);
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     /*
      *   MAIN TAB
      */
     $tab = 'Root.Main';
     //provides listbox field menu for selecting a predefined Icon
     $data = DataObject::get('Icon');
     $field = new ListboxField('MyIconID', 'My Icon');
     $field->setSource($data->map('ID', 'Name')->toArray());
     $field->setEmptyString('Select one');
     $fields->addFieldToTab($tab, $field);
     return $fields;
 }
Exemple #24
0
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $image = FileAttachmentField::create('Image', 'Featured image')->setThumbnailHeight(200)->setThumbnailWidth(200)->setAutoProcessQueue(true)->setMaxFilesize(10)->imagesOnly();
     $gallery = FileAttachmentField::create('Images', 'Upload images')->setThumbnailHeight(200)->setThumbnailWidth(200)->setAutoProcessQueue(true)->setMaxFilesize(10)->setView('grid')->imagesOnly();
     // ->setPermissions(array(
     //    'delete' => false,
     //    'detach' => function () {
     //      return Member::currentUser() && Member::currentUser()->inGroup('editors');
     //    }
     //  )
     $conf = GridFieldConfig_RelationEditor::create(10);
     $conf->addComponent(new GridFieldSortableRows('Sort'));
     $fields->addFieldToTab('Root.Slider', new GridField('Slider', 'Slider', $this->Slider(), $conf));
     $fields->addFieldToTab("Root.Images", $image);
     $fields->addFieldToTab("Root.Images", $gallery);
     return $fields;
 }
Exemple #25
0
 public function getCMSFields()
 {
     $f = parent::getCMSFields();
     $f->addFieldToTab("Root.Main", new UploadField("BackgroundImage", "Background Image"), "Content");
     $gridFieldConfig = GridFieldConfig_RelationEditor::create();
     $row = "SortOrder";
     $gridFieldConfig->addComponent($sort = new GridFieldSortableRows(stripslashes($row)));
     //$gridFieldConfig->addComponent(new GridFieldManyRelationHandler(), 'GridFieldPaginator');
     $sort->table = 'Page_SidebarItems';
     $sort->parentField = 'PageID';
     $sort->componentField = 'SidebarItemID';
     $gridField = new GridField("SidebarItems", "Sidebar Items", $this->SidebarItems(), $gridFieldConfig);
     $f->addFieldToTab("Root.Sidebar", new LabelField("SidebarLabel", "<h2>Add sidebar items below</h2>"));
     $f->addFieldToTab("Root.Sidebar", new LiteralField("SidebarManageLabel", '<p><a href="admin/sidebar-items" target="_blank">View and Manage Sidebar Items &raquo;</a></p>'));
     $f->addFieldToTab("Root.Sidebar", $gridField);
     // add the grid field to a tab in the CMS
     return $f;
 }
Exemple #26
0
	function getCMSFields() {
		$fields = parent::getCMSFields();
		$tags = singleton('TagCloudWidget')->TagsCollection();
		if($tags && $tags->Count()) {
			$tags->sort('Tag');
			$tagsMap = $tags->toDropDownMap('Tag', 'Tag');
		} else {
			$tagsMap = false;
		}
		$fields->addFieldsToTab(
			'Root.Content.Context Navigation',
			array(
				new NumericField(
					'ContextNavMaxPages', 
					'Maximum number of pages to display (default: 10)'
				),
				new TextField(
					'ContextNavKeywords', 
					'Keywords (comma separated)'
				),
				new CheckboxSetField(
					'ContextNavTags', 
					'Blog tags to search for',
					$tagsMap
				)
			)
		);
		$fields->addFieldsToTab(
			'Root.Content.Banner',
			new ImageField('BannerImage', 'Banner')
		);
		$fields->addFieldsToTab(
			'Root.Content.Main',
			new TextField('LegacyURL', 'Alte URL')
		);
		$fields->addFieldToTab(
			'Root.Content.Referrers',
			$this->getReferrerTableListField()
		);
		return $fields;
	}
 /**
  * CMS Fields
  * NOTE: Some of this is still from ss2x - might need updates
  */
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     //
     //Content tab
     $fields->addFieldToTab("Root.Main", new TextField("SubTitle", "Subtitle"), "MenuTitle");
     $fields->addFieldToTab("Root.Main", new TextField("Author", "Author(s)"), "Content");
     $dateField = new DateField("Date", "Date");
     $dateField->setConfig("showcalendar", true);
     $fields->addFieldToTab("Root.Main", $dateField, "Content");
     //
     //Metadata tab
     //
     //Image tab
     $fields->addFieldToTab("Root.Image", new ImageUploadField('Image'));
     $fields->addFieldToTab("Root.Image", new ImageUploadField('ThumbnailImage'));
     $fields->addFieldToTab("Root.Image", new DropdownField("ImagePosition", "Image Position", singleton('Page')->dbObject('ImagePosition')->enumValues()));
     //
     //Removing unneccesary settings
     $fields->removeFieldFromTab("Root", "Gallery");
     $fields->removeFieldFromTab("Root", "Sidebar");
     return $fields;
 }
Exemple #28
0
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $gridFieldConfig = GridFieldConfig_RecordEditor::create();
     $gridFieldConfig->addComponent(new GridFieldSortableRows('SortOrder'));
     $gridfield = new GridField("Pictures", "Pictures", $this->Pictures()->sort("SortOrder"), $gridFieldConfig);
     $fields->addFieldToTab('Root.Pictures', $gridfield);
     $fields->addFieldToTab('Root.Pictures', new DropdownField('Align', 'Align (relative to text)', singleton('Page')->dbObject('Align')->enumValues()), '');
     $gridFieldConfig2 = GridFieldConfig_RecordEditor::create();
     $gridFieldConfig2->addComponent(new GridFieldSortableRows('SortOrder'));
     $gridfield2 = new GridField("Videos", "Videos", $this->Videos()->sort("SortOrder"), $gridFieldConfig2);
     $fields->addFieldToTab('Root.Videos', $gridfield2);
     $fields->addFieldToTab('Root.Videos', new CheckboxField('Videobottom', 'Show all videos below'), '');
     $gridFieldConfig3 = GridFieldConfig_RecordEditor::create();
     $gridFieldConfig3->addComponent(new GridFieldSortableRows('SortOrder'));
     $gridfield3 = new GridField("ExtraContentBlocks", "ExtraContentBlocks", $this->ExtraContentBlocks()->sort("SortOrder"), $gridFieldConfig3);
     $fields->addFieldToTab('Root.Main', new LiteralField('Note1', '<br /><br />'), 'Metadata');
     // Spacer
     $fields->addFieldToTab('Root.Main', $gridfield3, 'Metadata');
     $fields->addFieldToTab('Root.Main', new LiteralField('Note2', '<br /><br />'), 'Metadata');
     // Spacer
     $fields->addFieldToTab('Root.Gallery', $uploadField = new SortableUploadField($name = 'GalleryImages', $title = 'Upload images (max 100 in total)'));
     $uploadField->setAllowedMaxFileNumber(100);
     $uploadField->setFolderName('GalleryImages');
     $uploadField->setAllowedExtensions(array('jpg', 'jpeg', 'png', 'gif'));
     $metatitle = new TextField('MetaTitle', 'Alternative Page Title');
     $metatitle->setRightTitle('Used in the browser window, search listings, bookmarks etc');
     $fields->addFieldToTab('Root.Main', $metatitle, 'MetaDescription');
     $CustomPreviewText = new TextAreaField('CustomPreviewText', 'Custom Preview Text');
     $CustomPreviewText->setRightTitle('Replaces the content summary for this page when shown on listing pages or search engines');
     $fields->addFieldToTab('Root.Main', $CustomPreviewText, 'MetaDescription');
     $fields->removeByName("Dependent");
     $fields->removeByName("MetaDescription");
     $fields->removeByName("ExtraMeta");
     return $fields;
 }
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldsToTab('Root.ContentSections', array(GridField::create('Sections', 'Sections', $this->Sections(), GridFieldConfig_RecordEditor::create()->addComponents(new GridFieldOrderableRows()))));
     return $fields;
 }