function displaySettingsPanel(&$wrapper, $errors = NULL)
 {
     // Initialize field settings based on class defaults (name, placement)
     parent::displaySettingsPanel($wrapper, $errors);
     // Field Number Chooser
     $fieldset = new XMLElement('fieldset');
     if (!$this->get('id') && $errors == NULL) {
         $this->set('fieldcount', 2);
         $group = new XMLElement('label', 'Number of text inputs per row<i>IMPORTANT: This cannot be changed once you save!</i><input name="fields[' . $this->get('sortorder') . '][fieldcount]" type="text" value="' . $this->get('fieldcount') . '" />');
     } else {
         $this->get('fieldcount');
         $group = new XMLElement('label', 'Number of text inputs per row<i>Database table created. This value can no longer be changed.</i><input name="fields[' . $this->get('sortorder') . '][fielddisplay]" type="text" disabled="disabled" value="' . $this->get('fieldcount') . '" /><input name="fields[' . $this->get('sortorder') . '][fieldcount]" type="hidden" value="' . $this->get('fieldcount') . '" />');
     }
     $fieldset->appendChild($group);
     $wrapper->appendChild($fieldset);
     // Behaviour
     $fieldset = Stage::displaySettings($this->get('id'), $this->get('sortorder'), __('Behaviour'), array('constructable', 'draggable'));
     $group = $fieldset->getChildren();
     $wrapper->appendChild($fieldset);
     // Add Custom Schema option
     $fieldset = new XMLElement('fieldset', '<legend>Advanced</legend>');
     $group = new XMLElement('label', 'Custom Schema<i>Optional. Read the documentation before putting anything here!</i>');
     $group->appendChild(Widget::Input('fields[' . $this->get('sortorder') . '][schema]', $this->get('schema')));
     $fieldset->appendChild($group);
     $wrapper->appendChild($fieldset);
     // General
     $fieldset = new XMLElement('fieldset');
     $group = new XMLElement('div', NULL, array('class' => 'group'));
     $this->appendRequiredCheckbox($group);
     $this->appendShowColumnCheckbox($group);
     $fieldset->appendChild($group);
     $wrapper->appendChild($fieldset);
 }
Exemple #2
0
 /**
  * @see http://symphony-cms.com/learn/api/2.2/toolkit/field/#displaySettingsPanel
  */
 function displaySettingsPanel(&$wrapper, $errors = NULL)
 {
     // Initialize field settings based on class defaults (name, placement)
     parent::displaySettingsPanel($wrapper, $errors);
     /*-----------------------------------------------------------------------*/
     // Behaviour
     $fieldset = Stage::displaySettings($this->get('id'), $this->get('sortorder'), __('Behaviour'), array('constructable', 'draggable'));
     $group = $fieldset->getChildren();
     // Handle missing settings
     if (!$this->get('id') && $errors == NULL) {
         $this->set('prepopulate', 1);
         $this->set('time', 1);
         $this->set('range', 1);
     }
     // Time
     $setting = new XMLElement('label', '<input name="fields[' . $this->get('sortorder') . '][time]" value="yes" type="checkbox"' . ($this->get('time') == 0 ? '' : ' checked="checked"') . '/> ' . __('Allow time editing') . ' <i>' . __('This will display date and time in the interface') . '</i>');
     $group[0]->appendChild($setting);
     // Ranges
     $setting = new XMLElement('label', '<input name="fields[' . $this->get('sortorder') . '][range]" value="yes" type="checkbox"' . ($this->get('range') == 0 ? '' : ' checked="checked"') . '/> ' . __('Allow date ranges') . ' <i>' . __('This will enable range editing') . '</i>');
     $group[0]->appendChild($setting);
     // Prepopulate
     $setting = new XMLElement('label', '<input name="fields[' . $this->get('sortorder') . '][prepopulate]" value="yes" type="checkbox"' . ($this->get('prepopulate') == 0 ? '' : ' checked="checked"') . '/> ' . __('Pre-populate field') . ' <i>' . __('This will automatically add the current date to new entries') . '</i>');
     $group[0]->appendChild($setting);
     // Append behaviour settings
     $wrapper->appendChild($fieldset);
     /*-----------------------------------------------------------------------*/
     // General
     $fieldset = new XMLElement('fieldset');
     $group = new XMLElement('div', NULL, array('class' => 'group'));
     $this->appendRequiredCheckbox($group);
     $this->appendShowColumnCheckbox($group);
     $fieldset->appendChild($group);
     $wrapper->appendChild($fieldset);
 }