/**
  * Returns an instance of this class
  *
  * @param Controller $controller
  * @param string $name
  */
 public function __construct($controller, $name)
 {
     $fields = new FieldList(array(new HiddenField('AuthenticationMethod', null, $this->authenticator_class)));
     $actions = new FieldList(array(FormAction::create('redirectToRealMe', _t('RealMeLoginForm.LOGINBUTTON', 'LoginAction'))->setUseButtonTag(true)->setButtonContent('<span class="realme_button_padding">Login or register with RealMe<span class="realme_icon_new_window"></span> <span class="realme_icon_padlock"></span>')->setAttribute('class', 'realme_button')));
     // Taken from MemberLoginForm
     if (isset($_REQUEST['BackURL'])) {
         $backURL = $_REQUEST['BackURL'];
     } elseif (Session::get('BackURL')) {
         $backURL = Session::get('BackURL');
     }
     if (isset($backURL)) {
         // Ensure that $backURL isn't redirecting us back to login form or a RealMe authentication page
         if (strpos($backURL, 'Security/login') === false && strpos($backURL, 'Security/realme') === false) {
             $fields->push(new HiddenField('BackURL', 'BackURL', $backURL));
         }
     }
     // optionally include requirements {@see /realme/_config/config.yml}
     if ($this->config()->include_jquery) {
         Requirements::javascript(THIRDPARTY_DIR . "/jquery/jquery.js");
     }
     if ($this->config()->include_javascript) {
         Requirements::javascript(REALME_MODULE_PATH . "/javascript/realme.js");
     }
     if ($this->config()->include_css) {
         Requirements::css(REALME_MODULE_PATH . "/css/realme.css");
     }
     parent::__construct($controller, $name, $fields, $actions);
 }
 /**
  * Adds the field editor to the page.
  *
  * @return FieldList
  */
 public function updateCMSFields(FieldList $fields)
 {
     $fieldEditor = $this->getFieldEditorGrid();
     $fields->insertAfter(new Tab('FormFields', _t('UserFormFieldEditorExtension.FORMFIELDS', 'Form Fields')), 'Main');
     $fields->addFieldToTab('Root.FormFields', $fieldEditor);
     return $fields;
 }
 public function updateCMSFields(\FieldList $fields)
 {
     if (!$this->owner->exists()) {
         return;
     }
     $fields->addFieldsToTab('Root.Recommended', [\TextField::create('Recommended_Title', _t('Product.Recommended_Title', 'Title'))->setAttribute('placeholder', $this->owner->config()->recommended_title ?: _t('Product.Default-Recommended_Title', 'Recommended Products')), \CheckboxField::create('Recommended_AlsoBought', _t('Product.Recommended_AlsoBought', 'Prioritise products that were bought with this product?'))->setDescription(_t('Product.Desc-Recommended_AlsoBought', 'This will use products that previous customers have bought with this product, otherwise it will select from your choice below.')), \SelectionGroup::create('Recommended_FindBy', $this->getMethodFormFields())]);
 }
