diff --git a/includes/admin.inc b/includes/admin.inc index df3baa854cadf2abe0e95bc9044152bc5b95060d..b69331e65f2255604f799446a73dfbfb3865ff62 100644 --- a/includes/admin.inc +++ b/includes/admin.inc @@ -2276,7 +2276,7 @@ function views_ui_edit_form_get_bucket($type, $view, $display) { continue; } - $field_name = check_plain($handler->uiName(TRUE)); + $field_name = check_plain($handler->adminLabel(TRUE)); if (!empty($field['relationship']) && !empty($relationships[$field['relationship']])) { $field_name = '(' . $relationships[$field['relationship']] . ') ' . $field_name; } @@ -3371,7 +3371,7 @@ function views_ui_rearrange_form($form, &$form_state) { ); $handler = $display->handler->getHandler($type, $id); if ($handler) { - $name = $handler->uiName() . ' ' . $handler->adminSummary(); + $name = $handler->adminLabel() . ' ' . $handler->adminSummary(); if (!empty($field['relationship']) && !empty($relationships[$field['relationship']])) { $name = '(' . $relationships[$field['relationship']] . ') ' . $name; } @@ -3726,7 +3726,7 @@ function views_ui_rearrange_filter_form($form, &$form_state) { ); if ($handler) { - $name = $handler->uiName() . ' ' . $handler->adminSummary(); + $name = $handler->adminLabel() . ' ' . $handler->adminSummary(); if (!empty($field['relationship']) && !empty($relationships[$field['relationship']])) { $name = '(' . $relationships[$field['relationship']] . ') ' . $name; } @@ -4293,7 +4293,7 @@ function views_ui_config_item_form($form, &$form_state) { ); } - $form['#title'] = t('Configure @type: @item', array('@type' => $types[$type]['lstitle'], '@item' => $handler->uiName())); + $form['#title'] = t('Configure @type: @item', array('@type' => $types[$type]['lstitle'], '@item' => $handler->adminLabel())); if (!empty($handler->definition['help'])) { $form['options']['form_description'] = array( @@ -4476,7 +4476,7 @@ function views_ui_config_item_group_form($type, &$form_state) { $handler->init($view, $item); $types = View::viewsObjectTypes(); - $form['#title'] = t('Configure group settings for @type %item', array('@type' => $types[$type]['lstitle'], '%item' => $handler->uiName())); + $form['#title'] = t('Configure group settings for @type %item', array('@type' => $types[$type]['lstitle'], '%item' => $handler->adminLabel())); $handler->buildGroupByForm($form['options'], $form_state); $form_state['handler'] = &$handler; @@ -4577,7 +4577,7 @@ function views_ui_config_item_extra_form($form, &$form_state) { $handler->init($view, $item); $types = View::viewsObjectTypes(); - $form['#title'] = t('Configure extra settings for @type %item', array('@type' => $types[$type]['lstitle'], '%item' => $handler->uiName())); + $form['#title'] = t('Configure extra settings for @type %item', array('@type' => $types[$type]['lstitle'], '%item' => $handler->adminLabel())); $form['#section'] = $display_id . '-' . $type . '-' . $id; @@ -4648,7 +4648,7 @@ function views_ui_config_style_form($form, &$form_state) { $handler->init($view, $item); $types = View::viewsObjectTypes(); - $form['#title'] = t('Configure summary style for @type %item', array('@type' => $types[$type]['lstitle'], '%item' => $handler->uiName())); + $form['#title'] = t('Configure summary style for @type %item', array('@type' => $types[$type]['lstitle'], '%item' => $handler->adminLabel())); $form['#section'] = $display_id . '-' . $type . '-style-options'; diff --git a/lib/Drupal/views/Plugin/views/HandlerBase.php b/lib/Drupal/views/Plugin/views/HandlerBase.php index 202da4a706ccea8ccbb3d648ef17adfbc817e0de..c825a40aff2847d6302f7a586835f8ab2f61bb6c 100644 --- a/lib/Drupal/views/Plugin/views/HandlerBase.php +++ b/lib/Drupal/views/Plugin/views/HandlerBase.php @@ -143,7 +143,7 @@ protected function defineOptions() { $options['field'] = array('default' => ''); $options['relationship'] = array('default' => 'none'); $options['group_type'] = array('default' => 'group'); - $options['ui_name'] = array('default' => '', 'translatable' => TRUE); + $options['admin_label'] = array('default' => '', 'translatable' => TRUE); return $options; } @@ -151,9 +151,9 @@ protected function defineOptions() { /** * Return a string representing this handler's name in the UI. */ - public function uiName($short = FALSE) { - if (!empty($this->options['ui_name'])) { - $title = check_plain($this->options['ui_name']); + public function adminLabel($short = FALSE) { + if (!empty($this->options['admin_label'])) { + $title = check_plain($this->options['admin_label']); return $title; } $title = ($short && isset($this->definition['title short'])) ? $this->definition['title short'] : $this->definition['title']; @@ -275,11 +275,11 @@ public function buildOptionsForm(&$form, &$form_state) { // be moved to their fieldset during pre_render. $form['#pre_render'][] = 'views_ui_pre_render_add_fieldset_markup'; - $form['ui_name'] = array( + $form['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['ui_name'], + '#default_value' => $this->options['admin_label'], '#fieldset' => 'more', ); @@ -319,7 +319,7 @@ public function buildGroupByForm(&$form, &$form_state) { $id = $form_state['id']; $form['#title'] = check_plain($view->display[$display_id]->display_title) . ': '; - $form['#title'] .= t('Configure aggregation settings for @type %item', array('@type' => $types[$type]['lstitle'], '%item' => $this->uiName())); + $form['#title'] .= t('Configure aggregation settings for @type %item', array('@type' => $types[$type]['lstitle'], '%item' => $this->adminLabel())); $form['#section'] = $display_id . '-' . $type . '-' . $id; diff --git a/lib/Drupal/views/Plugin/views/area/AreaPluginBase.php b/lib/Drupal/views/Plugin/views/area/AreaPluginBase.php index b9757a31c35c4ddc7620a68239980ee9f5113ae6..d1bdd528970683b38d65a3b493880ddabe4c99d8 100644 --- a/lib/Drupal/views/Plugin/views/area/AreaPluginBase.php +++ b/lib/Drupal/views/Plugin/views/area/AreaPluginBase.php @@ -42,7 +42,7 @@ public function init(&$view, &$options) { */ public function label() { if (!isset($this->options['label'])) { - return $this->ui_name(); + return $this->admin_label(); } return $this->options['label']; } diff --git a/lib/Drupal/views/Plugin/views/area/Broken.php b/lib/Drupal/views/Plugin/views/area/Broken.php index 760d047d8e30c9aaabe2778fec1e5f03c602b5dd..f84e1a8a86e679c79d959c91b11308dcc2f5c8b7 100644 --- a/lib/Drupal/views/Plugin/views/area/Broken.php +++ b/lib/Drupal/views/Plugin/views/area/Broken.php @@ -20,7 +20,7 @@ */ class Broken extends AreaPluginBase { - public function uiName($short = FALSE) { + public function adminLabel($short = FALSE) { return t('Broken/missing handler'); } diff --git a/lib/Drupal/views/Plugin/views/area/Text.php b/lib/Drupal/views/Plugin/views/area/Text.php index c3563c686f690b36cb6800958e277b704e0a683e..b696414a7ebc97b57983b1eff7286a3bda26d86e 100644 --- a/lib/Drupal/views/Plugin/views/area/Text.php +++ b/lib/Drupal/views/Plugin/views/area/Text.php @@ -49,13 +49,13 @@ public function buildOptionsForm(&$form, &$form_state) { // Get a list of the available fields and arguments for token replacement. $options = array(); foreach ($this->view->display_handler->getHandlers('field') as $field => $handler) { - $options[t('Fields')]["[$field]"] = $handler->uiName(); + $options[t('Fields')]["[$field]"] = $handler->adminLabel(); } $count = 0; // This lets us prepare the key as we want it printed. foreach ($this->view->display_handler->getHandlers('argument') as $arg => $handler) { - $options[t('Arguments')]['%' . ++$count] = t('@argument title', array('@argument' => $handler->uiName())); - $options[t('Arguments')]['!' . $count] = t('@argument input', array('@argument' => $handler->uiName())); + $options[t('Arguments')]['%' . ++$count] = t('@argument title', array('@argument' => $handler->adminLabel())); + $options[t('Arguments')]['!' . $count] = t('@argument input', array('@argument' => $handler->adminLabel())); } if (!empty($options)) { diff --git a/lib/Drupal/views/Plugin/views/argument/Broken.php b/lib/Drupal/views/Plugin/views/argument/Broken.php index 993bc94175e3a4c397fd247ea1245c4b00b51ed7..e60299f0e16a19c0eb2d77518cf24ddd40cc8e5a 100644 --- a/lib/Drupal/views/Plugin/views/argument/Broken.php +++ b/lib/Drupal/views/Plugin/views/argument/Broken.php @@ -20,7 +20,7 @@ */ class Broken extends ArgumentPluginBase { - public function uiName($short = FALSE) { + public function adminLabel($short = FALSE) { return t('Broken/missing handler'); } diff --git a/lib/Drupal/views/Plugin/views/argument/GroupByNumeric.php b/lib/Drupal/views/Plugin/views/argument/GroupByNumeric.php index 50fd70ced8e06b633586cc244ac81237904013d2..16976d33060b39fc45de80c38f8295207f814f2d 100644 --- a/lib/Drupal/views/Plugin/views/argument/GroupByNumeric.php +++ b/lib/Drupal/views/Plugin/views/argument/GroupByNumeric.php @@ -28,8 +28,8 @@ public function query($group_by = FALSE) { $this->query->add_having_expression(0, "$field = $placeholder", array($placeholder => $this->argument)); } - public function uiName($short = FALSE) { - return $this->getField(parent::uiName($short)); + public function adminLabel($short = FALSE) { + return $this->getField(parent::adminLabel($short)); } function get_sort_name() { diff --git a/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php b/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php index bf388fcef3a1d586ab5900ea1cb7adb1a87cffaf..b8ab779d1fc2624793a1c0fcd7a373c6f7ef0d3e 100644 --- a/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php +++ b/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php @@ -943,7 +943,7 @@ public function getFieldLabels() { $relationships[$relationship] = $label; } else { - $relationships[$relationship] = $handler->uiName(); + $relationships[$relationship] = $handler->adminLabel(); } } @@ -956,7 +956,7 @@ public function getFieldLabels() { $options[$id] = $label; } else { - $options[$id] = $handler->uiName(); + $options[$id] = $handler->adminLabel(); } if (!empty($handler->options['relationship']) && !empty($relationships[$handler->options['relationship']])) { $options[$id] = '(' . $relationships[$handler->options['relationship']] . ') ' . $options[$id]; @@ -1717,8 +1717,8 @@ public function buildOptionsForm(&$form, &$form_state) { $options = array(); $count = 0; // This lets us prepare the key as we want it printed. foreach ($this->view->display_handler->getHandlers('argument') as $arg => $handler) { - $options[t('Arguments')]['%' . ++$count] = t('@argument title', array('@argument' => $handler->uiName())); - $options[t('Arguments')]['!' . $count] = t('@argument input', array('@argument' => $handler->uiName())); + $options[t('Arguments')]['%' . ++$count] = t('@argument title', array('@argument' => $handler->adminLabel())); + $options[t('Arguments')]['!' . $count] = t('@argument input', array('@argument' => $handler->adminLabel())); } // Default text. @@ -1864,7 +1864,7 @@ public function buildOptionsForm(&$form, &$form_state) { if ($plugin->usesFields()) { foreach ($this->getHandlers('field') as $id => $handler) { - $funcs[] = $this->optionLink(t('Field @field (ID: @id)', array('@field' => $handler->uiName(), '@id' => $id)), 'analyze-theme-field') . ': ' . $this->formatThemes($handler->themeFunctions()); + $funcs[] = $this->optionLink(t('Field @field (ID: @id)', array('@field' => $handler->adminLabel(), '@id' => $id)), 'analyze-theme-field') . ': ' . $this->formatThemes($handler->themeFunctions()); } } } @@ -2822,7 +2822,7 @@ public function exportHandler($indent, $prefix, $storage, $option, $definition, $handler = views_get_handler($info['table'], $info['field'], $handler_type, $override); if ($handler) { $handler->init($this->view, $info); - $output .= $indent . '/* ' . $types[$type]['stitle'] . ': ' . $handler->uiName() . " */\n"; + $output .= $indent . '/* ' . $types[$type]['stitle'] . ': ' . $handler->adminLabel() . " */\n"; $output .= $handler->exportOptions($indent, $prefix . "['$option']['$id']"); } diff --git a/lib/Drupal/views/Plugin/views/field/Broken.php b/lib/Drupal/views/Plugin/views/field/Broken.php index 65df4676dafd86fc871024dc8f9a3d9baebf8caa..b6cfa5c7ca8576f7638d52007d12fa936a557e39 100644 --- a/lib/Drupal/views/Plugin/views/field/Broken.php +++ b/lib/Drupal/views/Plugin/views/field/Broken.php @@ -20,7 +20,7 @@ */ class Broken extends FieldPluginBase { - public function uiName($short = FALSE) { + public function adminLabel($short = FALSE) { return t('Broken/missing handler'); } diff --git a/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php b/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php index 0607535989dae9edcd2e4c326df96bdfc8a2fb6b..8fd69d6106992ad9ca7c77f27ba5012f099a80b1 100644 --- a/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php +++ b/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php @@ -851,7 +851,7 @@ public function buildOptionsForm(&$form, &$form_state) { // Get a list of the available fields and arguments for token replacement. $options = array(); foreach ($this->view->display_handler->getHandlers('field') as $field => $handler) { - $options[t('Fields')]["[$field]"] = $handler->uiName(); + $options[t('Fields')]["[$field]"] = $handler->adminLabel(); // We only use fields up to (and including) this one. if ($field == $this->options['id']) { break; @@ -859,8 +859,8 @@ public function buildOptionsForm(&$form, &$form_state) { } $count = 0; // This lets us prepare the key as we want it printed. foreach ($this->view->display_handler->getHandlers('argument') as $arg => $handler) { - $options[t('Arguments')]['%' . ++$count] = t('@argument title', array('@argument' => $handler->uiName())); - $options[t('Arguments')]['!' . $count] = t('@argument input', array('@argument' => $handler->uiName())); + $options[t('Arguments')]['%' . ++$count] = t('@argument title', array('@argument' => $handler->adminLabel())); + $options[t('Arguments')]['!' . $count] = t('@argument input', array('@argument' => $handler->adminLabel())); } $this->document_self_tokens($options[t('Fields')]); @@ -1625,8 +1625,8 @@ public function themeFunctions() { return $themes; } - public function uiName($short = FALSE) { - return $this->getField(parent::uiName($short)); + public function adminLabel($short = FALSE) { + return $this->getField(parent::adminLabel($short)); } } diff --git a/lib/Drupal/views/Plugin/views/filter/Broken.php b/lib/Drupal/views/Plugin/views/filter/Broken.php index cf2445ec84d273db0f6d2fb3c453c6aca824f38f..b52ae93d70a49c0aaee9c27e74d7255bd154e058 100644 --- a/lib/Drupal/views/Plugin/views/filter/Broken.php +++ b/lib/Drupal/views/Plugin/views/filter/Broken.php @@ -20,7 +20,7 @@ */ class Broken extends FilterPluginBase { - public function uiName($short = FALSE) { + public function adminLabel($short = FALSE) { return t('Broken/missing handler'); } diff --git a/lib/Drupal/views/Plugin/views/filter/Combine.php b/lib/Drupal/views/Plugin/views/filter/Combine.php index dd6621455ecba283b1846a069dc83132cc6b8fb7..41f333c524fca219702b0e6bd020083602b943de 100644 --- a/lib/Drupal/views/Plugin/views/filter/Combine.php +++ b/lib/Drupal/views/Plugin/views/filter/Combine.php @@ -40,7 +40,7 @@ public function buildOptionsForm(&$form, &$form_state) { if ($this->view->style_plugin->usesFields()) { $options = array(); foreach ($this->view->display_handler->getHandlers('field') as $name => $field) { - $options[$name] = $field->uiName(TRUE); + $options[$name] = $field->adminLabel(TRUE); } if ($options) { $form['fields'] = array( diff --git a/lib/Drupal/views/Plugin/views/filter/GroupByNumeric.php b/lib/Drupal/views/Plugin/views/filter/GroupByNumeric.php index 09cf45926c63ca21315a38b624c35b69ebfa4d2d..c0118b66223a7fd541e8dd6b8b9ff2c12025c91a 100644 --- a/lib/Drupal/views/Plugin/views/filter/GroupByNumeric.php +++ b/lib/Drupal/views/Plugin/views/filter/GroupByNumeric.php @@ -57,8 +57,8 @@ function op_empty($field) { $this->query->add_having_expression($this->options['group'], "$field $operator"); } - public function uiName($short = FALSE) { - return $this->getField(parent::uiName($short)); + public function adminLabel($short = FALSE) { + return $this->getField(parent::adminLabel($short)); } function can_group() { return FALSE; } diff --git a/lib/Drupal/views/Plugin/views/filter/InOperator.php b/lib/Drupal/views/Plugin/views/filter/InOperator.php index d8778d3ad138b23469006f4477bd2d0e063e6f04..139b0286f817e8c2deea36c7bb9802d292434d8c 100644 --- a/lib/Drupal/views/Plugin/views/filter/InOperator.php +++ b/lib/Drupal/views/Plugin/views/filter/InOperator.php @@ -406,7 +406,7 @@ public function validate() { } if (!in_array($this->operator, $this->operator_values(1))) { - $errors[] = t('The operator is invalid on filter: @filter.', array('@filter' => $this->uiName(TRUE))); + $errors[] = t('The operator is invalid on filter: @filter.', array('@filter' => $this->adminLabel(TRUE))); } if (is_array($this->value)) { if (!isset($this->value_options)) { @@ -429,11 +429,11 @@ public function validate() { } // Choose different kind of ouput for 0, a single and multiple values. if (count($this->value) == 0) { - $errors[] = t('No valid values found on filter: @filter.', array('@filter' => $this->uiName(TRUE))); + $errors[] = t('No valid values found on filter: @filter.', array('@filter' => $this->adminLabel(TRUE))); } } elseif (!empty($this->value) && ($this->operator == 'in' || $this->operator == 'not in')) { - $errors[] = t('The value @value is not an array for @operator on filter: @filter', array('@value' => views_var_export($this->value), '@operator' => $this->operator, '@filter' => $this->uiName(TRUE))); + $errors[] = t('The value @value is not an array for @operator on filter: @filter', array('@value' => views_var_export($this->value), '@operator' => $this->operator, '@filter' => $this->adminLabel(TRUE))); } return $errors; } diff --git a/lib/Drupal/views/Plugin/views/relationship/Broken.php b/lib/Drupal/views/Plugin/views/relationship/Broken.php index e829449db327bcfa77debb2d19fd4541bf7fe4dd..e7300a2befcf1b3b6882bb849e36b3c9dd0b74a9 100644 --- a/lib/Drupal/views/Plugin/views/relationship/Broken.php +++ b/lib/Drupal/views/Plugin/views/relationship/Broken.php @@ -20,7 +20,7 @@ */ class Broken extends RelationshipPluginBase { - public function uiName($short = FALSE) { + public function adminLabel($short = FALSE) { return t('Broken/missing handler'); } diff --git a/lib/Drupal/views/Plugin/views/relationship/RelationshipPluginBase.php b/lib/Drupal/views/Plugin/views/relationship/RelationshipPluginBase.php index 66d55b355760c89d3464fa30391890937bd35ba4..43a31c5e3d3c72b6588af3cfc1ea345007535466 100644 --- a/lib/Drupal/views/Plugin/views/relationship/RelationshipPluginBase.php +++ b/lib/Drupal/views/Plugin/views/relationship/RelationshipPluginBase.php @@ -64,12 +64,11 @@ public function init(&$view, &$options) { */ function label() { if (!isset($this->options['label'])) { - return $this->ui_name(); + return $this->adminLabel(); } return $this->options['label']; } - protected function defineOptions() { $options = parent::defineOptions(); diff --git a/lib/Drupal/views/Plugin/views/sort/Broken.php b/lib/Drupal/views/Plugin/views/sort/Broken.php index c2f8b6842a55c1a813268288626764025d82d33a..550158f09144ccce05e690a454b688d53885ec4c 100644 --- a/lib/Drupal/views/Plugin/views/sort/Broken.php +++ b/lib/Drupal/views/Plugin/views/sort/Broken.php @@ -20,7 +20,7 @@ */ class Broken extends SortPluginBase { - public function uiName($short = FALSE) { + public function adminLabel($short = FALSE) { return t('Broken/missing handler'); } diff --git a/lib/Drupal/views/Plugin/views/sort/GroupByNumeric.php b/lib/Drupal/views/Plugin/views/sort/GroupByNumeric.php index 524b1a56d9cb94aaced27f4cea2341d91ad6ff90..3b7eacd2a66c352b68a64e2b97cb1d1350059418 100644 --- a/lib/Drupal/views/Plugin/views/sort/GroupByNumeric.php +++ b/lib/Drupal/views/Plugin/views/sort/GroupByNumeric.php @@ -39,8 +39,8 @@ public function query() { $this->query->add_orderby($this->table_alias, $this->real_field, $this->options['order'], NULL, $params); } - public function uiName($short = FALSE) { - return $this->getField(parent::uiName($short)); + public function adminLabel($short = FALSE) { + return $this->getField(parent::adminLabel($short)); } } diff --git a/lib/Views/search/Plugin/views/field/Score.php b/lib/Views/search/Plugin/views/field/Score.php index b78a04544ce293a423f504cfcfe00b5237da0f76..13b536ed32c3c45239a7c2939a866759612dc40a 100644 --- a/lib/Views/search/Plugin/views/field/Score.php +++ b/lib/Views/search/Plugin/views/field/Score.php @@ -37,7 +37,7 @@ public function buildOptionsForm(&$form, &$form_state) { $handlers = $this->view->display_handler->getHandlers('field'); $options = array('' => t('No alternate')); foreach ($handlers as $id => $handler) { - $options[$id] = $handler->uiName(); + $options[$id] = $handler->adminLabel(); } $form['alternate_sort'] = array( diff --git a/views_ui.module b/views_ui.module index 25d9d1c22e263f41ed422ecc052eb16b0a33e65e..3eaad344e9392b3b79339dd55ddb30b0691320df 100644 --- a/views_ui.module +++ b/views_ui.module @@ -485,7 +485,7 @@ function views_ui_view_preview_section_handler_links($view, $type, $title = FALS } foreach ($handlers as $id => $handler) { - $field_name = $handler->uiName(TRUE); + $field_name = $handler->adminLabel(TRUE); $links[$type . '-edit-' . $id] = array( 'title' => t('Edit @section', array('@section' => $field_name)), 'href' => "admin/structure/views/nojs/config-item/$view->name/$display->id/$type/$id",