コード例 #1
0
 public function getFieldConfiguration()
 {
     $field = parent::getFieldConfiguration();
     $folder = $this->getSetting('Folder') ? $this->getSetting('Folder') : null;
     $tree = UserformsTreeDropdownField::create($this->getSettingName("Folder"), _t('EditableUploadField.SELECTUPLOADFOLDER', 'Select upload folder'), "Folder");
     $tree->setValue($folder);
     $field->push($tree);
     return $field;
 }
コード例 #2
0
ファイル: EditableTextField.php プロジェクト: vinstah/body
 public function getFieldConfiguration()
 {
     $fields = parent::getFieldConfiguration();
     $min = $this->getSetting('MinLength') ? $this->getSetting('MinLength') : '';
     $max = $this->getSetting('MaxLength') ? $this->getSetting('MaxLength') : '';
     $rows = $this->getSetting('Rows') ? $this->getSetting('Rows') : '1';
     $extraFields = new FieldList(new FieldGroup(_t('EditableTextField.TEXTLENGTH', 'Text length'), new NumericField($this->getSettingName('MinLength'), "", $min), new NumericField($this->getSettingName('MaxLength'), " - ", $max)), new NumericField($this->getSettingName('Rows'), _t('EditableTextField.NUMBERROWS', 'Number of rows'), $rows));
     $fields->merge($extraFields);
     return $fields;
 }
コード例 #3
0
 function getFieldConfiguration()
 {
     $levels = array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6');
     $level = $this->getSetting('Level') ? $this->getSetting('Level') : 3;
     $options = parent::getFieldConfiguration();
     $options->push(new DropdownField("Fields[{$this->ID}][CustomSettings][Level]", _t('EditableFormHeading.LEVEL', 'Select Heading Level'), $levels, $level));
     if ($this->readonly) {
         $extraFields = $options->makeReadonly();
     }
     return $options;
 }
コード例 #4
0
 function getFieldConfiguration()
 {
     $fields = parent::getFieldConfiguration();
     // eventually replace hard-coded "Fields"?
     $baseName = "Fields[{$this->ID}]";
     $minLength = $this->getSetting('MinLength') ? $this->getSetting('MinLength') : '';
     $maxLength = $this->getSetting('MaxLength') ? $this->getSetting('MaxLength') : '';
     $rows = $this->getSetting('Rows') ? $this->getSetting('Rows') : '1';
     $extraFields = new FieldSet(new FieldGroup(_t('EditableTextField.TEXTLENGTH', 'Text length'), new TextField($baseName . "[CustomSettings][MinLength]", "", $minLength), new TextField($baseName . "[CustomSettings][MaxLength]", " - ", $maxLength)), new TextField($baseName . "[CustomSettings][Rows]", _t('EditableTextField.NUMBERROWS', 'Number of rows'), $rows));
     $fields->merge($extraFields);
     return $fields;
 }
 public function getFieldConfiguration()
 {
     $zoomLevels = array();
     for ($i = 1; $i < 20; $i++) {
         $message = $i == 1 ? _t('EditableFormField.LOWEST', 'Lowest') : "";
         $message = $i == 19 ? _t('EditableFormField.HIGHEST', 'Highest') : $message;
         $zoomLevels[$i] = $message ? $i . ' - ' . $message : $i;
     }
     $fields = parent::getFieldConfiguration();
     $fields->merge(new FieldSet(new TextField("Fields[{$this->ID}][CustomSettings][StartLant]", _t('EditableFormField.STARTLATITUDE', 'Starting Point Latitude'), $this->getSetting('StartLant') ? $this->getSetting('StartLant') : '10'), new TextField("Fields[{$this->ID}][CustomSettings][StartLong]", _t('EditableFormField.STARTLONGITUDE', 'Starting Point Longitude'), $this->getSetting('StartLong') ? $this->getSetting('StartLong') : '10'), new DropdownField("Fields[{$this->ID}][CustomSettings][StartZoom]", _t('EditableFormField.STARTZOOM', 'Starting Zoom Level'), $zoomLevels, $this->getSetting('StartZoom') ? $this->getSetting('StartZoom') : '1'), new TextField("Fields[{$this->ID}][CustomSettings][MapWidth]", _t('EditableFormField.MAPWIDTH', 'Map Width'), $this->getSetting('MapWidth') ? $this->getSetting('MapWidth') : '300px'), new TextField("Fields[{$this->ID}][CustomSettings][MapHeight]", _t('EditableFormField.MAPHEIGHT', 'Map Height'), $this->getSetting('MapHeight') ? $this->getSetting('MapHeight') : '300px')));
     return $fields;
 }
 public function getFieldConfiguration()
 {
     $options = parent::getFieldConfiguration();
     $options->push(new CheckboxField("Fields[{$this->ID}][CustomSettings][Default]", 'Standardmässig angekreuzt?', $this->getSetting('Default')));
     $i = 0;
     $loop = $this->getMC('mergevars');
     foreach ($loop as $field) {
         $i++;
         $FieldName = $field['name'];
         $options->push(new TextField("Fields[{$this->ID}][CustomSettings][{$FieldName}]", "Name des Formularfeldes mit " . $FieldName, $this->getSetting($FieldName)));
     }
     return $options;
 }
