public function getCMSFields()
 {
     $self = $this;
     $this->beforeUpdateCMSFields(function ($f) use($self) {
         Requirements::javascript('event_calendar/javascript/calendar_cms.js');
         $f->addFieldToTab("Root.Main", TextField::create("Location", _t('Calendar.LOCATIONDESCRIPTION', 'The location for this event')), 'Content');
         $dt = _t('CalendarEvent.DATESANDTIMES', 'Dates and Times');
         $recursion = _t('CalendarEvent.RECURSION', 'Recursion');
         $f->addFieldToTab("Root.{$dt}", GridField::create("DateTimes", _t('Calendar.DATETIMEDESCRIPTION', 'Add dates for this event'), $self->DateTimes(), GridFieldConfig_RecordEditor::create()));
         $f->addFieldsToTab("Root.{$recursion}", array(new CheckboxField('Recursion', _t('CalendarEvent.REPEATEVENT', 'Repeat this event')), new OptionsetField('CustomRecursionType', _t('CalendarEvent.DESCRIBEINTERVAL', 'Describe the interval at which this event recurs.'), array('1' => _t('CalendarEvent.DAILY', 'Daily'), '2' => _t('CalendarEvent.WEEKLY', 'Weekly'), '3' => _t('CalendarEvent.MONTHLY', 'Monthly')))));
         $f->addFieldToTab("Root.{$recursion}", $dailyInterval = new FieldGroup(new LabelField($name = "every1", $title = _t("CalendarEvent.EVERY", "Every ")), new DropdownField('DailyInterval', '', array_combine(range(1, 10), range(1, 10))), new LabelField($name = "days", $title = _t("CalendarEvent.DAYS", " day(s)"))));
         $f->addFieldToTab("Root.{$recursion}", $weeklyInterval = new FieldGroup(new LabelField($name = "every2", $title = _t("CalendarEvent.EVERY", "Every ")), new DropdownField('WeeklyInterval', '', array_combine(range(1, 10), range(1, 10))), new LabelField($name = "weeks", $title = _t("CalendarEvent.WEEKS", " weeks"))));
         $f->addFieldToTab("Root.{$recursion}", new CheckboxSetField('RecurringDaysOfWeek', _t('CalendarEvent.ONFOLLOWINGDAYS', 'On the following day(s)...'), DataList::create("RecurringDayOfWeek")->map("ID", "Title")));
         $f->addFieldToTab("Root.{$recursion}", $monthlyInterval = new FieldGroup(new LabelField($name = "every3", $title = _t("CalendarEvent.EVERY", "Every ")), new DropdownField('MonthlyInterval', '', array_combine(range(1, 10), range(1, 10))), new LabelField($name = "months", $title = _t("CalendarEvent.MONTHS", " month(s)"))));
         $f->addFieldsToTab("Root.{$recursion}", array(new OptionsetField('MonthlyRecursionType1', '', array('1' => _t('CalendarEvent.ONTHESEDATES', 'On these date(s)...'))), new CheckboxSetField('RecurringDaysOfMonth', '', DataList::create("RecurringDayOfMonth")->map("ID", "Value")), new OptionsetField('MonthlyRecursionType2', '', array('1' => _t('CalendarEvent.ONTHE', 'On the...')))));
         $f->addFieldToTab("Root.{$recursion}", $monthlyIndex = new FieldGroup(new DropdownField('MonthlyIndex', '', array('1' => _t('CalendarEvent.FIRST', 'First'), '2' => _t('CalendarEvent.SECOND', 'Second'), '3' => _t('CalendarEvent.THIRD', 'Third'), '4' => _t('CalendarEvent.FOURTH', 'Fourth'), '5' => _t('CalendarEvent.LAST', 'Last'))), new DropdownField('MonthlyDayOfWeek', '', DataList::create("RecurringDayOfWeek")->map("Value", "Title")), new LabelField($name = "ofthemonth", $title = _t("CalendarEvent.OFTHEMONTH", " of the month."))));
         $f->addFieldToTab("Root.{$recursion}", GridField::create("Exceptions", _t('CalendarEvent.ANYEXCEPTIONS', 'Any exceptions to this pattern? Add the dates below.'), $self->Exceptions(), GridFieldConfig_RecordEditor::create()));
         $dailyInterval->addExtraClass('dailyinterval');
         $weeklyInterval->addExtraClass('weeklyinterval');
         $monthlyInterval->addExtraClass('monthlyinterval');
         $monthlyIndex->addExtraClass('monthlyindex');
     });
     $f = parent::getCMSFields();
     return $f;
 }
 /**
  * Overwrites SiteTree.getCMSFields.
  *
  * This method creates a customised CMS form for back-end user.
  *
  * @return fieldset
  */
 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $csv_file = $fields->fieldByName("Root.Main.CSVFile");
     $pdf_file = $fields->fieldByName("Root.Main.PDFFile");
     $html_file = $fields->fieldByName("Root.Main.HTMLFile");
     //Remove all fields - then add nicely...
     $fields->removeFieldsFromTab("Root.Main", array("ReportFields", "ReportHeaders", "ConditionFields", "ConditionOps", "ConditionValues", "PaginateBy", "PageHeader", "SortBy", "SortDir", "ClearColumns", "AddInRows", "AddCols", "CSVFile", "PDFFile", "HTMLFile", "ReportID"));
     $reportFields = $this->getReportableFields();
     $fieldsGroup = new FieldGroup('Fields', new MultiValueDropdownField('ReportFields', _t('AdvancedReport.REPORT_FIELDS', 'Report Fields'), $reportFields), new MultiValueTextField('ReportHeaders', _t('AdvancedReport.REPORT_HEADERS', 'Headers')));
     $fieldsGroup->addExtraClass('reportMultiField');
     $conditions = new FieldGroup('Conditions', new MultiValueDropdownField('ConditionFields', _t('AdvancedReport.CONDITION_FIELDS', 'Condition Fields'), $reportFields), new MultiValueDropdownField('ConditionOps', _t('AdvancedReport.CONDITION_OPERATIONS', 'Op'), self::$allowed_conditions), new MultiValueTextField('ConditionValues', _t('AdvancedReport.CONDITION_VALUES', 'Value')));
     $conditions->addExtraClass('reportMultiField');
     $combofield = new FieldGroup('Sorting', new MultiValueDropdownField('SortBy', _t('AdvancedReport.SORTED_BY', 'Sorted By'), $reportFields), new MultiValueDropdownField('SortDir', _t('AdvancedReport.SORT_DIRECTION', 'Sort Direction'), array('ASC' => _t('AdvancedReport.ASC', 'Ascending'), 'DESC' => _t('AdvancedReport.DESC', 'Descending'))));
     $combofield->addExtraClass('reportMultiField');
     $paginateFields = $reportFields;
     array_unshift($paginateFields, '');
     $fields->addFieldsToTab("Root.Main", array($fieldsGroup, $conditions, $combofield, new FieldGroup('Formatting', new DropdownField('PaginateBy', _t('AdvancedReport.PAGINATE_BY', 'Paginate By'), $paginateFields), new TextField('PageHeader', _t('AdvancedReport.PAGED_HEADER', 'Header text (use $name for the page name)'), '$name'), new MultiValueDropdownField('AddInRows', _t('AdvancedReport.ADD_IN_ROWS', 'Add these columns for each row'), $reportFields), new MultiValueDropdownField('AddCols', _t('AdvancedReport.ADD_IN_ROWS', 'Provide totals for these columns'), $reportFields), new MultiValueDropdownField('ClearColumns', _t('AdvancedReport.CLEARED_COLS', '"Cleared" columns'), $reportFields))));
     /* create a dedicated tab for report download files
      * @todo convert to InlineFormAction or the like to allow user to download report files
      * @todo provide a Generate Link Action on this page
      */
     $fields->addFieldsToTab("Root.Reports", array(new FieldGroup("Files", $csv_file, $pdf_file, $html_file)));
     return $fields;
 }
 function __construct($controller, $name)
 {
     $org_field = null;
     $current_user = Member::currentUser();
     $current_affiliations = $current_user->getCurrentAffiliations();
     if (!$current_affiliations) {
         $org_field = new TextField('Organization', 'Your Organization Name');
     } else {
         if (count($current_affiliations) > 1) {
             $source = array();
             foreach ($current_affiliations as $a) {
                 $org = $a->Organization();
                 $source[$org->ID] = $org->Name;
             }
             $source['0'] = "-- New One --";
             $ddl = new DropdownField('OrgID', 'Your Organization', $source);
             $ddl->setEmptyString('-- Select Your Organization --');
             $org_field = new FieldGroup();
             $org_field->push($ddl);
             $org_field->push($txt = new TextField('Organization', ''));
             $txt->addExtraClass('new-org-name');
         } else {
             $org_field = new TextField('Organization', 'Your Organization Name', $current_user->getOrgName());
         }
     }
     $fields = new FieldList($org_field, new DropdownField('Industry', 'Your Organization’s Primary Industry', ArrayUtils::AlphaSort(DeploymentSurveyOptions::$industry_options, array('' => '-- Please Select One --'), array('Other' => 'Other Industry (please specify)'))), new TextareaField('OtherIndustry', 'Other Industry'), $org_it_activity = new TextareaField('ITActivity', 'Your Organization’s Primary IT Activity'), new LiteralField('Break', '<hr/>'), new LiteralField('Break', '<p>Your Organization’s Primary Location or Headquarters</p>'), $country = new DropdownField('PrimaryCountry', 'Country', CountryCodes::$iso_3166_countryCodes), new TextField('PrimaryState', 'State / Province / Region'), new TextField('PrimaryCity', 'City'), new DropdownField('OrgSize', 'Your Organization Size (All Branches, Locations, Sites)', DeploymentSurveyOptions::$organization_size_options), new CustomCheckboxSetField('OpenStackInvolvement', 'What best describes your Organization’s involvement with OpenStack?<BR>Select All That Apply', ArrayUtils::AlphaSort(DeploymentSurveyOptions::$openstack_involvement_options)));
     $org_it_activity->addExtraClass('hidden');
     $country->setEmptyString('-- Select One --');
     $nextButton = new FormAction('NextStep', '  Next Step  ');
     $actions = new FieldList($nextButton);
     $validator = new RequiredFields();
     Requirements::javascript('surveys/js/deployment_survey_yourorganization_form.js');
     parent::__construct($controller, $name, $fields, $actions, $validator);
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
     Requirements::javascript('eventmanagement/javascript/event-ticket-cms.js');
     $fields->removeByName('EventID');
     $fields->removeByName('StartType');
     $fields->removeByName('StartDate');
     $fields->removeByName('StartDays');
     $fields->removeByName('StartHours');
     $fields->removeByName('StartMins');
     $fields->removeByName('EndType');
     $fields->removeByName('EndDate');
     $fields->removeByName('EndDays');
     $fields->removeByName('EndHours');
     $fields->removeByName('EndMins');
     if (class_exists('Payment')) {
         $fields->insertBefore(new OptionSetField('Type', 'Ticket type', array('Free' => 'Free ticket', 'Price' => 'Fixed price ticket')), 'Price');
     } else {
         $fields->removeByName('Type');
         $fields->removeByName('Price');
     }
     foreach (array('Start', 'End') as $type) {
         $fields->addFieldsToTab('Root.Main', array(new OptionSetField("{$type}Type", "{$type} sales at", array('Date' => 'A specific date and time', 'TimeBefore' => 'A time before the event starts')), $dateTime = new DatetimeField("{$type}Date", ''), $before = new FieldGroup("{$type}Offset", new NumericField("{$type}Days", 'Days'), new NumericField("{$type}Hours", 'Hours'), new NumericField("{$type}Mins", 'Minutes'))));
         $before->setName("{$type}Offset");
         $before->setTitle(' ');
         $dateTime->getDateField()->setConfig('showcalendar', true);
         $dateTime->getTimeField()->setConfig('showdropdown', true);
     }
     $fields->addFieldsToTab('Root.Advanced', array(new TextareaField('Description', 'Description'), new NumericField('MinTickets', 'Minimum tickets per order'), new NumericField('MaxTickets', 'Maximum tickets per order')));
     return $fields;
 }
 function SearchForm()
 {
     $query = isset($_GET['CommentSearch']) ? $_GET['CommentSearch'] : null;
     $searchFields = new FieldGroup(new TextField('CommentSearch', _t('CommentTableField.SEARCH', 'Search'), $query), new HiddenField("ctf[ID]", '', $this->mode), new HiddenField('CommentFieldName', '', $this->name));
     $actionFields = new LiteralField('CommentFilterButton', '<input type="submit" name="CommentFilterButton" value="' . _t('CommentTableField.FILTER', 'Filter') . '" id="CommentFilterButton"/>');
     $fieldContainer = new FieldGroup($searchFields, $actionFields);
     return $fieldContainer->FieldHolder();
 }
 public function testMessagesInsideNestedCompositeFields()
 {
     $fieldGroup = new FieldGroup(new CompositeField($textField = new TextField('TestField', 'Test Field'), $emailField = new EmailField('TestEmailField', 'Test Email Field')));
     $textField->setError('Test error message', 'warning');
     $emailField->setError('Test error message', 'error');
     $this->assertEquals('Test error message,  Test error message.', $fieldGroup->Message());
     $this->assertEquals('warning.  error', $fieldGroup->MessageType());
 }
 public function updateCMSFields(FieldList $fields)
 {
     $options = new FieldGroup(new CheckboxField('CleanOnSave', _t('TidyContent.CLEAN_ON_SAVE', 'Clean this content whenever the page is saved')), new CheckboxField('TidyHtml', _t('TidyContent.TIDY_HTML', 'Tidy HTML')), new CheckboxField('PurifyHtml', _t('TidyContent.PURIFY_HTML', 'Purify HTML')), new CheckboxField('FixUTF8', _t('TidyContent.FIX_UTF8', 'Fix badly encoded UTF8 characters')), new CheckboxField('CheckAccessible', _t('TidyContent.CHECK_ACCESS', 'Check accessibility')), new CheckboxField('StripWordTags', _t('TidyContent.STRIP_WORD', 'Strip extraneous MS word tags')));
     $options->setTitle('Cleaning:');
     $fields->addFieldToTab('Root.Cleaning', $options);
     $conf = SiteConfig::current_site_config();
     if (strlen($this->owner->AccessibleErrors) && ($conf->ForceAccessibilityChecks || $this->owner->CheckAccessible)) {
         $fields->addFieldToTab('Root.Main', new ReadonlyField('AccessibleErrorsList', 'Possible accessibility issues', $this->owner->AccessibleErrors), 'Content');
     }
 }
