Commit 88cbedb8 authored by alexpott's avatar alexpott
Browse files

Issue #2046537 by DuaelFr: End with 'any' label configuration to improve...

Issue #2046537 by DuaelFr: End with 'any' label configuration to improve consistency and localization.
parent 186312d6
......@@ -16,7 +16,6 @@ ui:
custom_theme: _default
always_live_preview: '1'
always_live_preview_button: '1'
exposed_filter_any_label: new_any
field_rewrite_elements:
div: DIV
span: SPAN
......
......@@ -156,13 +156,9 @@ protected function valueForm(&$form, &$form_state) {
if (!empty($form_state['exposed']) && !isset($form_state['input'][$identifier])) {
$form_state['input'][$identifier] = $this->value;
}
// If we're configuring an exposed filter, add an <Any> option.
// If we're configuring an exposed filter, add an - Any - option.
if (empty($form_state['exposed']) || empty($this->options['expose']['required'])) {
$any_label = config('views.settings')->get('ui.exposed_filter_any_label') == 'old_any' ? '<Any>' : t('- Any -');
if ($form['value']['#type'] != 'select') {
$any_label = check_plain($any_label);
}
$form['value']['#options'] = array('All' => $any_label) + $form['value']['#options'];
$form['value']['#options'] = array('All' => t('- Any -')) + $form['value']['#options'];
}
}
}
......
......@@ -733,10 +733,7 @@ protected function buildGroupOptions() {
*/
public function groupForm(&$form, &$form_state) {
if (!empty($this->options['group_info']['optional']) && !$this->multipleExposedInput()) {
$old_any = $this->options['group_info']['widget'] == 'select' ? '<Any>' : '&lt;Any&gt;';
$any_label = config('views.settings')->get('ui.exposed_filter_any_label') == 'old_any' ? $old_any : t('- Any -');
$groups = array('All' => $any_label);
$groups = array('All' => t('- Any -'));
}
foreach ($this->options['group_info']['group_items'] as $id => $group) {
if (!empty($group['title'])) {
......@@ -936,7 +933,7 @@ protected function buildExposedFiltersGroupForm(&$form, &$form_state) {
'#default_value' => $this->options['group_info']['remember'],
);
$groups = array('All' => '- Any -'); // The string '- Any -' will not be rendered see @theme_views_ui_build_group_filter_form
$groups = array('All' => t('- Any -')); // The string '- Any -' will not be rendered see @theme_views_ui_build_group_filter_form
// Provide 3 options to start when we are in a new group.
if (count($this->options['group_info']['group_items']) == 0) {
......@@ -1130,8 +1127,7 @@ protected function exposedTranslate(&$form, $type) {
}
if ($type == 'value' && empty($this->always_required) && empty($this->options['expose']['required']) && $form['#type'] == 'select' && empty($form['#multiple'])) {
$any_label = config('views.settings')->get('ui.exposed_filter_any_label') == 'old_any' ? t('<Any>') : t('- Any -');
$form['#options'] = array('All' => $any_label) + $form['#options'];
$form['#options'] = array('All' => t('- Any -')) + $form['#options'];
$form['#default_value'] = 'All';
}
......
Markdown is supported
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