function displaySettingsPanel(&$wrapper, $errors = NULL)
 {
     parent::displaySettingsPanel($wrapper, $errors);
     $label = Widget::Label(__('URL Expression'));
     $label->appendChild(Widget::Input('fields[' . $this->get('sortorder') . '][url_expression]', $this->get('url_expression')));
     $wrapper->appendChild($label);
 }
 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);
 }
Example #3
0
 public function displaySettingsPanel(&$wrapper, $errors = null)
 {
     parent::displaySettingsPanel($wrapper, $errors);
     ## Destination Folder
     $ignore = array('/workspace/events', '/workspace/data-sources', '/workspace/text-formatters', '/workspace/pages', '/workspace/utilities');
     $directories = General::listDirStructure(WORKSPACE, null, true, DOCROOT, $ignore);
     $label = Widget::Label(__('Destination Directory'));
     $options = array();
     $options[] = array('/workspace', false, '/workspace');
     if (!empty($directories) && is_array($directories)) {
         foreach ($directories as $d) {
             $d = '/' . trim($d, '/');
             if (!in_array($d, $ignore)) {
                 $options[] = array($d, $this->get('destination') == $d, $d);
             }
         }
     }
     $label->appendChild(Widget::Select('fields[' . $this->get('sortorder') . '][destination]', $options));
     if (isset($errors['destination'])) {
         $wrapper->appendChild(Widget::wrapFormElementWithError($label, $errors['destination']));
     } else {
         $wrapper->appendChild($label);
     }
     $this->buildValidationSelect($wrapper, $this->get('validator'), 'fields[' . $this->get('sortorder') . '][validator]', 'upload');
     $div = new XMLElement('div', NULL, array('class' => 'compact'));
     $this->appendRequiredCheckbox($div);
     $this->appendShowColumnCheckbox($div);
     $wrapper->appendChild($div);
 }
 public function displaySettingsPanel(&$wrapper, $errors = null)
 {
     parent::displaySettingsPanel($wrapper, $errors);
     $order = $this->get('sortorder');
     // Expression
     $div = new XMLElement('div');
     $label = Widget::Label(__('Expression'));
     $label->appendChild(Widget::Input("fields[{$order}][expression]", $this->get('expression')));
     $help = new XMLElement('p');
     $help->setAttribute('class', 'help');
     $help->setValue(__('To access the other fields, use XPath: <code>{entry/field-one} static text {entry/field-two}</code>.'));
     $div->appendChild($label);
     $div->appendChild($help);
     $wrapper->appendChild($div);
     // Visibility settings
     $group = new XMLElement('div');
     $group->setAttribute('class', 'two columns');
     $label = Widget::Label();
     $label->setAttribute('class', 'column');
     $input = Widget::Input("fields[{$order}][hide]", 'yes', 'checkbox');
     if ($this->get('hide') == 'yes') {
         $input->setAttribute('checked', 'checked');
     }
     $label->setValue($input->generate() . __(' Hide this field on publish page'));
     $group->appendChild($label);
     $this->appendShowColumnCheckbox($group);
     $wrapper->appendChild($group);
 }
Example #5
0
 /**
  * Displays setting panel in section editor. 
  * 
  * @param XMLElement $wrapper - parent element wrapping the field
  * @param array $errors - array with field errors, $errors['name-of-field-element']
  */
 function displaySettingsPanel(&$wrapper, $errors = NULL)
 {
     // initialize field settings based on class defaults (name, placement)
     parent::displaySettingsPanel($wrapper, $errors);
     $this->appendShowColumnCheckbox($wrapper);
     // format
     $label = new XMLElement('label', __('Date format') . '<i>' . __('Use comma to separate date and time') . '</i>');
     $label->appendChild(Widget::Input('fields[' . $this->get('sortorder') . '][format]', $this->get('format') ? $this->get('format') : 'd MMMM yyyy, HH:mm'));
     $wrapper->appendChild($label);
     // prepopulate
     $label = Widget::Label();
     $input = Widget::Input('fields[' . $this->get('sortorder') . '][prepopulate]', 'yes', 'checkbox');
     if ($this->get('prepopulate') != 'no') {
         $input->setAttribute('checked', 'checked');
     }
     $label->setValue(__('%s Pre-populate this field with today\'s date', array($input->generate())));
     $wrapper->appendChild($label);
     // allow multiple
     $label = Widget::Label();
     $input = Widget::Input('fields[' . $this->get('sortorder') . '][allow_multiple_dates]', 'yes', 'checkbox');
     if ($this->get('allow_multiple_dates') != 'no') {
         $input->setAttribute('checked', 'checked');
     }
     $label->setValue(__('%s Allow multiple dates', array($input->generate())));
     $wrapper->appendChild($label);
 }
