PHP FieldList Code Examples

This page contains top rated real world PHP examples of FieldList extracted from open source projects. You can rate examples to help us improve the quality of examples
Example #1
Show file File: UserFormFieldEditorExtension.php Project: camfindlay/silverstripe-userforms
0
 /**
  * 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;
 }
Example #2
Show file File: ShopMember.php Project: burnbright/silverstripe-shop
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()));
 }
Example #3
Show file File: HasRecommendedProducts.php Project: milkyway-multimedia/ss-shop-recommended
0
 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())]);
 }
Example #4
Show file File: PageThumbnailExtension.php Project: helpfulrobot/silverstripe-australia-ba-sis
0
 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');
     }
 }
Example #5
Show file File: MetaKeywordsExtension.php Project: helpfulrobot/arnhoe-metakeywords
0
 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;
 }
Example #6
Show file File: RealMeLoginForm.php Project: helpfulrobot/silverstripe-realme
0
 /**
  * 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);
 }
Example #7
Show file File: CleanTeasersExtension.php Project: arillo/silverstripe-cleanutilities
0
 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));
 }
Example #8
Show file File: SummitAttendeeInfoForm.php Project: Thingee/openstack-org
0
 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);
 }
Example #9
Show file File: OrdersSiteConfigExtension.php Project: helpfulrobot/i-lateral-silverstripe-orders
0
 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"));
 }
Example #10
Show file File: KapostBridgeLogViewer.php Project: webbuilders-group/silverstripe-kapost-bridge-logger
0
 /**
  * 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;
 }
Example #11
Show file File: PollForm.php Project: helpfulrobot/mateusz-silverstripe-polls
0
 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);
 }
Example #12
Show file File: SiteConfigExtras.php Project: sunnysideup/mysite_ssu_flava
0
 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;
 }
Example #13
Show file File: ShopConfig.php Project: helpfulrobot/silvershop-core
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");
 }
Example #14
Show file File: PlaceholderImageSiteConfigExtension.php Project: helpfulrobot/studiobonito-silverstripe-imagefunctions
0
 /**
  * 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);
 }
Example #15
Show file File: SliderConfig.php Project: helpfulrobot/ryanpotter-silverstripe-boilerplate
0
 /**
  * @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;
 }
Example #16
Show file File: ElementPageExtension.php Project: nyeholt/silverstripe-elemental
0
 /**
  * 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;
 }
Example #17
Show file File: SiteConfigExtension.php Project: helpfulrobot/olliepop-fbpagefeed
0
 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"));
 }
Example #18
Show file File: LatestTweetsWidget.php Project: helpfulrobot/micmania1-sstwitter
0
 public function getCMSFields()
 {
     $fields = new FieldList();
     $fields->push(TextField::create("TwitterHandle", "Twitter Handle"));
     $fields->push(NumericField::create("NumberOfTweets", "Number of Tweets"));
     return $fields;
 }
Example #19
Show file File: GalleryExtension.php Project: helpfulrobot/webfox-silverstripe-gallery
0
 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);
     }
 }
Example #20
Show file File: ConsultationFormField.php Project: dnadesign/silverstripe-consultations
0
 /**
  * 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);
     }
 }
Example #21
Show file File: PublishDateDataExtension.php Project: helpfulrobot/arillo-silverstripe-cleanutilities
0
 /**
  * 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');
 }
Example #22
Show file File: GoogleAuthenticatorLoginForm.php Project: helpfulrobot/xpointo-silverstripe-google-authenticator
0
 /**
  * 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);
 }
Example #23
Show file File: MembersOnlyPageExtension.php Project: helpfulrobot/titledk-silverstripe-memberpages
0
    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');
    }
Example #24
Show file File: HasRelatedProducts.php Project: helpfulrobot/markguinn-silverstripe-related-products
0
 /**
  * @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);
     }));
 }
Example #25
Show file File: CheckoutMemberExtension.php Project: i-lateral/silverstripe-checkout
0
 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;
 }
Example #26
Show file File: ChefProductForm.php Project: 8secs/cocina
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);
 }
Example #27
Show file File: ContactDetailsConfig.php Project: helpfulrobot/gdmedia-silverstripe-contact-details
0
 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"));
 }
Example #28
Show file File: TemplateOverrideExtension.php Project: helpfulrobot/weboftalent-template-override
0
 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);
 }
Example #29
Show file File: DebugTools_SiteConfigExtension.php Project: jaedb/dev-tools
0
 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');
 }
Example #30
Show file File: ConfigurablePageFieldGroupExtension.php Project: helpfulrobot/satrun77-configurablepage
0
 public function updateCMSFields(FieldList $fields)
 {
     // Remove Configurable Page Tab
     if (!$this->owner->ConfigurablePages) {
         $fields->removeByName('ConfigurablePages');
     }
 }
Frequently Used Methods