Пример #8
0
 /**
  * @expectedException InvalidCoefficientException
  */
 public function testInvalidCoefficientType()
 {
     $FGC = new DOMDocument('1.0', 'UTF-8');
     $FGC->load(FGCInvalidCoefficientType, LIBXML_NOBLANKS);
     $FGCXPath = new DOMXPath($FGC);
     $FGCXPath->registerNamespace('fg', 'http://keg.vse.cz/ns/fieldgroupconfig0_1');
     $FGCNode = $FGCXPath->evaluate('//FieldGroupConfig[1]')->item(0);
     $FG = new FieldGroup($FGCNode, $FGCXPath, 'en', true, $this->attributes, $this->coefficients);
     $FG->parse();
 }
 public function Field($properties = array())
 {
     $fields = new FieldGroup($this->name);
     $fields->setID("{$this->name}_Holder");
     list($countryCode, $areaCode, $phoneNumber, $extension) = $this->parseValue();
     if ($this->value == "") {
         $countryCode = $this->countryCode;
         $areaCode = $this->areaCode;
         $extension = $this->ext;
     }
     if ($this->countryCode !== null) {
         $fields->push(new NumericField($this->name . '[Country]', '+', $countryCode, 4));
     }
     if ($this->areaCode !== null) {
         $fields->push(new NumericField($this->name . '[Area]', '(', $areaCode, 4));
         $fields->push(new NumericField($this->name . '[Number]', ')', $phoneNumber, 10));
     } else {
         $fields->push(new NumericField($this->name . '[Number]', '', $phoneNumber, 10));
     }
     if ($this->ext !== null) {
         $fields->push(new NumericField($this->name . '[Extension]', 'ext', $extension, 6));
     }
     $description = $this->getDescription();
     if ($description) {
         $fields->getChildren()->First()->setDescription($description);
     }
     foreach ($fields as $field) {
         $field->setDisabled($this->isDisabled());
         $field->setReadonly($this->isReadonly());
     }
     return $fields;
 }
 public function Field()
 {
     $field = new FieldGroup($this->name);
     $field->setID("{$this->name}_Holder");
     list($countryCode, $areaCode, $phoneNumber, $extension) = $this->parseValue();
     $hasTitle = false;
     if ($this->value == "") {
         $countryCode = $this->countryCode;
         $areaCode = $this->areaCode;
         $extension = $this->ext;
     }
     if ($this->countryCode !== null) {
         $field->push(new NumericField($this->name . '[Country]', '+', $countryCode, 4));
     }
     if ($this->areaCode !== null) {
         $field->push(new NumericField($this->name . '[Area]', '(', $areaCode, 4));
         $field->push(new NumericField($this->name . '[Number]', ')', $phoneNumber, 10));
     } else {
         $field->push(new NumericField($this->name . '[Number]', '', $phoneNumber, 10));
     }
     if ($this->ext !== null) {
         $field->push(new NumericField($this->name . '[Extension]', 'ext', $extension, 6));
     }
     return $field;
 }
 public function getSettingsFields()
 {
     $dataTypes = $this->getAvailableTypes();
     $reportable = $this->getReportableFields();
     $converted = array();
     foreach ($reportable as $k => $v) {
         $converted[$this->dottedFieldToUnique($k)] = $v;
     }
     $dataTypes = array_merge(array('' => ''), $dataTypes);
     $types = new MultiValueDropdownField('DataTypes', _t('AdvancedReport.DATA_TYPES', 'Data types'), $dataTypes);
     $fieldsGroup = new FieldGroup('Fields', $reportFieldsSelect = new MultiValueDropdownField('ReportFields', _t('AdvancedReport.REPORT_FIELDS', 'Report Fields'), $reportable));
     $fieldsGroup->push(new MultiValueTextField('ReportHeaders', _t('AdvancedReport.HEADERS', 'Header labels')));
     $fieldsGroup->addExtraClass('reportMultiField');
     $reportFieldsSelect->addExtraClass('reportFieldsSelection');
     $fieldsGroup->setName('FieldsGroup');
     $fieldsGroup->addExtraClass('advanced-report-fields dropdown');
     $conditions = new FieldGroup('Conditions', new MultiValueDropdownField('ConditionFields', _t('AdvancedReport.CONDITION_FIELDS', 'Condition Fields'), $reportable), new MultiValueDropdownField('ConditionOps', _t('AdvancedReport.CONDITION_OPERATIONS', 'Op'), $this->config()->allowed_conditions), new MultiValueTextField('ConditionValues', _t('AdvancedReport.CONDITION_VALUES', 'Value')));
     $conditions->setName('ConditionsGroup');
     $conditions->addExtraClass('dropdown');
     // define the group for the sort field
     $sortGroup = new FieldGroup('Sort', new MultiValueDropdownField('SortBy', _t('AdvancedReport.SORTED_BY', 'Sorted By'), $reportable), new MultiValueDropdownField('SortDir', _t('AdvancedReport.SORT_DIRECTION', 'Sort Direction'), array('ASC' => _t('AdvancedReport.ASC', 'Ascending'), 'DESC' => _t('AdvancedReport.DESC', 'Descending'))));
     $sortGroup->setName('SortGroup');
     $sortGroup->addExtraClass('dropdown');
     // build a list of the formatters
     $formatters = ClassInfo::implementorsOf('ReportFieldFormatter');
     $fmtrs = array();
     foreach ($formatters as $formatterClass) {
         $formatter = new $formatterClass();
         $fmtrs[$formatterClass] = $formatter->label();
     }
     // define the group for the custom field formatters
     $fieldFormattingGroup = new FieldGroup(_t('AdvancedReport.FORMAT_FIELDS', 'Custom field formatting'), new MultiValueDropdownField('FieldFormattingField', _t('AdvancedReport.FIELDFORMATTING', 'Field'), $converted), new MultiValueDropdownField('FieldFormattingFormatter', _t('AdvancedReport.FIELDFORMATTINGFORMATTER', 'Formatter'), $fmtrs));
     $fieldFormattingGroup->setName('FieldFormattingGroup');
     $fieldFormattingGroup->addExtraClass('dropdown');
     // assemble the fieldlist
     $fields = new FieldList(new TextField('Title', _t('AdvancedReport.TITLE', 'Title')), new TextareaField('Description', _t('AdvancedReport.DESCRIPTION', 'Description')), $types, $fieldsGroup, $conditions, new KeyValueField('ReportParams', _t('AdvancedReport.REPORT_PARAMETERS', 'Default report parameters')), $sortGroup, new MultiValueDropdownField('NumericSort', _t('AdvancedReport.SORT_NUMERICALLY', 'Sort these fields numerically'), $reportable), DropdownField::create('PaginateBy')->setTitle(_t('AdvancedReport.PAGINATE_BY', 'Paginate By'))->setSource($reportable)->setHasEmptyDefault(true), TextField::create('PageHeader')->setTitle(_t('AdvancedReport.HEADER_TEXT', 'Header text'))->setDescription(_t('AdvancedReport.USE_NAME_FOR_PAGE_NAME', 'use $name for the page name'))->setValue('$name'), new MultiValueDropdownField('AddInRows', _t('AdvancedReport.ADD_IN_ROWS', 'Add these columns for each row'), $converted), new MultiValueDropdownField('AddCols', _t('AdvancedReport.ADD_IN_ROWS', 'Provide totals for these columns'), $converted), $fieldFormattingGroup, new MultiValueDropdownField('ClearColumns', _t('AdvancedReport.CLEARED_COLS', '"Cleared" columns'), $converted));
     if ($this->config()->allow_grouping) {
         // GroupBy
         $groupingGroup = new FieldGroup('Grouping', new MultiValueDropdownField('GroupBy', _t('AdvancedReport.GROUPBY_FIELDS', 'Group by fields'), $reportable), new MultiValueDropdownField('SumFields', _t('AdvancedReport.SUM_FIELDS', 'SUM fields'), $reportable));
         $groupingGroup->addExtraClass('dropdown');
         $fields->insertAfter($groupingGroup, 'ConditionsGroup');
     }
     if ($this->hasMethod('updateReportFields')) {
         Deprecation::notice('3.0', 'The updateReportFields method is deprecated, instead overload getSettingsFields');
         $this->updateReportFields($fields);
     }
     $this->extend('updateSettingsFields', $fields);
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $group = new FieldGroup();
     $group->setTitle(_t('News.Author'));
     $group->setDescription(_t('News.AuthorHolder'));
     $fields->addFieldToTab('Root.Main', $group, 'Content');
     $field = new TextField('AuthorName', _t('News.Name'));
     $group->push($field);
     $field = new TextField('AuthorURI', _t('News.URI'));
     $group->push($field);
     $field = new TextField('AuthorEmail', _t('News.Email'));
     $group->push($field);
     return $fields;
 }
 /**
  * If this extension is applied to a {@link SiteTree} record then
  * append a Provide Comments checkbox to allow authors to trigger
  * whether or not to display comments
  *
  * @todo Allow customization of other {@link Commenting} configuration
  *
  * @param FieldList $fields
  */
 public function updateSettingsFields(FieldList $fields)
 {
     $options = FieldGroup::create()->setTitle(_t('CommentsExtension.COMMENTOPTIONS', 'Comments'));
     // Check if enabled setting should be cms configurable
     if ($this->owner->getCommentsOption('enabled_cms')) {
         $options->push(new CheckboxField('ProvideComments', _t('Comment.ALLOWCOMMENTS', 'Allow Comments')));
     }
     // Check if we should require users to login to comment
     if ($this->owner->getCommentsOption('require_login_cms')) {
         $options->push(new CheckboxField('CommentsRequireLogin', _t('Comments.COMMENTSREQUIRELOGIN', 'Require login to comment')));
     }
     if ($options->FieldList()->count()) {
         if ($fields->hasTabSet()) {
             $fields->addFieldsToTab('Root.Settings', $options);
         } else {
             $fields->push($options);
         }
     }
     // Check if moderation should be enabled via cms configurable
     if ($this->owner->getCommentsOption('require_moderation_cms')) {
         $moderationField = new DropdownField('ModerationRequired', 'Comment Moderation', array('None' => _t('CommentsExtension.MODERATIONREQUIRED_NONE', 'No moderation required'), 'Required' => _t('CommentsExtension.MODERATIONREQUIRED_REQUIRED', 'Moderate all comments'), 'NonMembersOnly' => _t('CommentsExtension.MODERATIONREQUIRED_NONMEMBERSONLY', 'Only moderate non-members')));
         if ($fields->hasTabSet()) {
             $fields->addFieldsToTab('Root.Settings', $moderationField);
         } else {
             $fields->push($moderationField);
         }
     }
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     // Remove fields
     $fields->removeByName(array('Unique', 'Permanent', 'CanClose', 'CloseColor', 'LinkID'));
     // Add fields
     // Main tab
     $fields->addFieldToTab("Root.Main", $test = TextField::create("ButtonText")->setTitle(_t("SiteMessage.LABELBUTTONTEXT", "Button Text")));
     $fields->addFieldToTab("Root.Main", TreeDropdownField::create("PageID")->setTitle(_t("SiteMessage.LABELLINKTO", "Link to"))->setSourceObject("SiteTree"));
     $fields->addFieldToTab("Root.Main", HTMLEditorField::create("Content")->setTitle(_t("SiteMessage.LABELCONTENT", "Message content"))->setRows(15));
     // Design tab
     $fields->addFieldToTab("Root.Design", HeaderField::create("ColorSettings")->setTitle(_t("SiteMessage.HEADERCOLORSETTINGS", "Color settings")));
     $fields->addFieldToTab("Root.Design", ColorField::create("BackgroundColor")->setTitle(_t("SiteMessage.LABELBACKGROUNDCOLOR", "Background Color")));
     $fields->addFieldToTab("Root.Design", ColorField::create("TextColor")->setTitle(_t("SiteMessage.LABELTEXTCOLOR", "Text Color")));
     $fields->addFieldToTab("Root.Design", ColorField::create("ButtonColor")->setTitle(_t("SiteMessage.LABELBUTTONCOLOR", "Button Color")));
     $fields->addFieldToTab("Root.Design", ColorField::create("ButtonTextColor")->setTitle(_t("SiteMessage.LABELBUTTONTEXTCOLOR", "Button Text Color")));
     $fields->addFieldToTab("Root.Design", HeaderField::create("CloseSettings")->setTitle(_t("SiteMessage.HEADERCLOSESETTINGS", "Close button settings")));
     $fields->addFieldToTab("Root.Design", FieldGroup::create(_t("SiteMessage.LABELCANCLOSE", "Show close button?"), Checkboxfield::create("CanClose", "")));
     $fields->addFieldToTab("Root.Design", ColorField::create("CloseColor")->setTitle(_t("SiteMessage.LABELCLOSECOLOR", "Close button color")));
     // Schedule tab
     $fields->addFieldToTab("Root.Schedule", FieldGroup::create(_t("SiteMessage.LABELPERMANENT", "Is this message permanent?"), CheckboxField::create("Permanent", "")));
     $fields->addFieldToTab("Root.Schedule", $Start = new DatetimeField("Start"));
     $fields->addFieldToTab("Root.Schedule", $End = new DatetimeField("End"));
     $Start->setConfig('datavalueformat', 'YYYY-MM-dd HH:mm')->setTitle(_t("SiteMessage.LABELSTART", "Start Date"))->getDateField('Start')->setConfig('showcalendar', TRUE);
     $End->setConfig('datavalueformat', 'YYYY-MM-dd HH:mm')->setTitle(_t("SiteMessage.LABELSTART", "End Date"))->getDateField('End')->setConfig('showcalendar', TRUE);
     return $fields;
 }