Example #6
0
 public function displaySettingsPanel(XMLElement &$wrapper, $errors = null)
 {
     parent::displaySettingsPanel($wrapper, $errors);
     // Destination Folder
     $ignore = array('/workspace/events', '/workspace/data-sources', '/workspace/text-formatters', '/workspace/pages', '/workspace/utilities');
     $directories = General::listDirStructure(WORKSPACE, null, true, DOCROOT, $ignore);
     $label = Widget::Label(__('Destination Directory'));
     $options = array();
     $options[] = array('/workspace', false, '/workspace');
     if (!empty($directories) && is_array($directories)) {
         foreach ($directories as $d) {
             $d = '/' . trim($d, '/');
             if (!in_array($d, $ignore)) {
                 $options[] = array($d, $this->get('destination') == $d, $d);
             }
         }
     }
     $label->appendChild(Widget::Select('fields[' . $this->get('sortorder') . '][destination]', $options));
     if (isset($errors['destination'])) {
         $wrapper->appendChild(Widget::Error($label, $errors['destination']));
     } else {
         $wrapper->appendChild($label);
     }
     // Validation rule
     $this->buildValidationSelect($wrapper, $this->get('validator'), 'fields[' . $this->get('sortorder') . '][validator]', 'upload', $errors);
     // Requirements and table display
     $this->appendStatusFooter($wrapper);
 }
 public function displaySettingsPanel(&$wrapper, $errors = NULL)
 {
     parent::displaySettingsPanel($wrapper, $errors);
     $sectionManager = new SectionManager($this->_engine);
     $sections = $sectionManager->fetch(NULL, 'ASC', 'sortorder');
     $options = array();
     // iterate over sections to build list of fields
     if (is_array($sections) && !empty($sections)) {
         foreach ($sections as $section) {
             $section_fields = $section->fetchFields();
             if (!is_array($section_fields)) {
                 continue;
             }
             $fields = array();
             foreach ($section_fields as $f) {
                 // only show select box link fields
                 if ($f->get('type') == 'selectbox_link') {
                     $fields[] = array($f->get('id'), $this->get('related_sbl_id') == $f->get('id'), $f->get('label'));
                 }
             }
             if (!empty($fields)) {
                 $options[] = array('label' => $section->get('name'), 'options' => $fields);
             }
         }
     }
     $group = new XMLElement('div', NULL, array('class' => 'group'));
     $label = Widget::Label(__('Child Select Box Link'));
     $label->appendChild(Widget::Select('fields[' . $this->get('sortorder') . '][related_sbl_id]', $options));
     if (isset($errors['related_sbl_id'])) {
         $group->appendChild(Widget::wrapFormElementWithError($label, $errors['related_sbl_id']));
     } else {
         $group->appendChild($label);
     }
     $wrapper->appendChild($group);
 }
 function displaySettingsPanel(&$wrapper, $errors = NULL)
 {
     Field::displaySettingsPanel($wrapper, $errors);
     $div = new XMLElement('div', NULL, array('class' => 'group'));
     $ignore = array('/workspace/events', '/workspace/data-sources', '/workspace/text-formatters', '/workspace/pages', '/workspace/utilities');
     $directories = General::listDirStructure(WORKSPACE, NULL, 'asc', DOCROOT, $ignore);
     $label = Widget::Label(__('Destination Directory'));
     $options = array();
     $options[] = array('/workspace', false, '/workspace');
     if (!empty($directories) && is_array($directories)) {
         foreach ($directories as $d) {
             $d = '/' . trim($d, '/');
             if (!in_array($d, $ignore)) {
                 $options[] = array($d, $this->get('destination') == $d, $d);
             }
         }
     }
     $label->appendChild(Widget::Select('fields[' . $this->get('sortorder') . '][destination]', $options));
     if (isset($errors['destination'])) {
         $wrapper->appendChild(Widget::wrapFormElementWithError($label, $errors['destination']));
     } else {
         $wrapper->appendChild($label);
     }
     $this->appendRequiredCheckbox($wrapper);
     $label = Widget::Label();
     $input = Widget::Input('fields[' . $this->get('sortorder') . '][allow_multiple_selection]', 'yes', 'checkbox');
     if ($this->get('allow_multiple_selection') == 'yes') {
         $input->setAttribute('checked', 'checked');
     }
     $label->setValue(__('%s Allow selection of multiple options', array($input->generate())));
     $wrapper->appendChild($label);
     $this->appendShowColumnCheckbox($wrapper);
 }
