/**
  * @param FieldList $fields
  */
 public function updateCMSFields(FieldList $fields)
 {
     /** =========================================
          * @var TextareaField $address
          * @var TextareaField $postalAddress
          * @var TextField $mailChimpAPI
          * @var TextareaField $mailChimpSuccessMessage
         ===========================================*/
     if (!$fields->fieldByName('Root.Settings')) {
         $fields->addFieldToTab('Root', TabSet::create('Settings'));
     }
     /** -----------------------------------------
      * Details
      * ----------------------------------------*/
     $address = TextareaField::create('Address', 'Address');
     $address->setRows(8);
     $postalAddress = TextareaField::create('PostalAddress', 'Postal Address');
     $postalAddress->setRows(8);
     $fields->findOrMakeTab('Root.Settings.Details');
     $fields->addFieldsToTab('Root.Settings.Details', array(HeaderField::create('', 'Company Details'), Textfield::create('Phone', 'Phone Number'), Textfield::create('Email', 'Public Email Address'), $address, $postalAddress, TextField::create('Facebook', 'Facebook'), TextField::create('LinkedIn', 'LinkedIn'), TextField::create('Pinterest', 'Pinterest'), TextField::create('TwitterHandle', 'Twitter Handle')));
     /** -----------------------------------------
      * Subscription
      * ----------------------------------------*/
     $mailChimpAPI = TextField::create('MailChimpAPI', 'API Key');
     $mailChimpSuccessMessage = TextareaField::create('MailChimpSuccessMessage', 'Success Message (optional)');
     $mailChimpAPI->setRightTitle('<a href="https://us9.admin.mailchimp.com/account/api-key-popup/" target="_blank"><i>How do I get my MailChimp API Key?</i></a>');
     $mailChimpSuccessMessage->setRows(2)->setRightTitle('Message displayed when a user has successfully subscribed to a list.');
     $fields->findOrMakeTab('Root.Settings.Subscription', 'Subscription');
     $fields->addFieldsToTab('Root.Settings.Subscription', array(HeaderField::create('', 'Newsletter Subscription'), LiteralField::create('', '<p>The API key, and list ID are necessary for the Newsletter Subscription form to function.</p>'), $mailChimpAPI, TextField::create('MailChimpListID', 'List ID'), $mailChimpSuccessMessage));
 }
 public function updateCMSFields(FieldList $fields)
 {
     /* -----------------------------------------
         * Color Picker
        ------------------------------------------*/
     Requirements::css('boilerplate/css/colorpicker.css');
     Requirements::javascript('boilerplate/javascript/colorpicker.min.js');
     Requirements::javascript('boilerplate/javascript/colorpicker.init.js');
     /* =========================================
        * Settings
        =========================================*/
     if (!$fields->fieldByName('Root.Settings')) {
         $fields->addFieldToTab('Root', new TabSet('Settings'));
     }
     /* -----------------------------------------
         * Images
        ------------------------------------------*/
     $fields->findOrMakeTab('Root.Settings.Images', 'Images');
     $fields->addFieldsToTab('Root.Settings.Images', array($logo = new UploadField('LogoImage', _t('BoilerplateConfig.LogoImageLabel', 'Logo')), $favicon = new UploadField('Favicon', _t('BoilerplateConfig.FaviconLabel', 'Favicon'))));
     $logo->setRightTitle('Choose an Image For Your Logo');
     $favicon->setRightTitle('Choose an Image For Your Favicon (16x16)');
     /* -----------------------------------------
         * Company Details
        ------------------------------------------*/
     $fields->findOrMakeTab('Root.Settings.Details', 'Details');
     $fields->addFieldsToTab('Root.Settings.Details', array(new Textfield('Phone', _t('BoilerplateConfig.PhoneLabel', 'Phone Number')), new Textfield('Email', _t('BoilerplateConfig.EmailLabel', 'Public Email Address')), $PhysicalAddress = new HtmlEditorField('PhysicalAddress', _t('BoilerplateConfig.PhysicalAddressLabel', 'Physical Address'))));
     $PhysicalAddress->setRows(3);
     /* -----------------------------------------
         * Tracking Code
        ------------------------------------------*/
     $fields->findOrMakeTab('Root.Settings.TrackingCode', 'Tracking Code');
     $fields->addFieldsToTab('Root.Settings.TrackingCode', array($trackingCode = new TextareaField('TrackingCode', _t('BoilerplateConfig.TrackingCodeLabel', 'Tracking Code'))));
     $trackingCode->setRows(20);
 }
 public function getEditForm($id = null, $fields = null)
 {
     // TODO Duplicate record fetching (see parent implementation)
     if (!$id) {
         $id = $this->currentPageID();
     }
     $form = parent::getEditForm($id);
     // TODO Duplicate record fetching (see parent implementation)
     $record = $this->getRecord($id);
     if ($record && !$record->canView()) {
         return Security::permissionFailure($this);
     }
     $memberList = GridField::create('Members', false, Member::get(), $memberListConfig = GridFieldConfig_RecordEditor::create()->addComponent(new GridFieldButtonRow('after'))->addComponent(new GridFieldExportButton('buttons-after-left')))->addExtraClass("members_grid");
     if ($record && method_exists($record, 'getValidator')) {
         $validator = $record->getValidator();
     } else {
         $validator = Injector::inst()->get('Member')->getValidator();
     }
     $memberListConfig->getComponentByType('GridFieldDetailForm')->setValidator($validator);
     $groupList = GridField::create('Groups', false, Group::get(), GridFieldConfig_RecordEditor::create());
     $columns = $groupList->getConfig()->getComponentByType('GridFieldDataColumns');
     $columns->setDisplayFields(array('Breadcrumbs' => singleton('Group')->fieldLabel('Title')));
     $columns->setFieldFormatting(array('Breadcrumbs' => function ($val, $item) {
         return Convert::raw2xml($item->getBreadcrumbs(' > '));
     }));
     $fields = new FieldList($root = new TabSet('Root', $usersTab = new Tab('Users', _t('SecurityAdmin.Users', 'Users'), $memberList, new LiteralField('MembersCautionText', sprintf('<p class="caution-remove"><strong>%s</strong></p>', _t('SecurityAdmin.MemberListCaution', 'Caution: Removing members from this list will remove them from all groups and the' . ' database')))), $groupsTab = new Tab('Groups', singleton('Group')->i18n_plural_name(), $groupList)), new HiddenField('ID', false, 0));
     // Add import capabilities. Limit to admin since the import logic can affect assigned permissions
     if (Permission::check('ADMIN')) {
         $fields->addFieldsToTab('Root.Users', array(new HeaderField(_t('SecurityAdmin.IMPORTUSERS', 'Import users'), 3), new LiteralField('MemberImportFormIframe', sprintf('<iframe src="%s" id="MemberImportFormIframe" width="100%%" height="250px" frameBorder="0">' . '</iframe>', $this->Link('memberimport')))));
         $fields->addFieldsToTab('Root.Groups', array(new HeaderField(_t('SecurityAdmin.IMPORTGROUPS', 'Import groups'), 3), new LiteralField('GroupImportFormIframe', sprintf('<iframe src="%s" id="GroupImportFormIframe" width="100%%" height="250px" frameBorder="0">' . '</iframe>', $this->Link('groupimport')))));
     }
     // Tab nav in CMS is rendered through separate template
     $root->setTemplate('CMSTabSet');
     // Add roles editing interface
     if (Permission::check('APPLY_ROLES')) {
         $rolesField = GridField::create('Roles', false, PermissionRole::get(), GridFieldConfig_RecordEditor::create());
         $rolesTab = $fields->findOrMakeTab('Root.Roles', _t('SecurityAdmin.TABROLES', 'Roles'));
         $rolesTab->push($rolesField);
     }
     $actionParam = $this->getRequest()->param('Action');
     if ($actionParam == 'groups') {
         $groupsTab->addExtraClass('ui-state-active');
     } elseif ($actionParam == 'users') {
         $usersTab->addExtraClass('ui-state-active');
     } elseif ($actionParam == 'roles') {
         $rolesTab->addExtraClass('ui-state-active');
     }
     $actions = new FieldList();
     $form = Form::create($this, 'EditForm', $fields, $actions)->setHTMLID('Form_EditForm');
     $form->addExtraClass('cms-edit-form');
     $form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
     // Tab nav in CMS is rendered through separate template
     if ($form->Fields()->hasTabset()) {
         $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
     }
     $form->addExtraClass('center ss-tabset cms-tabset ' . $this->BaseCSSClasses());
     $form->setAttribute('data-pjax-fragment', 'CurrentForm');
     $this->extend('updateEditForm', $form);
     return $form;
 }
 /**
  * @param FieldList $fields
  */
 public function updateCMSFields(FieldList $fields)
 {
     Requirements::add_i18n_javascript(ADVANCED_WORKFLOW_DIR . '/javascript/lang');
     // Add timepicker functionality
     // @see https://github.com/trentrichardson/jQuery-Timepicker-Addon
     Requirements::css(ADVANCED_WORKFLOW_DIR . '/thirdparty/javascript/jquery-ui/timepicker/jquery-ui-timepicker-addon.css');
     Requirements::css(ADVANCED_WORKFLOW_DIR . '/css/WorkflowCMS.css');
     Requirements::javascript(ADVANCED_WORKFLOW_DIR . '/thirdparty/javascript/jquery-ui/timepicker/jquery-ui-sliderAccess.js');
     Requirements::javascript(ADVANCED_WORKFLOW_DIR . '/thirdparty/javascript/jquery-ui/timepicker/jquery-ui-timepicker-addon.js');
     Requirements::javascript(ADVANCED_WORKFLOW_DIR . '/javascript/WorkflowField.js');
     $this->setIsWorkflowInEffect();
     $fields->findOrMakeTab('Root.PublishingSchedule', _t('WorkflowEmbargoExpiryExtension.TabTitle', 'Publishing Schedule'));
     if ($this->getIsWorkflowInEffect()) {
         $fields->addFieldsToTab('Root.PublishingSchedule', array(HeaderField::create('PublishDateHeader', _t('WorkflowEmbargoExpiryExtension.REQUESTED_PUBLISH_DATE_H3', 'Expiry and Embargo'), 3), LiteralField::create('PublishDateIntro', $this->getIntroMessage('PublishDateIntro')), $dt = Datetimefield::create('DesiredPublishDate', _t('WorkflowEmbargoExpiryExtension.REQUESTED_PUBLISH_DATE', 'Requested publish date')), $ut = Datetimefield::create('DesiredUnPublishDate', _t('WorkflowEmbargoExpiryExtension.REQUESTED_UNPUBLISH_DATE', 'Requested un-publish date')), Datetimefield::create('PublishOnDate', _t('WorkflowEmbargoExpiryExtension.PUBLISH_ON', 'Scheduled publish date'))->setDisabled(true), Datetimefield::create('UnPublishOnDate', _t('WorkflowEmbargoExpiryExtension.UNPUBLISH_ON', 'Scheduled un-publish date'))->setDisabled(true)));
     } else {
         $fields->addFieldsToTab('Root.PublishingSchedule', array(HeaderField::create('PublishDateHeader', _t('WorkflowEmbargoExpiryExtension.REQUESTED_PUBLISH_DATE_H3', 'Expiry and Embargo'), 3), LiteralField::create('PublishDateIntro', $this->getIntroMessage('PublishDateIntro')), $dt = Datetimefield::create('PublishOnDate', _t('WorkflowEmbargoExpiryExtension.PUBLISH_ON', 'Scheduled publish date')), $ut = Datetimefield::create('UnPublishOnDate', _t('WorkflowEmbargoExpiryExtension.UNPUBLISH_ON', 'Scheduled un-publish date'))));
     }
     $dt->getDateField()->setConfig('showcalendar', true);
     $ut->getDateField()->setConfig('showcalendar', true);
     $dt->getTimeField()->setConfig('timeformat', 'HH:mm:ss');
     $ut->getTimeField()->setConfig('timeformat', 'HH:mm:ss');
     // Enable a jQuery-UI timepicker widget
     if (self::$showTimePicker) {
         $dt->getTimeField()->addExtraClass('hasTimePicker');
         $ut->getTimeField()->addExtraClass('hasTimePicker');
     }
 }
 /**
  * updateCMSFields.
  * Update Silverstripe CMS Fields for SEO Module
  *  	 
  * @param FieldList
  * @return none
  */
 public function updateCMSFields(FieldList $fields)
 {
     // exclude SEO tab from some pages
     if (in_array($this->owner->getClassName(), Config::inst()->get("SeoObjectExtension", "excluded_page_types"))) {
         return;
     }
     Requirements::css(SEO_DIR . '/css/seo.css');
     Requirements::javascript(SEO_DIR . '/javascript/seo.js');
     // better do this below in some init method? :
     $this->getSEOScoreCalculation();
     $this->setSEOScoreTipsUL();
     // lets create a new tab on top
     $fields->addFieldsToTab('Root.SEO', array(LiteralField::create('googlesearchsnippetintro', '<h3>' . _t('SEO.SEOGoogleSearchPreviewTitle', 'Preview google search') . '</h3>'), LiteralField::create('googlesearchsnippet', '<div id="google_search_snippet"></div>'), LiteralField::create('siteconfigtitle', '<div id="ss_siteconfig_title">' . $this->owner->getSiteConfig()->Title . '</div>')));
     // move Metadata field from Root.Main to SEO tab for visualising direct impact on search result
     $fields->removeFieldFromTab('Root.Main', 'Metadata');
     /*$fields->addFieldToTab("Root.SEO", new TabSet('Options', 
     			new Tab('Metadata', _t('SEO.SEOMetaData', 'Meta Data')), 
     			new Tab('HelpAndSEOScore',  _t('SEO.SEOHelpAndScore', 'Help and SEO Score'))   
     		));*/
     $fields->addFieldsToTab('Root.SEO', array(TextareaField::create("MetaDescription", $this->owner->fieldLabel('MetaDescription'))->setRightTitle(_t('SiteTree.METADESCHELP', "Search engines use this content for displaying search results (although it will not influence their ranking)."))->addExtraClass('help'), TextareaField::create("ExtraMeta", $this->owner->fieldLabel('ExtraMeta'))->setRightTitle(_t('SiteTree.METAEXTRAHELP', "HTML tags for additional meta information. For example &lt;meta name=\"customName\" content=\"your custom content here\" /&gt;"))->addExtraClass('help')));
     $fields->addFieldsToTab('Root.SEO', array(GoogleSuggestField::create("SEOPageSubject", _t('SEO.SEOPageSubjectTitle', 'Subject of this page (required to view this page SEO score)')), LiteralField::create('', '<div class="message notice"><p>' . _t('SEO.SEOSaveNotice', "After making changes save this page to view the updated SEO score") . '</p></div>'), LiteralField::create('ScoreTitle', '<h4 class="seo_score">' . _t('SEO.SEOScore', 'SEO Score') . '</h4>'), LiteralField::create('Score', $this->getHTMLStars()), LiteralField::create('ScoreClear', '<div class="score_clear"></div>')));
     if ($this->checkPageSubjectDefined()) {
         $fields->addFieldsToTab('Root.SEO', array(LiteralField::create('SimplePageSubjectCheckValues', $this->getHTMLSimplePageSubjectTest())));
     }
     if ($this->seo_score < 12) {
         $fields->addFieldsToTab('Root.SEO', array(LiteralField::create('ScoreTipsTitle', '<h4 class="seo_score">' . _t('SEO.SEOScoreTips', 'SEO Score Tips') . '</h4>'), LiteralField::create('ScoreTips', $this->seo_score_tips)));
     }
 }
 public function updateCMSFields(FieldList $fields)
 {
     // vars
     $config = SiteConfig::current_site_config();
     $owner = $this->owner;
     // decode data into array
     $data = json_decode($owner->OpenGraphData, true);
     // @todo Add repair method if data is missing / corrupt ~ for fringe cases
     // tab
     $tab = new Tab('OpenGraph');
     // add disabled/error state if `off`
     if ($data['og:type'] === 'off') {
         $tab->addExtraClass('error');
     }
     // add the tab
     $fields->addFieldToTab('Root.Metadata', $tab, 'FullOutput');
     // new identity
     $tab = 'Root.Metadata.OpenGraph';
     // add description
     // type always visible
     $fields->addFieldsToTab($tab, array(LabelField::create('OpenGraphHeader', '@todo Information</a>')->addExtraClass('information'), DropdownField::create('OpenGraphType', '<a href="http://ogp.me/#types">og:type</a>', self::$types, $data['og:type'])));
     if ($data['og:type'] !== 'off') {
         $fields->addFieldsToTab($tab, array(ReadonlyField::create('OpenGraphURL', 'Canonical URL', $owner->AbsoluteLink()), TextField::create('OpenGraphSiteName', 'Site Name', $data['og:site_name'])->setAttribute('placeholder', $config->Title), TextField::create('OpenGraphTitle', 'Page Title', $data['og:title'])->setAttribute('placeholder', $owner->Title), TextareaField::create('OpenGraphDescription', 'Description', $data['og:description'])->setAttribute('placeholder', $owner->GenerateDescription()), UploadField::create('OpenGraphImage', 'Image<pre>type: png/jpg/gif</pre><pre>size: variable *</pre>', $owner->OpenGraphImage)->setAllowedExtensions(array('png', 'jpg', 'jpeg', 'gif'))->setFolderName(self::$SEOOpenGraphUpload . $owner->Title)->setDescription('* <a href="https://developers.facebook.com/docs/sharing/best-practices#images" target="_blank">Facebook image best practices</a>, or use any preferred Open Graph guide.')));
     }
 }
 public function updateCMSFields(FieldList $fields)
 {
     $type = new DropdownField('EventType', _t('ScoutDistrict.Events.TYPE', 'Type'), array('section-meeting' => _t('ScoutDistrict.Enum.SECTIONMEETING', 'Section Meeting'), 'leaders-meeting' => _t('ScoutDistrict.Enum.LEADERSMEETING', 'Leaders Meeting'), 'activity' => _t('ScoutDistrict.Enum.ACTIVITY', 'Activity'), 'fundraising' => _t('ScoutDistrict.Enum.FUNDRAISING', 'Fundraising'), 'committee' => _t('ScoutDistrict.Enum.COMMITTEE', 'Committee'), 'camp' => _t('ScoutDistrict.Enum.CAMP', 'Camp'), 'group' => _t('ScoutDistrict.Enum.GROUP', 'Group'), 'district' => _t('ScoutDistrict.Enum.DISTRICT', 'District'), 'training' => _t('ScoutDistrict.Enum.TRAINING', 'Training'), 'other' => _t('ScoutDistrict.Enum.OTHER', 'Other')));
     $type->setRightTitle(_t('ScoutDistrict.Events.TYPE_HELP', 'What Type of event is this'))->addExtraClass('help');
     $location = new TextField('EventLocation', _t('ScoutDistrict.Events.LOCATION', 'Location'));
     $location->setRightTitle(_t('ScoutDistrict.Events.LOCATION_HELP', 'Where is the event being held'))->addExtraClass('help');
     $latitude = new TextField('EventLatitude', _t('ScoutDistrict.Events.LATITUDE', 'Latitude'));
     $latitude->setRightTitle(_t('ScoutDistrict.Events.LATITUDE_HELP', 'Latitude of event Location'))->addExtraClass('help');
     $longitude = new TextField('EventLongitude', _t('ScoutDistrict.Events.LONGITUDE', 'Longitude'));
     $longitude->setRightTitle(_t('ScoutDistrict.Events.LONGITUDE_HELP', 'Longitude of event Location'))->addExtraClass('help');
     $bookingDetails = new TextareaField('EventBookingDetails', _t('ScoutDistrict.Events.BOOKINGDETAILS', 'Booking Details'));
     $bookingDetails->setRightTitle(_t('ScoutDistrict.Events.BOOKINGDETAILS_HELP', 'Details of how to book a place for the Event'))->addExtraClass('help');
     $bookingURL = new TextField('EventBookingURL', _t('ScoutDistrict.Events.BOOKINGURL', 'Booking URL'));
     $bookingURL->setRightTitle(_t('ScoutDistrict.Events.BOOKINGURL_HELP', 'The URL of an external site to book a place'))->addExtraClass('help');
     $fields->addFieldsToTab('Root.Scouts', array($type, $location, $latitude, $longitude, $bookingDetails, $bookingURL));
     $thumbnail = new UploadField('ThumbnailImage', _t('ScoutDistrict.Events.THUMBNAIL', 'Thumbnail Image'));
     $thumbnail->setFolderName('event/thumbnail');
     $thumbnail->setRightTitle(_t('ScoutDistrict.Events.THUMBNAIL_HELP', 'A small image for displaying in listing/aggregated content'))->addExtraClass('help');
     $image = new UploadField('Image', _t('ScoutDistrict.Events.IMAGE', 'Image'));
     $image->setFolderName('event/image');
     $image->setRightTitle(_t('ScoutDistrict.Events.IMAGE_HELP', 'A Larger image for displaying in event header'))->addExtraClass('help');
     $files = new UploadField('Files', _t('ScoutDistrict.Events.FILE', 'Files'));
     $files->setFolderName('event/file');
     $files->setRightTitle(_t('ScoutDistrict.Events.FILE_HELP', 'This can be a file containing information about the event or an application form, etc'))->addExtraClass('help');
     $fields->addFieldsToTab('Root.Files', array($thumbnail, $image, $files));
     return $fields;
 }
 public function updateCMSFields(FieldList $fields)
 {
     $redirectUrl = HailProvider::getRedirectUri();
     $redirectField = new ReadonlyField('RedirectURL', 'Redirect URL', $redirectUrl);
     // Twitter setup
     $fields->addFieldsToTab('Root.Hail', array(new TextField('HailClientID', 'Client ID', null, 255), new TextField('HailClientSecret', 'Client Secret', null, 255), $redirectField));
     $siteconfig = SiteConfig::current_site_config();
     if (HailProvider::isReadyToAuthorised()) {
         $provider = new HailProvider();
         $link = HailProvider::isAuthorised() ? 'Reauthorise SilverStripe to Access Hail' : 'Authorise SilverStripe to Access Hail';
         $auth = $provider->getAuthorizationUrl();
         $fields->addFieldsToTab('Root.Hail', new LiteralField('Go', "<a href='{$auth}'>{$link}</a>"));
     }
     try {
         if (HailProvider::isAuthorised()) {
             $orgs = HailApi::getOrganisationList();
             $orgs[''] = '';
             $orgField = DropdownField::create('HailOrgID', 'Hail Organisation', $orgs);
             $fields->addFieldsToTab('Root.Hail', $orgField);
         }
     } catch (HailApiException $ex) {
         $fields->addFieldsToTab('Root.Hail', new LiteralField('Retry', 'You Have to Re-Authorise SilverStripe to Access Hail'));
     }
     $holderField = DropdownField::create('PrimaryHailHolderID', 'Primary Hail Holder', HailHolder::get()->map('ID', 'Title'));
     $holderField->setEmptyString('(None)');
     $fields->addFieldsToTab('Root.Hail', $holderField);
 }
 function getCMSFields()
 {
     $CountryCodes = CountryCodes::$iso_3166_countryCodes;
     $CountryCodes['Worldwide'] = 'Worldwide';
     $CountryCodes['Prefer not to say'] = 'Prefer not to say';
     $CountryCodes['Too many to list'] = 'Too many to list';
     $fields = new FieldList($rootTab = new TabSet("Root"));
     $fields->addFieldsToTab('Root.Main', array(new LiteralField('Break', '<p>Each deployment profile can be marked public if you wish for the basic information on this page to appear on openstack.org. If you select private we will treat all of the profile information as confidential information.</p>'), new OptionSetField('IsPublic', 'Would you like to keep this information confidential or allow the Foundation to share information about this deployment publicly?', array('1' => '<strong>Willing to share:</strong> The information on this page may be shared for this deployment', '0' => '<strong>Confidential:</strong> All details provided should be kept confidential to the OpenStack Foundation'), 0), new LiteralField('Break', '<hr/>'), new TextField('Label', 'Deployment Name<BR><p class="clean_text">Please create a friendly label, like “Production OpenStack Deployment”. This name is for your deployment in our survey tool. If several people at your organization work on one deployment, we would <b>really appreciate</b> you all referring to the same deployment by the same name!</p>'), $ddl_stage = new DropdownField('DeploymentStage', 'In what stage is your OpenStack deployment? (make a new deployment profile for each type of deployment)', DeploymentOptions::$stage_options), new MultiDropdownField('CountriesPhysicalLocation', 'In which country / countries is this OpenStack deployment physically located?', $CountryCodes), new MultiDropdownField('CountriesUsersLocation', 'In which country / countries are the users / customers for this deployment physically located?', $CountryCodes), $ddl_type = new DropdownField('DeploymentType', 'Deployment Type', DeploymentOptions::$deployment_type_options), new CustomCheckboxSetField('ProjectsUsed', 'Projects Used', DeploymentOptions::$projects_used_options), new CustomCheckboxSetField('CurrentReleases', 'What releases are you currently using?', DeploymentOptions::$current_release_options), new LiteralField('Break', 'Describe the workloads and frameworks running in this OpenStack environment.<BR>Select All That Apply'), new LiteralField('Break', '<hr/>'), new CustomCheckboxSetField('ServicesDeploymentsWorkloads', '<b>Services Deployments - workloads designed to be accessible for external users / customers</b>', DeploymentOptions::$services_deployment_workloads_options), $other_service_workload = new TextAreaField('OtherServicesDeploymentsWorkloads', ''), new CustomCheckboxSetField('EnterpriseDeploymentsWorkloads', '<b>Enterprise Deployments - workloads designed to be run internally to support business</b>', DeploymentOptions::$enterprise_deployment_workloads_options), $other_enterprise_workload = new TextAreaField('OtherEnterpriseDeploymentsWorkloads', ''), new CustomCheckboxSetField('HorizontalWorkloadFrameworks', '<b>Horizontal Workload Frameworks</b>', DeploymentOptions::$horizontal_workload_framework_options), $other_horizontal_workload = new TextAreaField('OtherHorizontalWorkloadFrameworks', '')));
     $ddl_type->setEmptyString('-- Select One --');
     $ddl_stage->setEmptyString('-- Select One --');
     $details = array(new LiteralField('Break', '<p>The information below will help us better understand the most common configuration and component choices OpenStack deployments are using.</p>'), new LiteralField('Break', '<h3>Telemetry</h3>'), new LiteralField('Break', '<hr/>'), new LiteralField('Break', '<p>Please provide the following information about the size and scale of this OpenStack deployment. This information is optional, but will be kept confidential and <b>never</b> published in connection with you or your organization.</p>'), new DropdownField('OperatingSystems', 'What is the main operating system running this OpenStack cloud deployment?', ArrayUtils::AlphaSort(DeploymentOptions::$operating_systems_options, array('' => '-- Select One --'), array('Other' => 'Other (please specify)'))), $other_os = new TextareaField('OtherOperatingSystems', ''), new CustomCheckboxSetField('UsedPackages', 'What packages does this deployment use…?<BR>Select All That Apply', DeploymentOptions::$used_packages_options), new CustomCheckboxSetField('CustomPackagesReason', 'If you have modified packages or have built your own packages, why?<BR>Select All That Apply', DeploymentOptions::$custom_package_reason_options), $other_custom_reason = new TextareaField('OtherCustomPackagesReason', ''), new CustomCheckboxSetField('DeploymentTools', 'What tools are you using to deploy / configure this cluster?<BR>Select All That Apply', DeploymentOptions::$deployment_tools_options), $other_deployment_tools = new TextareaField('OtherDeploymentTools', ''), new CustomCheckboxSetField('PaasTools', 'What Platform-as-a-Service (PaaS) tools are you using to manage applications on this OpenStack deployment?', ArrayUtils::AlphaSort(DeploymentOptions::$paas_tools_options, array('' => '-- Select One --'), array('Other' => 'Other Tool (please specify)'))), $other_paas = new TextareaField('OtherPaasTools', ''), new CustomCheckboxSetField('Hypervisors', 'If this deployment uses <b>OpenStack Compute (Nova)</b>, which hypervisors are you using?<BR>Select All That Apply', DeploymentOptions::$hypervisors_options), new TextareaField('OtherHypervisor', ''), new CustomCheckboxSetField('SupportedFeatures', 'Which compatibility APIs does this deployment support?<BR> Select All That Apply', DeploymentOptions::$deployment_features_options), new TextareaField('OtherSupportedFeatures', ''), new CustomCheckboxSetField('UsedDBForOpenStackComponents', 'What database do you use for the components of this OpenStack cloud?<BR>Select All That Apply', DeploymentOptions::$used_db_for_openstack_components_options), new TextareaField('OtherUsedDBForOpenStackComponents', ''), new CustomCheckboxSetField('NetworkDrivers', ' If this deployment uses <b>OpenStack Network (Neutron)</b>, which drivers are you using?<BR>Select All That Apply', DeploymentOptions::$network_driver_options), new TextareaField('OtherNetworkDriver', ''), new CustomCheckboxSetField('IdentityDrivers', 'If you are using <b>OpenStack Identity Service (Keystone)</b> which OpenStack identity drivers are you using?<BR>Select All That Apply', DeploymentOptions::$identity_driver_options), new TextareaField('OtherIndentityDriver', ''), new CustomCheckboxSetField('BlockStorageDrivers', 'If this deployment uses <b>OpenStack Block Storage (Cinder)</b>, which drivers are <BR>Select All That Apply', DeploymentOptions::$block_storage_divers_options), new TextareaField('OtherBlockStorageDriver', ''), new CustomCheckboxSetField('InteractingClouds', 'With what other clouds does this OpenStack deployment interact?<BR>Select All That Apply', DeploymentOptions::$interacting_clouds_options), new TextareaField('OtherInteractingClouds', ''), $ddl_users = new DropdownField('NumCloudUsers', 'Number of users', DeploymentOptions::$cloud_users_options), $ddl_nodes = new DropdownField('ComputeNodes', 'Physical compute nodes', DeploymentOptions::$compute_nodes_options), $ddl_cores = new DropdownField('ComputeCores', 'Processor cores', DeploymentOptions::$compute_cores_options), $ddl_instances = new DropdownField('ComputeInstances', 'Number of instances', DeploymentOptions::$compute_instances_options), $ddl_ips = new DropdownField('NetworkNumIPs', 'Number of fixed / floating IPs', DeploymentOptions::$network_ip_options), $ddl_block_size = new DropdownField('BlockStorageTotalSize', 'If this deployment uses <b>OpenStack Block Storage (Cinder)</b>, what is the size of its block storage?', DeploymentOptions::$storage_size_options), $ddl_block_size = new DropdownField('ObjectStorageSize', 'If this deployment uses <b>OpenStack Object Storage (Swift)</b>, what is the size of its block storage?', DeploymentOptions::$storage_size_options), $ddl_objects_size = new DropdownField('ObjectStorageNumObjects', 'If this deployment uses <b>OpenStack Object Storage (Swift)</b>, how many total objects are stored?', DeploymentOptions::$storage_objects_options), new LiteralField('Break', '<h3>Spotlight</h3>'), new LiteralField('Break', '<hr/>'), new CustomCheckboxSetField('WhyNovaNetwork', 'If this deployment uses nova-network and not OpenStack Network (Neutron), what would allow you to migrate to Neutron?', DeploymentOptions::$why_nova_network_options), $other_why_nova = new TextareaField('OtherWhyNovaNetwork', ''), $ddl_swift_dist_feat = new DropdownField('SwiftGlobalDistributionFeatures', 'Are you using Swift\'s global distribution features?', DeploymentOptions::$swift_global_distribution_features_options), $ddl_uses_cases = new DropdownField('SwiftGlobalDistributionFeaturesUsesCases', 'If yes, what is your use case?', DeploymentOptions::$swift_global_distribution_features_uses_cases_options), $other_uses_cases = new TextareaField('OtherSwiftGlobalDistributionFeaturesUsesCases', ''), $ddl_policies = new DropdownField('Plans2UseSwiftStoragePolicies', 'Do you have plans to use Swift\'s storage policies or erasure codes in the next year?', DeploymentOptions::$plans_2_use_swift_storage_policies_options), new TextareaField('OtherPlans2UseSwiftStoragePolicies', ''), $ddl_other_tools = new DropdownField('ToolsUsedForYourUsers', 'What tools are you using charging or show-back for your users?', DeploymentOptions::$tools_used_for_your_users_options), $other_tools = new TextareaField('OtherToolsUsedForYourUsers', ''), new TextareaField('Reason2Move2Ceilometer', 'If you are not using Ceilometer, what would allow you to move to it (optional free text)?'));
     $ddl_users->setEmptyString('-- Select One --');
     $ddl_nodes->setEmptyString('-- Select One --');
     $ddl_cores->setEmptyString('-- Select One --');
     $ddl_instances->setEmptyString('-- Select One --');
     $ddl_ips->setEmptyString('-- Select One --');
     $ddl_block_size->setEmptyString('-- Select One --');
     $ddl_block_size->setEmptyString('-- Select One --');
     $ddl_objects_size->setEmptyString('-- Select One --');
     $ddl_swift_dist_feat->setEmptyString('-- Select One --');
     $ddl_uses_cases->setEmptyString('-- Select One --');
     $ddl_policies->setEmptyString('-- Select One --');
     $ddl_other_tools->setEmptyString('-- Select One --');
     $fields->addFieldsToTab('Root.Details', $details);
     return $fields;
 }
 public function updateCMSFields(FieldList $fields)
 {
     $fields->removeByName('Theme');
     $fields->addFieldsToTab('Root.Main', array(TextField::create('Email', 'Email Address')->setAttribute("placeholder", "*****@*****.**"), TextField::create('Phone', 'Phone Number'), TextField::create('FreePhone', 'Free Phone Number'), TextField::create('Mobile', 'Mobile Number'), TextField::create('Fax', 'Fax Number'), TextField::create('FacebookURL', 'Facebook URL')->setAttribute("placeholder", "http://www.facebook.com"), TextField::create('TwitterURL', 'Twitter URL')->setAttribute("placeholder", "http://www.twitter.com"), TextField::create('PinterestURL', 'Pinterest URL')->setAttribute("placeholder", "http://www.pinterest.com"), TextField::create('InstagramURL', 'Instagram URL')->setAttribute("placeholder", "http://www.instagram.com"), TextField::create('LinkedInURL', 'LinkedIn URL')->setAttribute("placeholder", "http://www.linkedin.com"), TextField::create('YoutubeURL', 'Youtube URL')->setAttribute("placeholder", "http://www.youtube.com"), TextareaField::create('PostalAddress', 'Postal Address')->setRows(4), TextareaField::create('PhysicalAddress', 'Physical Address')->setRows(4)));
     $fields->addFieldsToTab('Root.Plato', array(TextField::create('GoogleTagManager', 'Enter the Tag Manager ID')));
     return $fields;
 }
 public function updateCMSFields(\FieldList $oFields)
 {
     Folder::find_or_make('responsive-gallery');
     $aGalleryImagesFields = array();
     if ($this->owner->ID > 0) {
         $oFields->addFieldsToTab('Root.' . _t('ResponsiveGalleryExtension.GALLERYIMAGES_TAB', 'Gallery Images'), $this->getFieldsForImagesTab());
         $oFields->addFieldsToTab('Root.' . _t('ResponsiveGalleryExtension.GALLERYSETTINGS_TAB', 'Gallery Settings'), $this->getFieldsForSettingsTab());
     }
 }
 public function updateCMSFields(FieldList $fields)
 {
     // Remove framework default metadata group
     $fields->removeByName(array('Metadata'));
     // Add SEO
     $fields->addFieldsToTab('Root.Metadata.SEO', $this->owner->getSEOFields());
     // Add full output
     $fields->addFieldsToTab('Root.Metadata.FullOutput', $this->owner->getFullOutput());
 }
 public function updateCMSFields(FieldList $fields)
 {
     // variables
     $config = SiteConfig::current_site_config();
     $self = $this->owner;
     // SSSEO Tabset
     $fields->addFieldToTab('Root', new TabSet('SSSEO'));
     // remove
     $fields->removeByName(array('Metadata'));
     //// Full Output
     $tab = 'Root.SSSEO.FullOutput';
     if ($self->hasExtension('SSSEO_SchemaDotOrg_SiteTree_DataExtension')) {
         if ($head = $self->Metahead()) {
             $fields->addFieldsToTab($tab, array(LiteralField::create('HeaderMetahead', '<pre class="bold">$Metahead()</pre>'), LiteralField::create('LiteralMetahead', '<pre><span style="background-color: white;">' . htmlentities($head) . '</span></pre>')));
         }
     }
     $fields->addFieldsToTab($tab, array(LiteralField::create('HeaderMetadata', '<pre class="bold">$Metadata()</pre>'), LiteralField::create('LiteralMetadata', '<pre>' . nl2br(htmlentities(trim($self->Metadata()), ENT_QUOTES)) . '</pre>')));
     //// Metadata
     $tab = 'Root.SSSEO.Metadata';
     // Canonical
     if ($config->CanonicalEnabled()) {
         $fields->addFieldsToTab($tab, array(ReadonlyField::create('ReadonlyMetaCanonical', 'link rel="canonical"', $self->AbsoluteLink())));
     }
     // Title
     if ($config->TitleEnabled()) {
         $fields->addFieldsToTab($tab, array(TextField::create('MetaTitle', 'meta title')->setAttribute('placeholder', $self->GenerateTitle())));
     }
     // Description
     $fields->addFieldsToTab($tab, array(TextareaField::create('MetaDescription', 'meta description')->setAttribute('placeholder', $self->GenerateDescriptionFromContent())));
     // ExtraMeta
     if ($config->ExtraMetaEnabled()) {
         $fields->addFieldsToTab($tab, array(TextareaField::create('ExtraMeta', 'Custom Metadata')));
     }
     //// Open Graph
     if ($config->OpenGraphEnabled()) {
         $tab = 'Root.SSSEO.OpenGraph';
         $fields->addFieldsToTab($tab, array());
     }
     //// Twitter Cards
     if ($config->TwitterCardsEnabled()) {
         $tab = 'Root.SSSEO.TwitterCards';
         $fields->addFieldsToTab($tab, array());
     }
     //// Schema.org
     if ($config->SchemaDotOrgEnabled()) {
         $tab = 'Root.SSSEO.SchemaDotOrg';
         $fields->addFieldsToTab($tab, array());
     }
     //// Authorship
     // Authors
     if ($config->AuthorshipEnabled()) {
         $tab = 'Root.SSSEO.Authors';
         $fields->addFieldsToTab($tab, array(GridField::create('Authors', 'Authors', $self->Authors())->setConfig(GridFieldConfig_RelationEditor::create())));
     }
 }
 public function updateCMSFields(FieldList $fields)
 {
     $tab = 'Root.SEO';
     // Profile ID
     $fields->addFieldsToTab($tab, array(TextField::create('FacebookProfileID', 'Facebook Profile ID'), TextField::create('GoogleProfileID', 'Google+ Profile ID')));
     // Pages Authored
     // remove
     $fields->removeByName(array('Authored'));
     // add
     $fields->addFieldsToTab($tab, array(GridField::create('Authored', 'Pages Authored', $this->owner->Authored())->setConfig(GridFieldConfig_RelationEditor::create())));
 }
 /**
  * @param FieldSet $fields
  */
 public function updateCMSFields(FieldList $fields)
 {
     $fields->findOrMakeTab('Root.Schedule', _t('ScheduledExecution.ScheduleTabTitle', 'Schedule'));
     $fields->addFieldsToTab('Root.Schedule', array($dt = new Datetimefield('FirstExecution', _t('ScheduledExecution.FIRST_EXECUTION', 'First Execution')), FieldGroup::create(new NumericField('ExecuteInterval', ''), new DropdownField('ExecuteEvery', '', array('' => '', 'Minute' => _t('ScheduledExecution.ExecuteEveryMinute', 'Minute'), 'Hour' => _t('ScheduledExecution.ExecuteEveryHour', 'Hour'), 'Day' => _t('ScheduledExecution.ExecuteEveryDay', 'Day'), 'Week' => _t('ScheduledExecution.ExecuteEveryWeek', 'Week'), 'Fortnight' => _t('ScheduledExecution.ExecuteEveryFortnight', 'Fortnight'), 'Month' => _t('ScheduledExecution.ExecuteEveryMonth', 'Month'), 'Year' => _t('ScheduledExecution.ExecuteEveryYear', 'Year'))))->setTitle(_t('ScheduledExecution.EXECUTE_EVERY', 'Execute every')), new TextField('ExecuteFree', _t('ScheduledExecution.EXECUTE_FREE', 'Scheduled (in strtotime format from first execution)'))));
     if ($this->owner->ScheduledJobID) {
         $jobTime = $this->owner->ScheduledJob()->StartAfter;
         $fields->addFieldsToTab('Root.Schedule', array(new ReadonlyField('NextRunDate', _t('ScheduledExecution.NEXT_RUN_DATE', 'Next run date'), $jobTime)));
     }
     $dt->getDateField()->setConfig('showcalendar', true);
     $dt->getTimeField()->setConfig('showdropdown', true);
 }
 public function updateCMSFields(FieldList $fields)
 {
     if ($themeField = $fields->fieldByName('Root.Main.Theme')) {
         $fields->removeFieldFromTab('Root.Main', 'Theme');
         $fields->addFieldToTab('Root.Appearance.Main', $themeField);
     }
     $fields->addFieldsToTab('Root.Appearance.Main', array(UploadField::create('Logo', 'Logo')->setDescription('Upload the site logo')));
     // Navigation
     $fields->addFieldsToTab('Root.Appearance.Navigation', array(DropdownField::create('NavgationLevel', 'Max navigation level', array(0 => 'Infinite', 1 => '1', 2 => '2', 3 => '3', 4 => '4', 5 => '5', 6 => '6', 7 => '7', 8 => '8', 9 => '9'))));
     return $fields;
 }
 /**
  * Updates the CMS fields of the extended object.
  *
  * @param FieldList $fields
  */
 public function updateCMSFields(FieldList $fields)
 {
     // Create Moderno Tab Set:
     $fields->addFieldToTab('Root', TabSet::create('Moderno', _t('ModernoConfigExtension.MODERNO', 'Moderno')));
     // Create Colors Tab:
     $fields->findOrMakeTab('Root.Moderno.Colors', _t('ModernoConfigExtension.COLORS', 'Colors'));
     // Create Colors Fields:
     $fields->addFieldsToTab('Root.Moderno.Colors', array(ColorField::create('ModernoHighlightColor', _t('ModernoConfigExtension.HIGHLIGHTCOLOR', 'Highlight color')), ColorField::create('ModernoLogoBkgColor', _t('ModernoConfigExtension.LOGOBACKGROUNDCOLOR', 'Logo background color')), ColorField::create('ModernoLinkColor', _t('ModernoConfigExtension.LINKCOLOR', 'Link color')), ColorField::create('ModernoProfileLinkColor', _t('ModernoConfigExtension.PROFILELINKCOLOR', 'Profile link color'))));
     // Create Branding Tab:
     $fields->findOrMakeTab('Root.Moderno.Branding', _t('ModernoConfigExtension.BRANDING', 'Branding'));
     // Create Branding Fields:
     $fields->addFieldsToTab('Root.Moderno.Branding', array(TextField::create('ModernoApplicationName', _t('ModernoConfigExtension.APPLICATIONNAME', 'Application name')), TextField::create('ModernoApplicationLink', _t('ModernoConfigExtension.APPLICATIONLINK', 'Application link')), ToggleCompositeField::create('ModernoLogoToggle', _t('ModernoConfigExtension.LOGOIMAGETOGGLETITLE', 'Logo Image'), array(UploadField::create('ModernoLogoImage', _t('ModernoConfigExtension.LOGOIMAGE', 'Logo image'))->setAllowedFileCategories('image')->setFolderName(self::get_asset_path()), FieldGroup::create(_t('ModernoConfigExtension.DIMENSIONSINPIXELS', 'Dimensions (in pixels)'), array(TextField::create('ModernoLogoImageWidth', '')->setAttribute('placeholder', _t('ModernoConfigExtension.WIDTH', 'Width')), LiteralField::create('ModernoLogoImageBy', '<i class="fa fa-times by"></i>'), TextField::create('ModernoLogoImageHeight', '')->setAttribute('placeholder', _t('ModernoConfigExtension.HEIGHT', 'Height')))), DropdownField::create('ModernoLogoImageResize', _t('ModernoConfigExtension.RESIZEMETHOD', 'Resize method'), self::get_resize_methods())->setEmptyString(' '), CheckboxField::create('ModernoHideSiteName', _t('ModernoConfigExtension.HIDESITENAME', 'Hide site name')), CheckboxField::create('ModernoSupportRetina', _t('ModernoConfigExtension.SUPPORTRETINADEVICES', 'Support Retina devices')))), ToggleCompositeField::create('ModernoLoadingToggle', _t('ModernoConfigExtension.LOADINGIMAGETOGGLETITLE', 'Loading Image'), array(UploadField::create('ModernoLoadingImage', _t('ModernoConfigExtension.LOADINGIMAGE', 'Loading image'))->setAllowedFileCategories('image')->setFolderName(self::get_asset_path()), FieldGroup::create(_t('ModernoConfigExtension.DIMENSIONSINPIXELS', 'Dimensions (in pixels)'), array(TextField::create('ModernoLoadingImageWidth', '')->setAttribute('placeholder', _t('ModernoConfigExtension.WIDTH', 'Width')), LiteralField::create('ModernoLoadingImageBy', '<i class="fa fa-times by"></i>'), TextField::create('ModernoLoadingImageHeight', '')->setAttribute('placeholder', _t('ModernoConfigExtension.HEIGHT', 'Height')))), DropdownField::create('ModernoLoadingImageResize', _t('ModernoConfigExtension.RESIZEMETHOD', 'Resize method'), self::get_resize_methods())->setEmptyString(' ')))));
 }
 /**
  *
  * @param FieldSet $fields
  */
 public function updateCMSFields(FieldList $fields)
 {
     if (class_exists('AbstractQueuedJob')) {
         $fields->addFieldsToTab('Root.Schedule', array(new TextField('ScheduledTitle', _t('AdvancedReport.SCHEDULED_TITLE', 'Title for scheduled report')), $dt = new Datetimefield('FirstGeneration', _t('AdvancedReport.FIRST_GENERATION', 'First generation')), new DropdownField('RegenerateEvery', _t('AdvancedReport.REGENERATE_EVERY', 'Regenerate every'), $this->owner->dbObject('RegenerateEvery')->enumValues()), new TextField('RegenerateFree', _t('AdvancedReport.REGENERATE_FREE', 'Scheduled (in strtotime format from first generation)')), new TextField('SendReportTo', _t('AdvancedReport.SEND_TO', 'Send to email addresses'))));
         if ($this->owner->ScheduledJobID) {
             $jobTime = $this->owner->ScheduledJob()->StartAfter;
             $fields->addFieldsToTab('Root.Schedule', array(new ReadonlyField('NextRunDate', _t('AdvancedReport.NEXT_RUN_DATE', 'Next run date'), $jobTime)));
         }
         $dt->getDateField()->setConfig('showcalendar', true);
         $dt->getTimeField()->setConfig('showdropdown', true);
     } else {
         $fields->addFieldToTab('Root.Schedule', new LiteralField('WARNING', 'You must install the Queued Jobs module to schedule reports'));
     }
 }
 public function getCMSFields()
 {
     $fields = new FieldList();
     $fields->push(new TabSet("Root", $mainTab = new Tab("Main")));
     $mainTab->setTitle(_t('SiteTree.TABMAIN', "Main"));
     $fields->addFieldToTab('Root.Main', new TextField('Email', $this->fieldLabel('Email')));
     $fields->addFieldsToTab('Root.Main', array(Object::create('TextField', 'Salutation', $this->fieldLabel('Salutation')), Object::create('TextField', 'FirstName', $this->fieldLabel('First Name')), Object::create('TextField', 'MiddleName', $this->fieldLabel('Middle Name')), Object::create('TextField', 'Surname', $this->fieldLabel('Surname'))));
     if (!empty($this->ID)) {
         $fields->addFieldToTab('Root.Main', Object::create('CheckboxSetField', 'MailingLists', $this->fieldLabel('MailingLists'), MailingList::get()->map('ID', 'FullTitle')));
     }
     $fields->addFieldsToTab('Root.Main', array(Object::create('ReadonlyField', 'BouncedCount', $this->fieldLabel('BouncedCount')), Object::create('CheckboxField', 'Verified', $this->fieldLabel('Verified'))->setDescription(_t('Newsletter.VerifiedDesc', 'Has this user verified his subscription?')), Object::create('CheckboxField', 'Blacklisted', $this->fieldLabel('Blacklisted'))->setDescription(_t('Newsletter.BlacklistedDesc', 'Excluded from emails, either by automated process or manually. ' . 'An invalid address or undeliverable email will eventually result in blacklisting.')), Object::create('ReadonlyField', 'ReceivedCount', $this->fieldLabel('ReceivedCount'))->setDescription(_t('Newsletter.ReceivedCountDesc', 'Number of emails sent without undeliverable errors. ' . 'Only one indication that an email has actually been received and read.'))));
     $this->extend('updateCMSFields', $fields);
     return $fields;
 }
 /**
  * @return FieldList
  */
 public function getCMSFields()
 {
     $summit_id = @$_REQUEST['SummitID'];
     $f = new FieldList($rootTab = new TabSet("Root", $tabMain = new Tab('Main')));
     $f->addFieldsToTab('Root.Main', new HiddenField('SummitID', 'SummitID'));
     $f->addFieldsToTab('Root.Main', new MemberAutoCompleteField('Member', 'Member'));
     if ($this->ID > 0) {
         $config = GridFieldConfig_RelationEditor::create(25);
         $config->getComponentByType('GridFieldAddExistingAutocompleter')->setSearchList(PresentationCategory::get()->filter('SummitID', $summit_id));
         $categories = new GridField('Categories', 'Presentation Categories', $this->Categories(), $config);
         $f->addFieldToTab('Root.Presentation Categories', $categories);
     }
     return $f;
 }
 function updateCMSFields(FieldList $fields)
 {
     $lists = CampaignMonitorSignupPage::get_ready_ones();
     if ($lists && $lists->count()) {
         $options = array(0 => _t("EcommerceNewsletterCampaignMonitorSignup.PLEASE_SELECT", "-- please select --")) + $lists->map()->toArray();
         if ($this->owner->CampaignMonitorSignupPageID) {
             $fields->addFieldsToTab("Root.Newsletter", array(new DropdownField("CampaignMonitorSignupPageID", _t("EcommerceNewsletterCampaignMonitorSignup.SIGN_UP_TO", "Sign-up for ..."), $options), new TextField("CampaignMonitorSignupHeader", _t("EcommerceNewsletterCampaignMonitorSignup.HEADER", "Header")), new TextField("CampaignMonitorSignupIntro", _t("EcommerceNewsletterCampaignMonitorSignup.INTRO", "Intro")), new TextField("CampaignMonitorSignupLabel", _t("EcommerceNewsletterCampaignMonitorSignup.LABEL", "Label"))));
         } else {
             $fields->addFieldsToTab("Root.Newsletter", array(new DropdownField("CampaignMonitorSignupPageID", _t("EcommerceNewsletterCampaignMonitorSignup.SIGN_UP_TO", "Sign-up for ..."), $options)));
             $fields->removeFieldsFromTab("Root.Main", array("CampaignMonitorSignupHeader", "CampaignMonitorSignupIntro", "CampaignMonitorSignupLabel"));
         }
     } else {
         $fields->addFieldToTab("Root.Newsletter", new LiteralField("ListExplanation", "<p class=\"message warning\">\n\t\t\t\t\t" . _t("EcommerceNewsletterCampaignMonitorSignup.RECOMMENDATION_TO_SETUP", "It is recommended you set up a Campaign Monitor Page with a valid list to subscribe to.") . "\n\t\t\t\t\t</p>"));
     }
 }
 /**
  * @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->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 #24
0
 public function updateCMSFields(FieldList $fields)
 {
     $gridConfig = GridFieldConfig_BlockEditor::create('SortOrder', $this->owner->config()->get('allowed_blocks'));
     $gridField = GridField::create('Blocks', _t('PageBlocks.BLOCK', 'Block', 'GridField Title'), $this->owner->Blocks(), $gridConfig);
     $gridField->setModelClass('Block');
     $fields->addFieldsToTab('Root.Main', array($gridField), 'Metadata');
 }
 public function updateCMSFields(\FieldList $fields)
 {
     $layers = $this->owner->getLayers();
     foreach ($layers as $l) {
         $fields->addFieldsToTab('Root.' . $l->getFriendlyName(), $l->getCMSFields());
     }
 }
Example #26
0
 public function updateCMSFields(FieldList $fields)
 {
     $gridConfig = singleton('Block')->has_extension('Sortable') ? GridFieldConfig_BlockEditor::create('SortOrder') : GridFieldConfig_BlockEditor::create();
     $gridField = GridField::create('Blocks', _t('PageBlocks.BLOCK', 'Block', 'GridField Title'), $this->owner->Blocks(), $gridConfig);
     $gridField->setModelClass('Block');
     $fields->addFieldsToTab('Root.Main', array($gridField), 'Metadata');
 }
 public function updateCMSFields(FieldList $fields)
 {
     $fields->addFieldsToTab("Root.Banners", GridField::create("Banners", null, $this->owner->Banners(), $config = GridFieldConfig_RecordEditor::create()));
     if (class_exists("GridFieldOrderableRows")) {
         $config->addComponent(new GridFieldOrderableRows());
     }
 }
 public function updateCMSFields(\FieldList $fields)
 {
     if (!$this->owner->Backend()->config()->supports_dashboard_metrics) {
         return;
     }
     $fields->addFieldsToTab('Root.Metrics', array(\CheckboxField::create('ShowMetrics', 'Display Metrics for this environment?'), \DropdownField::create('MetricSetID', 'Metric Set', MetricSet::get()->map())));
 }
 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())]);
 }
 /**
  * @param FieldList $fields
  */
 public function updateCMSFields(FieldList $fields)
 {
     // Redo LDAP metadata fields as read-only and move to LDAP tab.
     $ldapMetadata = array();
     $fields->replaceField('IsImportedFromLDAP', $ldapMetadata[] = new ReadonlyField('IsImportedFromLDAP', _t('LDAPMemberExtension.ISIMPORTEDFROMLDAP', 'Is user imported from LDAP/AD?')));
     $fields->replaceField('GUID', $ldapMetadata[] = new ReadonlyField('GUID'));
     $fields->replaceField('IsExpired', $ldapMetadata[] = new ReadonlyField('IsExpired', _t('LDAPMemberExtension.ISEXPIRED', 'Has user\'s LDAP/AD login expired?')));
     $fields->replaceField('LastSynced', $ldapMetadata[] = new ReadonlyField('LastSynced', _t('LDAPMemberExtension.LASTSYNCED', 'Last synced')));
     $fields->addFieldsToTab('Root.LDAP', $ldapMetadata);
     if ($this->owner->IsImportedFromLDAP) {
         // Transform the automatically mapped fields into read-only.
         $mappings = Config::inst()->get('Member', 'ldap_field_mappings');
         foreach ($mappings as $ldap => $ss) {
             $field = $fields->dataFieldByName($ss);
             if (!empty($field)) {
                 // This messes up the Member_Validator, preventing the record from saving :-(
                 // $field->setReadonly(true);
                 $field->setTitle($field->Title() . _t('LDAPMemberExtension.IMPORTEDFIELD', ' (imported)'));
             }
         }
         // Display alert message at the top.
         $message = _t('LDAPMemberExtension.INFOIMPORTED', 'This user is automatically imported from LDAP. ' . 'Manual changes to imported fields will be removed upon sync.');
         $fields->addFieldToTab('Root.Main', new LiteralField('Info', sprintf('<p class="message warning">%s</p>', $message)), 'FirstName');
     }
 }