Пример #15
0
 public function getCMSFields($params = null)
 {
     //fields that shouldn't be changed once coupon is used
     $fields = new FieldList(array($tabset = new TabSet("Root", $maintab = new Tab("Main", TextField::create("Title"), CheckboxField::create("Active", "Active")->setDescription("Enable/disable all use of this discount."), HeaderField::create("ActionTitle", "Action", 3), $typefield = SelectionGroup::create("Type", array(new SelectionGroup_Item("Percent", $percentgroup = FieldGroup::create($percentfield = NumericField::create("Percent", "Percentage", "0.00")->setDescription("e.g. 0.05 = 5%, 0.5 = 50%, and 5 = 500%"), $maxamountfield = CurrencyField::create("MaxAmount", _t("MaxAmount", "Maximum Amount"))->setDescription("The total allowable discount. 0 means unlimited.")), "Discount by percentage"), new SelectionGroup_Item("Amount", $amountfield = CurrencyField::create("Amount", "Amount", "\$0.00"), "Discount by fixed amount")))->setTitle("Type"), OptionSetField::create("For", "Applies to", array("Order" => "Entire Order", "Cart" => "Cart Subtotal", "Shipping" => "Shipping Subtotal", "Items" => "Each Individual Item")), new Tab("Main", HeaderField::create("ConstraintsTitle", "Constraints", 3), LabelField::create("ConstraintsDescription", "Configure the requirements an order must meet for this discount to be valid:")), new TabSet("Constraints")))));
     if (!$this->isInDB()) {
         $fields->addFieldToTab("Root.Main", LiteralField::create("SaveNote", "<p class=\"message good\">More constraints will show up after you save for the first time.</p>"), "Constraints");
     }
     $this->extend("updateCMSFields", $fields, $params);
     if ($count = $this->getUseCount()) {
         $fields->addFieldsToTab("Root.Usage", array(HeaderField::create("UseCount", sprintf("This discount has been used {$count} time%s.", $count > 1 ? "s" : "")), HeaderField::create("TotalSavings", sprintf("A total of %s has been saved by customers using this discount.", $this->SavingsTotal), "3"), GridField::create("Orders", "Orders", $this->getAppliedOrders(), GridFieldConfig_RecordViewer::create()->removeComponentsByType("GridFieldViewButton"))));
     }
     if ($params && isset($params['forcetype'])) {
         $valuefield = $params['forcetype'] == "Percent" ? $percentfield : $amountfield;
         $fields->insertAfter($valuefield, "Type");
         $fields->removeByName("Type");
     } elseif ($this->Type && (double) $this->{$this->Type}) {
         $valuefield = $this->Type == "Percent" ? $percentfield : $amountfield;
         $fields->removeByName("Type");
         $fields->insertAfter($valuefield, "ActionTitle");
         $fields->replaceField($this->Type, $valuefield->performReadonlyTransformation());
         if ($this->Type == "Percent") {
             $fields->insertAfter($maxamountfield, "Percent");
         }
     }
     return $fields;
 }