Example #9
0
 public function displaySettingsPanel(&$wrapper, $errors = null)
 {
     parent::displaySettingsPanel($wrapper, $errors);
     $document = $wrapper->ownerDocument;
     $options_list = $document->createElement('ul');
     $options_list->setAttribute('class', 'options-list');
     $this->appendShowColumnCheckbox($options_list);
     $this->appendRequiredCheckbox($options_list);
     ## Allow multiple selection
     $label = Widget::Label(__('Allow selection of multiple users'));
     $input = Widget::Input('allow-multiple-selection', 'yes', 'checkbox');
     if ($this->{'allow-multiple-selection'} == 'yes') {
         $input->setAttribute('checked', 'checked');
     }
     $label->prependChild($input);
     $item = $document->createElement('li');
     $item->appendChild($label);
     $options_list->appendChild($item);
     ## Default to current logged in user
     $label = Widget::Label(__('Select current user by default'));
     $input = Widget::Input('default-to-current-user', 'yes', 'checkbox');
     if ($this->{'default-to-current-user'} == 'yes') {
         $input->setAttribute('checked', 'checked');
     }
     $label->prependChild($input);
     $item = $document->createElement('li');
     $item->appendChild($label);
     $options_list->appendChild($item);
     $wrapper->appendChild($options_list);
 }
Example #10
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);
 }
 public function displaySettingsPanel(&$wrapper, $errors = null)
 {
     parent::displaySettingsPanel($wrapper, $errors);
     $order = $this->get('sortorder');
     // Destination --------------------------------------------------------
     $ignore = array('events', 'data-sources', 'text-formatters', 'pages', 'utilities');
     $directories = General::listDirStructure(WORKSPACE, true, 'asc', DOCROOT, $ignore);
     $label = Widget::Label('Destination Directory');
     $options = array(array('/workspace', false, '/workspace'));
     if (!empty($directories) and is_array($directories)) {
         foreach ($directories as $d) {
             $d = '/' . trim($d, '/');
             if (!in_array($d, $ignore)) {
                 $options[] = array($d, $this->get('destination') == $d, $d);
             }
         }
     }
     $label->appendChild(Widget::Select("fields[{$order}][destination]", $options));
     if (isset($errors['destination'])) {
         $label = Widget::wrapFormElementWithError($label, $errors['destination']);
     }
     $wrapper->appendChild($label);
     // Validator ----------------------------------------------------------
     $this->buildValidationSelect($wrapper, $this->get('validator'), "fields[{$order}][validator]", 'upload');
     $this->appendRequiredCheckbox($wrapper);
     $this->appendShowColumnCheckbox($wrapper);
 }
 public function displaySettingsPanel(&$wrapper, $errors = null)
 {
     parent::displaySettingsPanel($wrapper, $errors);
     $order = $this->get('sortorder');
     $label = Widget::Label('Anchor URL (XPath expression)');
     $label->appendChild(Widget::Input("fields[{$order}][expression]", $this->get('expression')));
     $help = new XMLElement('p', 'To access the other fields, use XPath: <code>{entry/field-one} static text {entry/field-two}</code>.');
     $help->setAttribute('class', 'help');
     $wrapper->appendChild($label);
     $label = Widget::Label();
     $input = Widget::Input("fields[{$order}][new_window]", 'yes', 'checkbox');
     if ($this->get('new_window') == 'yes') {
         $input->setAttribute('checked', 'checked');
     }
     $label->setValue($input->generate() . ' Open links in a new window');
     $wrapper->appendChild($label);
     $label = Widget::Label();
     $input = Widget::Input("fields[{$order}][hide]", 'yes', 'checkbox');
     if ($this->get('hide') == 'yes') {
         $input->setAttribute('checked', 'checked');
     }
     $label->setValue($input->generate() . ' Hide this field on publish page');
     $wrapper->appendChild($label);
     $this->appendShowColumnCheckbox($wrapper);
 }