コード例 #7
0
ファイル: EditableFormHeading.php プロジェクト: vinstah/body
 public function getFieldConfiguration()
 {
     $levels = array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6');
     $level = $this->getSetting('Level') ? $this->getSetting('Level') : 3;
     $label = _t('EditableFormHeading.LEVEL', 'Select Heading Level');
     $options = parent::getFieldConfiguration();
     $options->push(new DropdownField($this->getSettingName("Level"), $label, $levels, $level));
     if ($this->readonly) {
         $extraFields = $options->makeReadonly();
     }
     $options->push(new CheckboxField($this->getSettingName('HideFromReports'), _t('EditableLiteralField.HIDEFROMREPORT', 'Hide from reports?'), $this->getSetting('HideFromReports')));
     return $options;
 }
 public function getFieldConfiguration()
 {
     $options = parent::getFieldConfiguration();
     $options->push(new CheckboxField("Fields[{$this->ID}][CustomSettings][Default]", _t('EditableFormField.CHECKEDBYDEFAULT', 'Checked by Default?'), $this->getSetting('Default')));
     $defaultID = $this->getSetting('TandCPageID') ? $this->getSetting('TandCPageID') : 0;
     $pages = TermsAndConditionsPage::get();
     if ($pages->count()) {
         $source = TermsAndConditionsPage::get()->map("ID", "Title")->toArray();
         $options->push(new DropdownField("Fields[{$this->ID}][CustomSettings][TandCPageID]", "What is your Terms and Conditions page?  This will be added as a link to the end of your field title.", $source, $defaultID));
     } else {
         $options->push(new LiteralField("Fields[{$this->ID}][CustomSettings][TandCPageID]", "<p>You need to add a Terms and Conditions page before you can link to it (which is usually what you do here).</p>"));
     }
     return $options;
 }