Пример #16
0
 protected function parseFieldGroupConfig($id, $config)
 {
     $FGCNode = $this->XPath->evaluate('//FieldGroupConfig[@id="' . $id . '"]')->item(0);
     if ($FGCNode === null) {
         throw new InvalidFieldGroupConfigException('Invalid field group config structure.');
     }
     $FG = new FieldGroup($FGCNode, $this->XPath, $this->lang, $this->rootConfigID === $id, $this->attributes, $this->coefficients);
     $FG->parse();
     $config = array_merge_recursive($config, $FG->toArray());
     if ($FG->hasChildGroups() === true) {
         foreach ($FG->getChildGroups() as $chg) {
             $config = $this->parseFieldGroupConfig($chg, $config);
         }
     }
     return $config;
 }
 /**
  * @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;
 }
Пример #18
0
 public function getSettingsFields()
 {
     $fields = parent::getSettingsFields();
     $gallery = FieldGroup::create(CheckboxField::create('HideDescription', 'Hide the description of each image?'))->setTitle('Gallery');
     $fields->addFieldToTab('Root.Settings', $gallery);
     return $fields;
 }
 /**
  * @return FieldList
  */
 public function getCMSFields()
 {
     /** =========================================
          * @var FieldList $fields
          * @var FieldGroup $settings
          * @var UploadField $image
          * @var GridFieldConfig_RelationEditor $config
          * @var GridField $gridField
         ===========================================*/
     $fields = FieldList::create(TabSet::create('Root'));
     $fields->addfieldToTab('Root.Main', $title = TextField::create('Title'));
     $title->setRightTitle('Title used in the cms as a visual cue for this piece of content.');
     $fields->addFieldToTab('Root.Main', $settings = FieldGroup::create(array(CheckboxField::create('IsFullWidth', 'Container full width'))));
     $settings->setTitle('Settings');
     $fields->addFieldToTab('Root.Main', HeaderField::create('', 'Style'));
     $fields->addFieldToTab('Root.Main', DesignField::create('Style', 'Container', '.container', array('padding-top' => 'TextField', 'padding-bottom' => 'TextField', 'margin-top' => 'TextField', 'margin-bottom' => 'TextField', 'color' => 'ColorField', 'background' => 'ColorField')));
     $fields->addFieldToTab('Root.Main', HeaderField::create('', 'Background (optional)', 4));
     $fields->addFieldToTab('Root.Main', $image = UploadField::create('Image', _t('PageBuilderContainer.IMAGE', 'Image')));
     $image->setAllowedExtensions(array('jpeg', 'jpg', 'gif', 'png'));
     $image->setFolderName('Uploads/site-builder/containers');
     $fields->addFieldToTab('Root.Main', DropdownField::create('BackgroundType', 'Type', $this->dbObject('BackgroundType')->enumValues()));
     $config = GridFieldConfig_RelationEditor::create(10);
     $config->addComponent(GridFieldOrderableRows::create('SortOrder'))->addComponent(new GridFieldDeleteAction());
     $gridField = GridField::create('Items', 'Items', $this->Items(), $config);
     $gridField->addExtraClass('hide');
     $fields->addFieldToTab('Root.Main', $gridField);
     return $fields;
 }
 public function updateCMSFields(\FieldList $fields)
 {
     if (!Config::inst()->get('VersionFeed', 'allchanges_enabled')) {
         return;
     }
     $fields->addFieldToTab('Root.Access', FieldGroup::create(new CheckboxField('AllChangesEnabled', $this->owner->fieldLabel('AllChangesEnabled')))->setTitle(_t('VersionFeedSiteConfig.ALLCHANGES', 'All page changes'))->setDescription(_t('VersionFeed.Warning', "Publicising the history will also disclose the changes that have at the time been protected " . "from the public view.")));
 }
 function updateSettingsFields(FieldList $fields)
 {
     $children = FieldGroup::create(CheckboxField::create('ShowChildren', 'Show children in the content area?'))->setTitle('Children of this page');
     $fields->addFieldToTab('Root.Settings', $children);
     $contact = FieldGroup::create(CheckboxField::create('ShowContact', 'Show contact info on this page?'))->setTitle('Contact Info (from settings)');
     $fields->addFieldToTab('Root.Settings', $contact);
 }
 public function getCMSFields()
 {
     $datetimeField = DatetimeField::create("Date")->setTitle($this->fieldLabel("Date"));
     $datetimeField->getDateField()->setConfig("dmyfields", true);
     // Check if NewsImage should be saved in a seperate folder
     if (self::config()->save_image_in_seperate_folder == false) {
         $UploadField = UploadField::create("NewsImage")->setTitle($this->fieldLabel("NewsImage"))->setFolderName("news");
     } else {
         if ($this->ID == "0") {
             $UploadField = FieldGroup::create(LiteralField::create("Save", $this->fieldLabel("SaveHelp")))->setTitle($this->fieldLabel("NewsImage"));
         } else {
             $UploadField = UploadField::create("NewsImage")->setTitle($this->fieldLabel("NewsImage"))->setFolderName("news/" . $this->URLSegment);
         }
     }
     // Create direct link to NewsArticle
     if ($this->ID == "0") {
         // Little hack to hide $urlsegment when article isn't saved yet.
         $urlsegment = LiteralField::create("NoURLSegmentYet", "");
     } else {
         if ($NewsHolder = $this->NewsHolder()) {
             $baseLink = Controller::join_links(Director::absoluteBaseURL(), $NewsHolder->Link(), $this->URLSegment);
         }
         $urlsegment = Fieldgroup::create(LiteralField::create("URLSegment", "URLSegment")->setContent('<a href="' . $baseLink . '" target="_blank">' . $baseLink . '</a>'))->setTitle("URLSegment");
     }
     $fields = FieldList::create(new TabSet("Root", new Tab("Main", $urlsegment, TextField::create("Title")->setTitle($this->fieldLabel("Title")), $datetimeField, HTMLEditorField::create("Content")->setTitle($this->fieldLabel("Content")), $UploadField)));
     $this->extend("updateCMSFields", $fields);
     return $fields;
 }
 /**
  * updates cms fields and adds widgetset gridfields
  *
  * @param FieldList $fields fields
  *
  * @return void
  *
  * @author Patrick Schneider <*****@*****.**>
  * @since 04.01.2013
  */
 public function updateCMSFields(FieldList $fields)
 {
     $inheritFromParentField = new CheckboxField('InheritFromParent', '');
     $inheritFromParentFieldGroup = new FieldGroup($inheritFromParentField);
     $inheritFromParentFieldGroup->setTitle($this->owner->fieldLabel('InheritFromParent'));
     $config = GridFieldConfig_RelationEditor::create();
     $widgetSetSidebarLabel = new HeaderField('WidgetSetSidebarLabel', $this->owner->fieldLabel('WidgetSetSidebarLabel'));
     $widgetSetSidebarField = new GridField("WidgetSetSidebar", $this->owner->fieldLabel('AssignedWidgets'), $this->owner->WidgetSetSidebar(), $config);
     $widgetSetContentlabel = new HeaderField('WidgetSetContentLabel', $this->owner->fieldLabel('WidgetSetContentLabel'));
     $widgetSetContentField = new GridField("WidgetSetContent", $this->owner->fieldLabel('AssignedWidgets'), $this->owner->WidgetSetContent(), $config);
     $fields->addFieldToTab("Root.Widgets", $inheritFromParentFieldGroup);
     $fields->addFieldToTab("Root.Widgets", $widgetSetSidebarLabel);
     $fields->addFieldToTab("Root.Widgets", $widgetSetSidebarField);
     $fields->addFieldToTab("Root.Widgets", $widgetSetContentlabel);
     $fields->addFieldToTab("Root.Widgets", $widgetSetContentField);
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     // Main Content tab
     // Carousel tab
     $carouselItemsGrid = null;
     // Manay to many relations can only be established if we have an id. So put a place holder instead of a grid if this is a new object.
     if ($this->ID == 0) {
         $carouselItemsGrid = TextField::create("CarouselItems", "Carousel Items")->setDisabled(true)->setValue("Page must be saved once before adding Carousel Items.");
     } else {
         $carouselItemsGrid = new GridField('CarouselItems', 'Carousel', $this->CarouselItems()->sort('Archived'), GridFieldConfig_RelationEditor::create());
         $carouselItemsGridUploadComponent = new GridFieldBulkUpload("Image");
         $carouselItemsGridUploadComponent->setUfSetup("setFolderName", $this->ImageFolder("carousel"));
         $carouselItemsGrid->setModelClass('CarouselItem')->getConfig()->addComponent($carouselItemsGridUploadComponent)->addComponent(new GridFieldOrderableRows("SortID"));
     }
     $fields->addFieldToTab('Root.Carousel', $carouselItemsGrid);
     // Links
     $fields->addFieldToTab('Root.Links', new TreeDropdownField('LearnMorePageID', 'Page to link the "Learn More" button to:', 'SiteTree'));
     $fields->addFieldToTab('Root.Links', new TextField('LearnMoreButtonText', 'Text to display on the "Learn More" button:', 'SiteTree'));
     $quickLinksGrid = new GridField('Quicklinks', 'Quicklinks', $this->Quicklinks(), GridFieldConfig_RelationEditor::create());
     $quickLinksGrid->setModelClass('Quicklink');
     $quickLinksFieldGroup = FieldGroup::create($quickLinksGrid)->setTitle('Quick Links');
     $quickLinksFieldGroup->setName("QuicklinkGroup");
     $fields->addFieldToTab('Root.Links', $quickLinksFieldGroup);
     $fields->removeByName('Translations');
     $fields->removeByName('Import');
     $fields->addFieldToTab('Root.Features', ToggleCompositeField::create('FeatureOne', _t('SiteTree.FeatureOne', 'Feature One'), array(new TextField('FeatureOneTitle', 'Title'), new DropdownField('FeatureOneCategory', 'Category', singleton('ExpressHomePage')->dbObject('FeatureOneCategory')->enumValues()), new HTMLEditorField('FeatureOneContent', 'Content'), new TreeDropdownField('FeatureOneLinkID', 'Page to link to', 'SiteTree'), new TextField('FeatureOneButtonText', 'Button text')))->setHeadingLevel(3));
     $fields->addFieldToTab('Root.Features', ToggleCompositeField::create('FeatureTwo', _t('SiteTree.FeatureTwo', 'Feature Two'), array(new TextField('FeatureTwoTitle', 'Title'), new DropdownField('FeatureTwoCategory', 'Category', singleton('ExpressHomePage')->dbObject('FeatureTwoCategory')->enumValues()), new HTMLEditorField('FeatureTwoContent', 'Content'), new TreeDropdownField('FeatureTwoLinkID', 'Page to link to', 'SiteTree'), new TextField('FeatureTwoButtonText', 'Button text')))->setHeadingLevel(3));
     return $fields;
 }
 public function getCMSFields()
 {
     //Fetch curret fields and store in Fields
     $fields = parent::getCMSFields();
     //Remove Fields
     $fields->removeFieldFromTab("Root.Main", array("SortOrder", "CalendarID", "Title", "Content", "StartDate", "StartTime", "EndDate", "EndTime", "Location"));
     //Event Title
     $Title = new TextField("Title", "Event Title");
     $Title->setRightTitle("Enter the event title. i.e. sports day.");
     //Start Date & Time
     $StartDate = new DateField("StartDate", "Start Date");
     $StartDate->setConfig('showcalendar', 1);
     $StartDate->setConfig('dateformat', 'dd/MM/YYYY');
     $StartTime = new TimeField("StartTime", "Start Time (Optional)");
     $StartTime->setConfig('use_strtotime', 1);
     //End Date & Time
     $EndDate = new DateField("EndDate", "End Date (Optional)");
     $EndDate->setConfig('showcalendar', 1);
     $EndDate->setConfig('dateformat', 'dd/MM/YYYY');
     $EndTime = new TimeField("EndTime", "End Time (Optional)");
     $StartTime->setConfig('use_strtotime', 1);
     //Location
     $Location = new AddressTextField("Location", "Event Location", "AIzaSyA-folYpPWGiFcpBZURJpf610nO6FJtqqQ");
     $Location->SetRightTitle("Optional. Begin typing and you will see address suggestions (Beta). Powered by Google.");
     $Location->addExtraClass("text");
     //Event Description
     $Description = new HTMLEditorField("Content", "Event Description");
     //Group Start and End Date & Time Fields
     $Times = FieldGroup::create($StartDate, $StartTime, $EndDate, $EndTime)->setTitle('Timings');
     //Add Fields to the CMS
     $fields->addFieldsToTab("Root.Main", array($Title, $Times, $Location, $Description));
     //Return Fields to the CMS
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = singleton('DataObject')->getCMSFields();
     $type_map = $this->dbObject('MetaType')->enumValues();
     $group = FieldGroup::create(FieldGroup::create(TextField::create('Telephone', 'Phone Number'), CheckboxField::create('MetaFax', 'Is Fax'), CheckboxField::create('MetaTollFree', 'Toll Free')), FieldGroup::create(TextField::create('Label', 'Label (optional)')), FieldGroup::create(DropdownField::create('MetaType', 'Meta Type', $type_map)));
     $fields->addFieldToTab('Root.Main', $group);
     return $fields;
 }