Example #13
0
 public function displaySettingsPanel(SymphonyDOMElement $wrapper, MessageStack $errors)
 {
     parent::displaySettingsPanel($wrapper, $errors);
     $document = $wrapper->ownerDocument;
     /*---------------------------------------------------------------------
     			Text Formatter
     		---------------------------------------------------------------------*/
     $this->appendFormatterSelect($wrapper, $this->{'text-formatter'}, 'text-formatter');
     /*---------------------------------------------------------------------
     			Validator
     		---------------------------------------------------------------------*/
     $this->appendValidationSelect($wrapper, $this->{'text-validator'}, 'text-validator');
     /*---------------------------------------------------------------------
     			Options
     		---------------------------------------------------------------------*/
     $options_list = $document->createElement('ul');
     $options_list->setAttribute('class', 'options-list');
     $this->appendShowColumnCheckbox($options_list);
     $this->appendRequiredCheckbox($options_list);
     $label = Widget::Label(__('Output with handles'));
     $input = Widget::Input('text-handle', 'yes', 'checkbox');
     if ($this->{'text-handle'} == 'yes') {
         $input->setAttribute('checked', 'checked');
     }
     $label->prependChild($input);
     $item = $document->createElement('li');
     $item->appendChild($label);
     $options_list->appendChild($item);
     $wrapper->appendChild($options_list);
 }
 public function displaySettingsPanel(&$wrapper, $errors = NULL)
 {
     parent::displaySettingsPanel($wrapper, $errors);
     $label = Widget::Label(__('Start Number'));
     $label->appendChild(WIDGET::Input('fields[' . $this->get('sortorder') . '][start_number]', $this->get('start_number')));
     $wrapper->appendChild($label);
     $this->appendShowColumnCheckbox($wrapper);
 }
 public function displaySettingsPanel(XMLElement &$wrapper, $errors = null)
 {
     parent::displaySettingsPanel($wrapper, $errors);
     // Validation rule
     $this->buildValidationSelect($wrapper, $this->get('validator'), 'fields[' . $this->get('sortorder') . '][validator]', 'input', $errors);
     // Requirements and table display
     $this->appendStatusFooter($wrapper);
 }
 function displaySettingsPanel(&$wrapper, $errors = NULL)
 {
     parent::displaySettingsPanel($wrapper, $errors);
     $label = Widget::Label('Default Marker Location');
     $label->appendChild(Widget::Input('fields[' . $this->get('sortorder') . '][default_location]', $this->get('default_location')));
     $wrapper->appendChild($label);
     $this->appendRequiredCheckbox($wrapper);
     $this->appendShowColumnCheckbox($wrapper);
 }
 public function displaySettingsPanel(&$wrapper, $errors = null)
 {
     parent::displaySettingsPanel($wrapper, $errors);
     $order = $this->get('sortorder');
     $label = Widget::Label(__('Options'));
     $label->appendChild(Widget::Input("fields[{$order}][options]", General::sanitize($this->get('options'))));
     $wrapper->appendChild($label);
     $this->appendShowColumnCheckbox($wrapper);
 }
 public function displaySettingsPanel(&$wrapper, $errors = null)
 {
     parent::displaySettingsPanel($wrapper);
     $order = $this->get('sortorder');
     $this->buildValidationSelect($wrapper, $this->get('valid_status'), 'Return Status', "fields[{$order}][valid_status]");
     $this->buildValidationSelect($wrapper, $this->get('valid_type'), 'Content Type', "fields[{$order}][valid_type]");
     $this->appendRequiredCheckbox($wrapper);
     $this->appendShowColumnCheckbox($wrapper);
 }
 public function displaySettingsPanel(&$wrapper, $errors = NULL)
 {
     parent::displaySettingsPanel($wrapper, $errors);
     $label = Widget::Label('Update cache (minutes; leave blank to never update) <i>Optional</i>');
     $label->appendChild(Widget::Input("fields[{$this->get('sortorder')}][refresh]", $this->get('refresh')));
     $wrapper->appendChild($label);
     $this->appendRequiredCheckbox($wrapper);
     $this->appendShowColumnCheckbox($wrapper);
 }
 public function displaySettingsPanel(&$wrapper, $errors = NULL)
 {
     Field::displaySettingsPanel($wrapper, $errors);
     $div = new XMLElement('div', NULL, array('class' => 'group'));
     $label = Widget::Label('Options');
     $sectionManager = new SectionManager($this->_engine);
     $sections = $sectionManager->fetch(NULL, 'ASC', 'name');
     $field_groups = array();
     if (is_array($sections) && !empty($sections)) {
         foreach ($sections as $section) {
             $field_groups[$section->get('id')] = array('fields' => $section->fetchFields(), 'section' => $section);
         }
     }
     $options = array();
     foreach ($field_groups as $group) {
         if (!is_array($group['fields'])) {
             continue;
         }
         $fields = array();
         foreach ($group['fields'] as $f) {
             if ($f->get('id') != $this->get('id') && $f->canPrePopulate() && !is_null($this->get('related_field_id'))) {
                 $fields[] = array($f->get('id'), in_array($f->get('id'), $this->get('related_field_id')), $f->get('label'));
             }
         }
         if (is_array($fields) && !empty($fields)) {
             $options[] = array('label' => $group['section']->get('name'), 'options' => $fields);
         }
     }
     $label->appendChild(Widget::Select('fields[' . $this->get('sortorder') . '][related_field_id][]', $options, array('multiple' => 'multiple')));
     $div->appendChild($label);
     // set field type
     $label = Widget::Label('Field Type');
     $type_options = array(array('select', $this->get('field_type') == 'select', 'Select Box'), array('autocomplete', $this->get('field_type') == 'autocomplete', 'Autocomplete Input'));
     $label->appendChild(Widget::Select('fields[' . $this->get('sortorder') . '][field_type]', $type_options));
     $div->appendChild($label);
     // Allow selection of multiple items
     $label = Widget::Label();
     $input = Widget::Input('fields[' . $this->get('sortorder') . '][allow_multiple_selection]', 'yes', 'checkbox');
     if ($this->get('allow_multiple_selection') == 'yes') {
         $input->setAttribute('checked', 'checked');
     }
     $label->setValue($input->generate() . ' Allow selection of multiple options');
     $div->appendChild($label);
     if (isset($errors['related_field_id'])) {
         $wrapper->appendChild(Widget::wrapFormElementWithError($div, $errors['related_field_id']));
     } else {
         $wrapper->appendChild($div);
     }
     ## Maximum entries
     $label = Widget::Label();
     $input = Widget::Input('fields[' . $this->get('sortorder') . '][limit]', $this->get('limit'));
     $input->setAttribute('size', '3');
     $label->setValue('Limit to the ' . $input->generate() . ' most recent entries');
     $wrapper->appendChild($label);
     $this->appendShowColumnCheckbox($wrapper);
     $this->appendRequiredCheckbox($wrapper);
 }