Ejemplo n.º 4
0
 public function updateCMSFields(FieldList $fields)
 {
     $fields->removeByName('Country');
     $fields->removeByName("DefaultShippingAddressID");
     $fields->removeByName("DefaultBillingAddressID");
     $fields->addFieldToTab('Root.Main', DropdownField::create('Country', _t('Address.db_Country', 'Country'), SiteConfig::current_site_config()->getCountriesList()));
 }
 public function updateCMSFields(FieldList $fields)
 {
     $metaData = $fields->fieldByName('Root.Main.Metadata');
     $metaFieldTitle = new TextareaField("MetaKeywords", $this->owner->fieldLabel('MetaKeywords'));
     $metaData->insertAfter($metaFieldTitle, 'MetaDescription');
     return $fields;
 }
 public function updateCMSFields(FieldList $fields)
 {
     if ($this->owner->Site()->hasFeature('PageThumbnails')) {
         $fields->addFieldToTab('Root.Main', $thumb = UploadField::create('PageThumbnail', 'Page Thumbnail'));
         $thumb->getValidator()->allowedExtensions = array('jpg', 'gif', 'png');
     }
 }
 public function updateCMSFields(FieldList $fields)
 {
     $sortable = singleton('CleanTeaser')->hasExtension('SortableDataExtension');
     $config = GridFieldConfig_RelationEditor::create();
     $config->addComponent($gridFieldForm = new GridFieldDetailForm());
     $dataFields = array();
     if (singleton('CleanTeaser')->hasExtension('CMSPublishableDataExtension')) {
         $dataFields['PublishIndicator'] = 'Published';
     }
     $dataFields = array_merge($dataFields, array('Thumbnail' => 'Thumbnail', 'Title' => 'Title', 'CleanDescription' => 'Description'));
     $config->getComponentByType('GridFieldDataColumns')->setDisplayFields($dataFields);
     $gridFieldForm->setTemplate('CMSGridFieldPopupForms');
     if ($sortable) {
         $config->addComponent(new GridFieldSortableRows('SortOrder'));
     }
     if (ClassInfo::exists('GridFieldBulkUpload')) {
         $iu = new GridFieldBulkUpload('ImageID');
         if (singleton('CleanTeaser')->hasExtension('ControlledFolderDataExtension')) {
             $iu->setUfConfig('folderName', singleton('CleanTeaser')->getUploadFolder());
         } else {
             $iu->setUfConfig('folderName', CleanTeaser::$upload_folder);
         }
         $config->addComponent($iu);
     }
     if ($sortable) {
         $data = $this->owner->CleanTeasers("ClassName = 'CleanTeaser'")->sort('SortOrder');
     } else {
         $data = $this->owner->CleanTeasers("ClassName = 'CleanTeaser'");
     }
     // $config->removeComponentsByType('GridFieldAddNewButton');
     // if (ClassInfo::exists('GridFieldBulkUpload')) {
     // 	$config->addComponent(new GridFieldAddNewMultiClass());
     // }
     $fields->addFieldToTab("Root.Teasers", GridField::create('CleanTeasers', 'CleanTeaser', $data, $config));
 }
 function __construct($controller, $name)
 {
     $fields = new FieldList(array($t1 = new TextField('ExternalOrderId', 'Eventbrite Order #'), $checkbox = new CheckboxField('SharedContactInfo', 'Allow to share contact info?')));
     $t1->setAttribute('placeholder', 'Enter your Eventbrite order #');
     $t1->addExtraClass('event-brite-order-number');
     $attendees = Session::get('attendees');
     if (count($attendees) > 0) {
         $t1->setValue(Session::get('ExternalOrderId'));
         $t1->setReadonly(true);
         $checkbox->setValue(intval(Session::get('SharedContactInfo')) === 1);
         $fields->add(new LiteralField('ctrl1', 'Current Order has following registered attendees, please select one:'));
         $options = array();
         foreach ($attendees as $attendee) {
             $ticket_external_id = intval($attendee['ticket_class_id']);
             $ticket_type = SummitTicketType::get()->filter('ExternalId', $ticket_external_id)->first();
             if (is_null($ticket_type)) {
                 continue;
             }
             $options[$attendee['id']] = $attendee['profile']['name'] . ' (' . $ticket_type->Name . ')';
         }
         $attendees_ctrl = new OptionSetField('SelectedAttendee', '', $options);
         $fields->add($attendees_ctrl);
         $validator = new RequiredFields(array('ExternalOrderId'));
         // Create action
         $actions = new FieldList($btn_clear = new FormAction('clearSummitAttendeeInfo', 'Clear'), $btn = new FormAction('saveSummitAttendeeInfo', 'Done'));
         $btn->addExtraClass('btn btn-default active');
         $btn_clear->addExtraClass('btn btn-danger active');
     } else {
         $validator = new RequiredFields(array('ExternalOrderId'));
         // Create action
         $actions = new FieldList($btn = new FormAction('saveSummitAttendeeInfo', 'Get Order'));
         $btn->addExtraClass('btn btn-default active');
     }
     parent::__construct($controller, $name, $fields, $actions, $validator);
 }
 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"));
 }
 /**
  * Gets the form used for viewing a time log
  */
 public function getEditForm($id = null, $fields = null)
 {
     $record = $this->currentPage();
     if ($this->action == 'view' && $record) {
         $fields = new FieldList(new HeaderField('LogHeader', _t('KapostBridgeLogViewer.VIEWING_ENTRY', '_Viewing Log Entry: {datetime}', array('datetime' => $record->dbObject('Created')->FormatFromSettings())), 3), new ReadonlyField('UserAgent', _t('KapostBridgeLogViewer.USER_AGENT', '_Requestor User Agent')), new ReadonlyField('Method', _t('KapostBridgeLogViewer.METHOD', '_Method')), ToggleCompositeField::create('RequestData', _t('KapostBridgeLogViewer.KAPOST_REQUEST', '_Kapost Request'), new FieldList(ReadonlyField::create('RequestFormatted', '')->setTemplate('KapostBridgeLogField')->addExtraClass('log-contents cms-panel-layout')))->setHeadingLevel(3), ToggleCompositeField::create('ResponseData', _t('KapostBridgeLogViewer.SILVERSTRIPE_RESPONSE', '_SilverStripe Response'), new FieldList(ReadonlyField::create('ResponseFormatted', '')->setTemplate('KapostBridgeLogField')->addExtraClass('log-contents cms-panel-layout')))->setHeadingLevel(3));
         $refObj = $record->ReferenceObject;
         if (!empty($refObj) && $refObj !== false && $refObj->exists()) {
             if (method_exists($refObj, 'CMSEditLink')) {
                 $fields->insertBefore(new KapostLogLinkField('CMSEditLink', _t('KapostBridgeLogViewer.REFERENCED_OBJECT', '_Referenced Object'), $refObj->CMSEditLink(), _t('KapostBridgeLogViewer.VIEW_REFERENCED_OBJECT', '_View Referenced Object')), 'RequestData');
             } else {
                 if ($refObj instanceof File) {
                     $refObjLink = Controller::join_links(LeftAndMain::config()->url_base, AssetAdmin::config()->url_segment, 'EditForm/field/File/item', $refObj->ID, 'edit');
                     $fields->insertBefore(new KapostLogLinkField('CMSEditLink', _t('KapostBridgeLogViewer.REFERENCED_OBJECT', '_Referenced Object'), $refObjLink, _t('KapostBridgeLogViewer.VIEW_REFERENCED_OBJECT', '_View Referenced Object')), 'RequestData');
                 }
             }
         }
     } else {
         $fields = new FieldList();
     }
     $form = new CMSForm($this, 'EditForm', $fields, new FieldList());
     $form->setResponseNegotiator($this->getResponseNegotiator());
     $form->addExtraClass('cms-edit-form center');
     $form->setAttribute('data-layout-type', 'border');
     $form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
     $form->setAttribute('data-pjax-fragment', 'CurrentForm');
     $form->setHTMLID('Form_EditForm');
     if ($record) {
         $form->loadDataFrom($record);
     }
     return $form;
 }
 function __construct($controller, $name, $poll)
 {
     if (!$poll) {
         user_error("The poll doesn't exist.", E_USER_ERROR);
     }
     $this->poll = $poll;
     $data = array();
     foreach ($poll->Choices() as $choice) {
         $data[$choice->ID] = $choice->Title;
     }
     if ($poll->MultiChoice) {
         $choiceField = new CheckboxSetField('PollChoices', '', $data);
     } else {
         $choiceField = new OptionsetField('PollChoices', '', $data);
     }
     $fields = new FieldList($choiceField);
     if (PollForm::$show_results_link) {
         $showResultsURL = Director::get_current_page()->Link() . '?poll_results';
         $showResultsLink = new LiteralField('ShowPollLink', '<a class="show-results" href="' . $showResultsURL . '">Show results</a>');
         $fields->push($showResultsLink);
     }
     $actions = new FieldList(new FormAction('submitPoll', 'Submit', null, null, 'button'));
     $validator = new PollForm_Validator('PollChoices');
     parent::__construct($controller, $name, $fields, $actions, $validator);
 }
 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;
 }