Пример #27
0
 /**
  * {@inheritDoc}
  */
 public function bind($data)
 {
     if ($this->mode === self::GROUP) {
         parent::bind($data);
     } else {
         Field::bind($data);
     }
 }
 /**
  * Add fields to the CMS for this gateway.
  */
 public function getCMSFields()
 {
     //Fetch the fields from the Courier DataObject
     $fields = parent::getCMSFields();
     //Add new fields
     $fields->addFieldsToTab("Root.Main", array(HeaderField::create("PayPal Transaction Information"), CompositeField::create(ReadonlyField::create("custom", "Order Number"), ReadonlyField::create("payment_date", "Payment Date"), ReadonlyField::create("payment_status", "Payment Status")->setRightTitle("\n\t\t\t\t\tIf this status is pending, see Pending Reason below. \n\t\t\t\t"), ReadonlyField::create("payment_type", "Payment Type")->setRightTitle("\n\t\t\t\t\tFor a explanation of the different payment types please see 'payment_type' at \n\t\t\t\t\t<a href=\"https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNandPDTVariables/\">paypal.com</a>\n\t\t\t\t"), ReadonlyField::create("pending_reason", "Pending Reason")->setRightTitle("\n\t\t\t\t\tFor a explanation of pending reasons please see 'pending_reason' at \n\t\t\t\t\t<a href=\"https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNandPDTVariables/\">paypal.com</a>\n\t\t\t\t"), ReadonlyField::create("reason_code", "Reason Code")->setRightTitle("\n\t\t\t\t\tThis is set if Payment Status is Reversed, Refunded, Canceled_Reversal, or Denied. For an explanation of its\n\t\t\t\t\tmeaning see 'reason_code' at \n\t\t\t\t\t<a href=\"https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNandPDTVariables/\">paypal.com</a>\n\t\t\t\t"), FieldGroup::create("Transaction Identifiers", ReadonlyField::create("txn_id", "<strong>Transaction ID</strong>"), ReadonlyField::create("parent_txn_id", "<strong>Parent Transaction ID</strong>"))->setRightTitle("\n\t\t\t\t\t<strong>Transaction ID</strong><br />\n\t\t\t\t\tThe identifier for this specific transaction entry.\n\t\t\t\t\t\n\t\t\t\t\t<br /><br />\n\t\t\t\t\t\n\t\t\t\t\t<strong>Parent Transaction ID</strong><br />\n\t\t\t\t\tIf provided, this value is the transaction identifier of the\n\t\t\t\t\tparent transaction. i.e. If this transaction is a refund, the\n\t\t\t\t\tvalue will be the transaction ID of the original purchase.\n\t\t\t\t\t<br />\n\t\t\t\t"), FieldGroup::create("Funds", ReadonlyField::create("mc_gross", "<strong>Gross Payment</strong>"), ReadonlyField::create("mc_fee", "<strong>PayPal Fee</strong>"))->setRightTitle("\n\t\t\t\t\t<strong>Gross Payment</strong><br />\n\t\t\t\t\tFull amount of the customer's payment, before transaction fee is subtracted.\n\t\t\t\t\t\n\t\t\t\t\t<br /><br />\n\t\t\t\t\t\n\t\t\t\t\t<strong>PayPal Fee</strong><br />\n\t\t\t\t\tTransaction fee associated with the payment.\n\t\t\t\t"))));
     return $fields;
 }
 /**
  * @return mixed
  */
 public function getCMSFields()
 {
     $fields = singleton('DataObject')->getCMSFields();
     $type_map = $this->config()->flexiemail_metatype;
     $group = FieldGroup::create(FieldGroup::create(TextField::create('Email', 'Email address')), FieldGroup::create(TextField::create('Label', 'Label (optional)')), FieldGroup::create(DropdownField::create('MetaType', 'Meta Type', $type_map, 1)));
     $fields->addFieldToTab('Root.Main', $group);
     return $fields;
 }