Example #21
0
 public function displaySettingsPanel(XMLElement &$wrapper, $errors = null)
 {
     parent::displaySettingsPanel($wrapper, $errors);
     $this->buildValidationSelect($wrapper, $this->get('validator'), 'fields[' . $this->get('sortorder') . '][validator]');
     $div = new XMLElement('div', NULL, array('class' => 'two columns'));
     $this->appendRequiredCheckbox($div);
     $this->appendShowColumnCheckbox($div);
     $wrapper->appendChild($div);
 }
 public function displaySettingsPanel(&$wrapper, $errors = NULL)
 {
     parent::displaySettingsPanel($wrapper, $errors);
     $order = $this->get('sortorder');
     # Panel
     $label = new XMLElement("label", "Note");
     $label->appendChild(new XMLElement("i", "The raw output will be shown on the 'Publish' screen", array("class" => "help")));
     $label->appendChild(Widget::Textarea("fields[{$order}][note]", 5, 40, $this->get('note')));
     $wrapper->appendChild($label);
 }
 public function displaySettingsPanel(&$wrapper, $errors = null)
 {
     parent::displaySettingsPanel($wrapper, $errors);
     $fieldset = new XMLElement('fieldset');
     $row = new XMLElement('div', null, array('class' => 'two columns'));
     $this->appendShowColumnCheckbox($row);
     $this->appendShowTimeColumnCheckbox($row);
     $this->appendUseTimeAgoColumnCheckbox($row);
     $fieldset->appendChild($row);
     $wrapper->appendChild($fieldset);
 }