コード例 #9
0
 public function getFieldConfiguration()
 {
     $fields = parent::getFieldConfiguration();
     $folder = $this->getSetting('Folder') ? $this->getSetting('Folder') : null;
     $tree = UserformsTreeDropdownField::create($this->getSettingName("Folder"), _t('EditableUploadField.SELECTUPLOADFOLDER', 'Select upload folder'), "Folder");
     $tree->setValue($folder);
     $fields->push($tree);
     $randomise = $this->getSetting('Obfuscate') ? $this->getSetting('Obfuscate') : null;
     $cb = CheckboxField::create($this->getSettingName('Obfuscate'), 'Obfuscate upload folder - provides some hiding of uploaded files', $randomise);
     $fields->push($cb);
     $multiple = $this->getSetting('MultipleUploads');
     $cb = CheckboxField::create($this->getSettingName("MultipleUploads"), 'Allow multiple uploads');
     $cb->setValue($multiple ? true : false);
     $fields->push($cb);
     return $fields;
 }
 public function getFieldConfiguration()
 {
     $fields = parent::getFieldConfiguration();
     // Get protector
     $protector = FormSpamProtectionExtension::get_protector();
     if (!$protector) {
         return $fields;
     }
     if ($this->Parent()->Fields() instanceof UnsavedRelationList) {
         return $fields;
     }
     // Each other text field in this group can be assigned a field mapping
     $mapGroup = FieldGroup::create(_t('EditableSpamProtectionField.SPAMFIELDMAPPING', 'Spam Field Mapping'))->setDescription(_t('EditableSpamProtectionField.SPAMFIELDMAPPINGDESCRIPTION', 'Select the form fields that correspond to any relevant spam protection identifiers'));
     // Generate field specific settings
     $mappableFields = Config::inst()->get('FormSpamProtectionExtension', 'mappable_fields');
     $mappableFieldsMerged = array_combine($mappableFields, $mappableFields);
     foreach ($this->getCandidateFields() as $otherField) {
         $mapSetting = "Map-{$otherField->Name}";
         $fieldOption = DropdownField::create($this->getSettingName($mapSetting), $otherField->Title, $mappableFieldsMerged, $this->getSetting($mapSetting))->setEmptyString('');
         $mapGroup->push($fieldOption);
     }
     $fields->insertBefore($mapGroup, $this->getSettingName('ExtraClass'));
     return $fields;
 }
コード例 #11
0
 function getFieldConfiguration()
 {
     $fields = parent::getFieldConfiguration();
     // eventually replace hard-coded "Fields"?
     $baseName = "Fields[{$this->ID}]";
     $ShowCalendar = $this->getSetting('ShowCalendar') ? $this->getSetting('ShowCalendar') : '0';
     $OnlyPastDates = $this->getSetting('OnlyPastDates') ? $this->getSetting('OnlyPastDates') : '0';
     $OnlyFutureDates = $this->getSetting('OnlyFutureDates') ? $this->getSetting('OnlyFutureDates') : '0';
     $MonthBeforeDay = $this->getSetting('MonthBeforeDay') ? $this->getSetting('MonthBeforeDay') : '0';
     $ExplanationForEnteringDates = $this->getSetting('ExplanationForEnteringDates') ? $this->getSetting('ExplanationForEnteringDates') : '';
     $extraFields = new FieldList(new FieldGroup(_t('SimpleDateField_Editable.DATESETTINGS', 'Date Settings'), new CheckboxField($baseName . "[CustomSettings][ShowCalendar]", "Show Calendar", $ShowCalendar), new CheckboxField($baseName . "[CustomSettings][OnlyPastDates]", "Only Past Dates?", $OnlyPastDates), new CheckboxField($baseName . "[CustomSettings][OnlyFutureDates]", "Only Future Dates?", $OnlyFutureDates), new CheckboxField($baseName . "[CustomSettings][MonthBeforeDay]", "Month before day (e.g. Jan 11 2011)?", $MonthBeforeDay), new TextField($baseName . "[CustomSettings][ExplanationForEnteringDates]", "Explanation for entering dates", $ExplanationForEnteringDates)));
     $fields->merge($extraFields);
     return $fields;
 }
コード例 #12
0
ファイル: EditableCheckbox.php プロジェクト: 8secs/cocina
 public function getFieldConfiguration()
 {
     $options = parent::getFieldConfiguration();
     $options->push(new CheckboxField("Fields[{$this->ID}][CustomSettings][Default]", _t('EditableFormField.CHECKEDBYDEFAULT', 'Checked by Default?'), $this->getSetting('Default')));
     return $options;
 }