Ejemplo n.º 13
0
 public function updateCMSFields(FieldList $fields)
 {
     $fields->insertBefore($shoptab = new Tab('Shop', 'Shop'), 'Access');
     $fields->addFieldsToTab("Root.Shop", new TabSet("ShopTabs", $maintab = new Tab("Main", TreeDropdownField::create('TermsPageID', _t("ShopConfig.TERMSPAGE", 'Terms and Conditions Page'), 'SiteTree'), TreeDropdownField::create("CustomerGroupID", _t("ShopConfig.CUSTOMERGROUP", "Group to add new customers to"), "Group"), UploadField::create('DefaultProductImage', _t('ShopConfig.DEFAULTIMAGE', 'Default Product Image'))), $countriestab = new Tab("Countries", CheckboxSetField::create('AllowedCountries', 'Allowed Ordering and Shipping Countries', self::config()->iso_3166_country_codes))));
     $fields->removeByName("CreateTopLevelGroups");
     $countriestab->setTitle("Allowed Countries");
 }
 /**
  * Returns a FieldList with which to create the editing form. {@link SiteTree::getCMSFields()}
  */
 public function updateCMSFields(FieldList $fields)
 {
     $placeholderImageUploadField = new UploadField('PlaceholderImage', _t('PlaceholderImageSiteConfigExtension.PLACEHOLDERIMAGE', 'Placeholder Image'));
     $placeholderImageUploadField->allowedExtensions = array('jpg', 'gif', 'png');
     $fields->findOrMakeTab('Root.Images', _t('PlaceholderImageSiteConfigExtension.IMAGES', 'Images'));
     $fields->addFieldToTab('Root.Images', $placeholderImageUploadField);
 }
 /**
  * @param FieldList $fields
  * @return FieldList
  */
 public function updateSettingsFields(FieldList $fields)
 {
     /** @var FieldGroup $hideDefaultSlider */
     $fields->addFieldToTab('Root.Settings', $hideDefaultSlider = FieldGroup::create(CheckboxField::create('HideDefaultSlider', 'Hide the slider from this page')));
     $hideDefaultSlider->setTitle('Slider');
     return $fields;
 }
 /**
  * Setup the CMS Fields
  *
  * @param FieldList
  */
 public function updateCMSFields(FieldList $fields)
 {
     if (!$this->supportsElemental()) {
         return false;
     }
     // add an empty holder for content as some module explicitly use insert
     // after content.
     $fields->replaceField('Content', new LiteralField('Content', ''));
     $adder = new ElementalGridFieldAddNewMultiClass();
     $list = $this->getAvailableTypes();
     $adder->setClasses($list);
     $area = $this->owner->ElementArea();
     if (!$area->exists() || !$area->isInDB()) {
         $area->write();
         $this->owner->ElementAreaID = $area->ID;
         $this->owner->write();
     }
     $gridField = GridField::create('ElementArea', Config::inst()->get("ElementPageExtension", 'elements_title'), $this->owner->ElementArea()->Elements(), GridFieldConfig_RelationEditor::create()->removeComponentsByType('GridFieldAddNewButton')->removeComponentsByType('GridFieldDeleteAction')->removeComponentsByType('GridFieldAddExistingAutocompleter')->addComponent(new ElementalGridFieldAddExistingAutocompleter())->addComponent(new ElementalGridFieldDeleteAction())->addComponent($adder)->addComponent(new GridFieldSortableRows('Sort')));
     $config = $gridField->getConfig();
     $paginator = $config->getComponentByType('GridFieldPaginator');
     $paginator->setItemsPerPage(100);
     $config->removeComponentsByType('GridFieldDetailForm');
     $config->addComponent(new VersionedDataObjectDetailsForm());
     $fields->addFieldToTab('Root.Main', $gridField);
     return $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 getCMSFields()
 {
     $fields = new FieldList();
     $fields->push(TextField::create("TwitterHandle", "Twitter Handle"));
     $fields->push(NumericField::create("NumberOfTweets", "Number of Tweets"));
     return $fields;
 }
 public function updateCMSFields(FieldList $fields)
 {
     foreach (['primary', 'secondary'] as $lower) {
         $upper = ucfirst($lower);
         $config = $this->owner->config()->get("{$lower}_gallery");
         if (is_null($config) || isset($config['enabled']) && $config['enabled'] === false) {
             continue;
         }
         $config['title'] = isset($config['title']) ? $config['title'] : "{$upper} Gallery";
         $config['folder'] = isset($config['folder']) ? $config['folder'] : "{$upper}-Gallery-Images";
         $GridFieldConfig = new GridFieldConfig_RecordEditor();
         $GridFieldConfig->removeComponentsByType('GridFieldAddNewButton');
         $GridFieldConfig->addComponent($bulkUploadConfig = new GridFieldBulkUpload());
         $GridFieldConfig->addComponent(new GridFieldSortableRows('SortOrder'));
         $GridFieldConfig->addComponent(new GridFieldGalleryTheme('Image'));
         $bulkUploadConfig->setUfSetup('setFolderName', "Images/{$config['folder']}");
         $GridField = new GridField("{$upper}GalleryGridField", $config['title'], $this->owner->{"{$upper}GalleryImages"}(), $GridFieldConfig);
         /** @var TabSet $rootTab */
         //We need to repush Metadata to ensure it is the last tab
         $rootTab = $fields->fieldByName('Root');
         $rootTab->push($tab = Tab::create("{$upper}Gallery"));
         if ($rootTab->fieldByName('Metadata')) {
             $metaChildren = $rootTab->fieldByName('Metadata')->getChildren();
             $rootTab->removeByName('Metadata');
             $rootTab->push(Tab::create('Metadata')->setChildren($metaChildren));
         }
         $tab->setTitle($config['title']);
         $fields->addFieldToTab("Root.{$upper}Gallery", $GridField);
     }
 }
 /**
  * Add an option to include in the comment 
  */
 public function updateFieldConfiguration(FieldList $fields)
 {
     if (in_array($this->owner->Parent()->Classname, ClassInfo::subclassesFor('Consultation'))) {
         $comment = CheckboxField::create($this->owner->getSettingName('CommentField'), _t('CONSULTATION.INCLUDEINCOMMENT', 'Include this field in comment post'), $this->owner->getSetting('CommentField'));
         $fields->push($comment);
     }
 }
 /**
  * Adds PublishDate to CMS Form.
  * @param $fields
  */
 function updateCMSFields(FieldList $fields)
 {
     $datefield = DatetimeField::create('PublishDate', _t('CMSPublishableDataExtension.PUBLISH_DATE', 'Publish date'));
     $datefield->getDateField()->setConfig('showcalendar', 1);
     // $datefield->setConfig('setLocale', en_US);
     $fields->addFieldToTab("Root.Main", $datefield, 'Content');
 }
 /**
  * Taken from MemberLoginForm::__construct with minor changes
  */
 public function __construct($controller, $name, $fields = null, $actions = null, $checkCurrentUser = true)
 {
     $customCSS = project() . '/css/member_login.css';
     if (Director::fileExists($customCSS)) {
         Requirements::css($customCSS);
     }
     if (isset($_REQUEST['BackURL'])) {
         $backURL = $_REQUEST['BackURL'];
     } else {
         $backURL = Session::get('BackURL');
     }
     if ($checkCurrentUser && Member::currentUser() && Member::logged_in_session_exists()) {
         $fields = new FieldList(new HiddenField("AuthenticationMethod", null, $this->authenticator_class, $this));
         $actions = new FieldList(new FormAction("logout", _t('Member.BUTTONLOGINOTHER', "Log in as someone else")));
     } else {
         if (!$fields) {
             $fields = new FieldList(new HiddenField("AuthenticationMethod", null, $this->authenticator_class, $this));
         }
         if (!$actions) {
             $actions = new FieldList(new FormAction('dologin', _t('GoogleAuthenticator.BUTTONLOGIN', "Log in with Google")));
         }
     }
     if (isset($backURL)) {
         $fields->push(new HiddenField('BackURL', 'BackURL', $backURL));
     }
     // Allow GET method for callback
     $this->setFormMethod('GET', true);
     parent::__construct($controller, $name, $fields, $actions);
 }
    public function updateSettingsFields(FieldList $fields)
    {
        //removing view settings
        $fields->removeByName("CanViewType");
        $fields->removeByName("ViewerGroups");
        //adding view settings displaying the custom hard coded view settings
        $groups = $this->owner->DictatedViewerGroups();
        $groupsStr = '';
        if ($groups) {
            foreach ($groups as $g) {
                $groupsStr .= "{$g->Title}, ";
            }
            $groupsStr = rtrim($groupsStr, ', ');
        } else {
            $groupsStr = _t('SiteTree.ACCESSLOGGEDIN', "Logged-in users");
        }
        $fields->addFieldToTab('Root', LiteralField::create('CanViewTypeExpl', '
<div class="field fieldgroup fieldgroup">
	<label class="left">' . _t('SiteTree.ACCESSHEADER', "Who can view this page?") . '</label>
	<div class="middleColumn fieldgroup ">
		<p>
			<em>' . $groupsStr . '</em>
		</p>

	</div>
</div>
			'), 'CanEditType');
    }
 /**
  * @param FieldList $fields
  */
 public function updateCMSFields(FieldList $fields)
 {
     $fields->addFieldsToTab('Root.Related', array($grid = GridField::create("RelatedProductsRelation", "Related Products", $this->owner->RelatedProductsRelation()->sort('Order', 'ASC'), GridFieldConfig_RelationEditor::create()->removeComponentsByType("GridFieldAddNewButton")->removeComponentsByType("GridFieldEditButton")->addComponent(new GridFieldOrderableRows('Order'))->addComponent(new GridFieldEditableColumns()))));
     $grid->getConfig()->getComponentByType('GridFieldEditableColumns')->setDisplayFields(array('RelatedTitle' => function ($record, $column, $grid) {
         return new TextField($column);
     }));
 }
 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;
 }
Ejemplo n.º 26
0
 public function __construct($controller, $name)
 {
     $product = new Product();
     $title = new TextField('Title', _t('Product.PAGETITLE', 'Product Title'));
     $urlSegment = new TextField('URLSegment', 'URL Segment');
     $menuTitle = new TextField('MenuTitle', 'Navigation Title');
     $sku = TextField::create('InternalItemID', _t('Product.CODE', 'Product Code/SKU'), '', 30);
     $categories = DropdownField::create('ParentID', _t("Product.CATEGORY", "Category"), $product->categoryoptions())->setDescription(_t("Product.CATEGORYDESCRIPTION", "This is the parent page or default category."));
     $otherCategories = ListBoxField::create('ProductCategories', _t("Product.ADDITIONALCATEGORIES", "Additional Categories"), ProductCategory::get()->filter("ID:not", $product->getAncestors()->map('ID', 'ID'))->map('ID', 'NestedTitle')->toArray())->setMultiple(true);
     $model = TextField::create('Model', _t('Product.MODEL', 'Model'), '', 30);
     $featured = CheckboxField::create('Featured', _t('Product.FEATURED', 'Featured Product'));
     $allow_purchase = CheckboxField::create('AllowPurchase', _t('Product.ALLOWPURCHASE', 'Allow product to be purchased'), 1, 'Content');
     $price = TextField::create('BasePrice', _t('Product.PRICE', 'Price'))->setDescription(_t('Product.PRICEDESC', "Base price to sell this product at."))->setMaxLength(12);
     $image = UploadField::create('Image', _t('Product.IMAGE', 'Product Image'));
     $content = new HtmlEditorField('Content', 'Content');
     $fields = new FieldList();
     $fields->add($title);
     //$fields->add($urlSegment);
     //$fields->add($menuTitle);
     //$fields->add($sku);
     $fields->add($categories);
     //$fields->add($otherCategories);
     $fields->add($model);
     $fields->add($featured);
     $fields->add($allow_purchase);
     $fields->add($price);
     $fields->add($image);
     $fields->add($content);
     //$fields = $product->getFrontEndFields();
     $actions = new FieldList(new FormAction('submit', _t("ChefProductForm.ADDPRODUCT", 'Add product')));
     $requiredFields = new RequiredFields(array('Title', 'Model', 'Price'));
     parent::__construct($controller, $name, $fields, $actions, $requiredFields);
 }
 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 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);
 }
 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 updateCMSFields(FieldList $fields)
 {
     // Remove Configurable Page Tab
     if (!$this->owner->ConfigurablePages) {
         $fields->removeByName('ConfigurablePages');
     }
 }