Example #24
0
 function displaySettingsPanel(&$wrapper, $errors = NULL)
 {
     parent::displaySettingsPanel($wrapper, $errors);
     $label = Widget::Label(__('Connected Upload Field'));
     $sectionManager = new SectionManager($this->_engine);
     $sections = $sectionManager->fetch(NULL, 'ASC', 'name');
     $field_groups = array();
     if (is_array($sections) && !empty($sections)) {
         foreach ($sections as $section) {
             $field_groups[$section->get('id')] = array('fields' => $section->fetchFields(), 'section' => $section);
         }
     }
     $options = array(array('', false, __('None Selected')));
     foreach ($field_groups as $group) {
         if (!is_array($group['fields'])) {
             continue;
         }
         $fields = array();
         foreach ($group['fields'] as $f) {
             if ($f->get('id') != $this->get('id') && $f->get('type') == 'upload') {
                 $fields[] = array($f->get('id'), $this->get('related_field_id') == $f->get('id'), $f->get('label'));
             }
         }
         if (is_array($fields) && !empty($fields)) {
             $options[] = array('label' => $group['section']->get('name'), 'options' => $fields);
         }
     }
     $label->appendChild(Widget::Select('fields[' . $this->get('sortorder') . '][related_field_id]', $options));
     if (isset($errors['related_field_id'])) {
         $wrapper->appendChild(Widget::wrapFormElementWithError($label, $errors['related_field_id']));
     } else {
         $wrapper->appendChild($label);
     }
     $label = Widget::Label(__('Filter by Tags or Categories') . '<i>' . __('Comma Separated List') . '</i>');
     $label->appendChild(Widget::Input('fields[' . $this->get('sortorder') . '][filter_tags]', $this->get('filter_tags')));
     $wrapper->appendChild($label);
     $wrapper->appendChild($this->getFilter());
     $label = Widget::Label();
     $input = Widget::Input('fields[' . $this->get('sortorder') . '][allow_multiple_selection]', 'yes', 'checkbox');
     if ($this->get('allow_multiple_selection') == 'yes') {
         $input->setAttribute('checked', 'checked');
     }
     $label->setValue(__('%s Allow selection of multiple options', array($input->generate())));
     $wrapper->appendChild($label);
     $label = Widget::Label();
     $input = Widget::Input('fields[' . $this->get('sortorder') . '][show_count]', 'yes', 'checkbox');
     if ($this->get('show_count') == 'yes') {
         $input->setAttribute('checked', 'checked');
     }
     $label->setValue(__('%s Show file count instead of file names in entry overview', array($input->generate())));
     $wrapper->appendChild($label);
     $this->appendShowColumnCheckbox($wrapper);
 }
 public function displaySettingsPanel(&$wrapper, $errors = null)
 {
     parent::displaySettingsPanel($wrapper, $errors);
     $order = $this->get('sortorder');
     // Group Size ---------------------------------------------------------
     $ignore = array('events', 'data-sources', 'text-formatters', 'pages', 'utilities');
     $directories = General::listDirStructure(WORKSPACE, true, 'asc', DOCROOT, $ignore);
     $label = Widget::Label('Group Size');
     $input = Widget::Input("fields[{$order}][nth_entry]", $this->get('nth_entry'));
     $label->appendChild($input);
     $wrapper->appendChild($label);
 }
 public function displaySettingsPanel(SymphonyDOMElement $wrapper, MessageStack $errors)
 {
     parent::displaySettingsPanel($wrapper, $errors);
     $document = $wrapper->ownerDocument;
     /*---------------------------------------------------------------------
     			Options
     		---------------------------------------------------------------------*/
     $options_list = $document->createElement('ul');
     $options_list->setAttribute('class', 'options-list');
     $this->appendShowColumnCheckbox($options_list);
     $wrapper->appendChild($options_list);
 }
 public function displaySettingsPanel(&$wrapper)
 {
     parent::displaySettingsPanel($wrapper);
     $label = Widget::Label();
     $input = Widget::Input('fields[' . $this->get('sortorder') . '][pre_populate]', 'yes', 'checkbox');
     if ($this->get('pre_populate') == 'yes') {
         $input->setAttribute('checked', 'checked');
     }
     $label->setValue($input->generate() . ' Pre-populate this field with today\'s date');
     $wrapper->appendChild($label);
     $this->appendShowColumnCheckbox($wrapper);
 }
    public function displaySettingsPanel(&$wrapper, $errors = null)
    {
        parent::displaySettingsPanel($wrapper, $errors);
        $order = $this->get('sortorder');
        /*---------------------------------------------------------------------
        			Expression
        		---------------------------------------------------------------------*/
        $group = new XMLElement('div');
        $group->setAttribute('class', 'group');
        $div = new XMLElement('div');
        $label = Widget::Label('Expression');
        $label->appendChild(Widget::Input("fields[{$order}][expression]", $this->get('expression')));
        $help = new XMLElement('p');
        $help->setAttribute('class', 'help');
        $help->setValue('
				To access the other fields, use XPath: <code>{entry/field-one}
				static text {entry/field-two}</code>.
			');
        $div->appendChild($label);
        $div->appendChild($help);
        $group->appendChild($div);
        /*---------------------------------------------------------------------
        			Text Formatter
        		---------------------------------------------------------------------*/
        $group->appendChild($this->buildFormatterSelect($this->get('formatter'), "fields[{$order}][formatter]", 'Text Formatter'));
        $wrapper->appendChild($group);
        /*---------------------------------------------------------------------
        			Allow Override
        		---------------------------------------------------------------------*/
        /*
        $label = Widget::Label();
        $input = Widget::Input("fields[{$order}][allow_override]", 'yes', 'checkbox');
        
        if ($this->get('allow_override') == 'yes') {
        	$input->setAttribute('checked', 'checked');
        }
        
        $label->setValue($input->generate() . ' Allow value to be manually overridden');
        $wrapper->appendChild($label);
        */
        /*---------------------------------------------------------------------
        			Hide input
        		---------------------------------------------------------------------*/
        $label = Widget::Label();
        $input = Widget::Input("fields[{$order}][hide]", 'yes', 'checkbox');
        if ($this->get('hide') == 'yes') {
            $input->setAttribute('checked', 'checked');
        }
        $label->setValue($input->generate() . ' Hide this field on publish page');
        $wrapper->appendChild($label);
        $this->appendShowColumnCheckbox($wrapper);
    }
Example #29
0
 public function displaySettingsPanel(SymphonyDOMElement $wrapper, MessageStack $errors)
 {
     parent::displaySettingsPanel($wrapper, $errors);
     $document = $wrapper->ownerDocument;
     $options_list = $document->createElement('ul');
     $options_list->setAttribute('class', 'options-list');
     $this->appendShowColumnCheckbox($options_list);
     $this->appendRequiredCheckbox($options_list);
     // 	TODO: Possible allow the switching between INT, DOUBLE table column types
     //	This would need to trigger a MySQL ALTER COLUMN call if it happened, or that option
     //	be made static after creation.
     $wrapper->appendChild($options_list);
 }
 function displaySettingsPanel(&$wrapper, $errors = NULL)
 {
     parent::displaySettingsPanel($wrapper, $errors);
     $this->appendRequiredCheckbox($wrapper);
     $this->appendShowColumnCheckbox($wrapper);
     $label = Widget::Label();
     $input = Widget::Input('fields[' . $this->get('sortorder') . '][force_sort]', 'yes', 'checkbox');
     if ($this->get('force_sort') == 'yes') {
         $input->setAttribute('checked', 'checked');
     }
     $label->setValue(__('%s Disable sorting of other columns when enabled', array($input->generate())));
     $wrapper->appendChild($label);
 }