Пример #30
-1
 public function getHTMLFragments($gridField)
 {
     $fields = new ArrayList();
     $state = $gridField->State->UserFormsGridField;
     $selectedField = $state->filter;
     $selectedValue = $state->value;
     // show dropdown of all the fields available from the submitted form fields
     // that have been saved. Takes the titles from the currently live form.
     $columnField = new DropdownField('FieldNameFilter', '');
     $columnField->setSource($this->columns);
     $columnField->setEmptyString(_t('UserFormsGridFieldFilterHeader.FILTERSUBMISSIONS', 'Filter Submissions..'));
     $columnField->setHasEmptyDefault(true);
     $columnField->setValue($selectedField);
     $valueField = new TextField('FieldValue', '', $selectedValue);
     $columnField->addExtraClass('ss-gridfield-sort');
     $columnField->addExtraClass('no-change-track');
     $valueField->addExtraClass('ss-gridfield-sort');
     $valueField->addExtraClass('no-change-track');
     $valueField->setAttribute('placeholder', _t('UserFormsGridFieldFilterHeader.WHEREVALUEIS', 'where value is..'));
     $fields->push(new FieldGroup(new CompositeField($columnField, $valueField)));
     $fields->push(new FieldGroup(new CompositeField($start = new DateField('StartFilter', 'From'), $end = new DateField('EndFilter', 'Till'))));
     foreach (array($start, $end) as $date) {
         $date->setConfig('showcalendar', true);
         $date->setConfig('dateformat', 'y-mm-dd');
         $date->setConfig('datavalueformat', 'y-mm-dd');
         $date->addExtraClass('no-change-track');
     }
     $end->setValue($state->end);
     $start->setValue($state->start);
     $fields->push($actions = new FieldGroup(GridField_FormAction::create($gridField, 'filter', false, 'filter', null)->addExtraClass('ss-gridfield-button-filter')->setAttribute('title', _t('GridField.Filter', "Filter"))->setAttribute('id', 'action_filter_' . $gridField->getModelClass() . '_' . $columnField), GridField_FormAction::create($gridField, 'reset', false, 'reset', null)->addExtraClass('ss-gridfield-button-close')->setAttribute('title', _t('GridField.ResetFilter', "Reset"))->setAttribute('id', 'action_reset_' . $gridField->getModelClass() . '_' . $columnField)));
     $actions->addExtraClass('filter-buttons');
     $actions->addExtraClass('no-change-track');
     $forTemplate = new ArrayData(array('Fields' => $fields));
     return array('header' => $forTemplate->renderWith('GridFieldFilterHeader_Row'));
 }