Commit d03acd3c authored by alexpott's avatar alexpott
Browse files

Issue #1831080 by dawehner, IshaDakota, YesCT: Remove the 'More' area from the...

Issue #1831080 by dawehner, IshaDakota, YesCT: Remove the 'More' area from the bottom of handler configuration.
parent 53f96eda
......@@ -33,7 +33,6 @@ public function buildOptionsForm(&$form, &$form_state) {
'#title' => t('Use destination'),
'#description' => t('Add destination to the link'),
'#default_value' => $this->options['destination'],
'#fieldset' => 'more',
);
}
......
......@@ -393,7 +393,6 @@ public function buildOptionsForm(&$form, &$form_state) {
'#options' => drupal_map_assoc($column_names),
'#default_value' => $this->options['click_sort_column'],
'#description' => t('Used by Style: Table to determine the actual column to click sort the field on. The default is usually fine.'),
'#fieldset' => 'more',
);
}
......
......@@ -55,7 +55,6 @@ public function buildOptionsForm(&$form, &$form_state) {
'#type' => 'checkbox',
'#title' => t('Check for new comments as well'),
'#default_value' => !empty($this->options['comments']),
'#fieldset' => 'more',
);
}
}
......
......@@ -44,20 +44,23 @@ protected function defineOptions() {
return $options;
}
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, &$form_state) {
parent::buildOptionsForm($form, $form_state);
$form['format_username'] = array(
'#title' => t('Use formatted username'),
'#type' => 'checkbox',
'#default_value' => !empty($this->options['format_username']),
'#description' => t('If checked, the username will be formatted by the system. If unchecked, it will be displayed raw.'),
'#fieldset' => 'more',
);
$form['overwrite_anonymous'] = array(
'#title' => t('Overwrite the value to display for anonymous users'),
'#type' => 'checkbox',
'#default_value' => !empty($this->options['overwrite_anonymous']),
'#description' => t('Enable to display different text for anonymous users.'),
'#fieldset' => 'more',
);
$form['anonymous_text'] = array(
'#title' => t('Text to display for anonymous users'),
......@@ -68,10 +71,7 @@ public function buildOptionsForm(&$form, &$form_state) {
':input[name="options[overwrite_anonymous]"]' => array('checked' => TRUE),
),
),
'#fieldset' => 'more',
);
parent::buildOptionsForm($form, $form_state);
}
function render_link($data, $values) {
......
......@@ -280,21 +280,34 @@ public function buildOptionsForm(&$form, &$form_state) {
// be moved to their fieldset during preRender.
$form['#pre_render'][] = 'views_ui_pre_render_add_fieldset_markup';
parent::buildOptionsForm($form, $form_state);
$form['fieldsets'] = array(
'#type' => 'value',
'#value' => array('more', 'admin_label'),
);
$form['admin_label'] = array(
'#type' => 'details',
'#title' => t('Administrative title'),
'#collapsed' => TRUE,
'#weight' => 150,
);
$form['admin_label']['admin_label'] = array(
'#type' => 'textfield',
'#title' => t('Administrative title'),
'#description' => t('This title will be displayed on the views edit page instead of the default one. This might be useful if you have the same item twice.'),
'#default_value' => $this->options['admin_label'],
'#fieldset' => 'more',
'#parents' => array('options', 'admin_label'),
);
// This form is long and messy enough that the "Administrative title" option
// belongs in "more options" details at the bottom of the form.
// belongs in "Administrative title" fieldset at the bottom of the form.
$form['more'] = array(
'#type' => 'details',
'#title' => t('More'),
'#collapsed' => TRUE,
'#weight' => 150,
'#weight' => 200,
);
// Allow to alter the default values brought into the form.
// @todo Do we really want to keep this hook.
......
......@@ -550,7 +550,6 @@ public function buildExposeForm(&$form, &$form_state) {
':input[name="options[expose][use_operator]"]' => array('checked' => TRUE),
),
),
'#fieldset' => 'more',
);
}
else {
......@@ -595,7 +594,6 @@ public function buildExposeForm(&$form, &$form_state) {
'#title' => t('Filter identifier'),
'#size' => 40,
'#description' => t('This will appear in the URL after the ? to identify this filter. Cannot be blank.'),
'#fieldset' => 'more',
);
}
......@@ -854,7 +852,6 @@ protected function buildExposedFiltersGroupForm(&$form, &$form_state) {
'#title' => t('Filter identifier'),
'#size' => 40,
'#description' => t('This will appear in the URL after the ? to identify this filter. Cannot be blank.'),
'#fieldset' => 'more',
);
$form['group_info']['label'] = array(
'#type' => 'textfield',
......@@ -909,7 +906,6 @@ protected function buildExposedFiltersGroupForm(&$form, &$form_state) {
'#title' => t('Filter identifier'),
'#size' => 40,
'#description' => t('This will appear in the URL after the ? to identify this filter. Cannot be blank.'),
'#fieldset' => 'more',
);
$form['group_info']['label'] = array(
'#type' => 'textfield',
......
......@@ -275,6 +275,15 @@ function views_ui_pre_render_add_fieldset_markup($form) {
}
}
// Hide the fieldsets if there is nothing in there.
if (isset($form['fieldsets']['#value'])) {
foreach ($form['fieldsets']['#value'] as $fieldset) {
if (!element_children($form[$fieldset])) {
$form[$fieldset]['#access'] = FALSE;
}
}
}
return $form;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment