Commit c09fe055 authored by dawehner's avatar dawehner Committed by tim.plunkett

Issue #1767030 by dawehner: Rename uiName to adminLabel.

parent afb01e60
......@@ -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';
......
......@@ -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;
......
......@@ -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'];
}
......
......@@ -20,7 +20,7 @@
*/
class Broken extends AreaPluginBase {
public function uiName($short = FALSE) {
public function adminLabel($short = FALSE) {
return t('Broken/missing handler');
}
......
......@@ -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)) {
......
......@@ -20,7 +20,7 @@
*/
class Broken extends ArgumentPluginBase {
public function uiName($short = FALSE) {
public function adminLabel($short = FALSE) {
return t('Broken/missing handler');
}
......
......@@ -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() {
......
......@@ -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']");
}
......
......@@ -20,7 +20,7 @@
*/
class Broken extends FieldPluginBase {
public function uiName($short = FALSE) {
public function adminLabel($short = FALSE) {
return t('Broken/missing handler');
}
......
......@@ -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));
}
}
......
......@@ -20,7 +20,7 @@
*/
class Broken extends FilterPluginBase {
public function uiName($short = FALSE) {
public function adminLabel($short = FALSE) {
return t('Broken/missing handler');
}
......
......@@ -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(
......
......@@ -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; }
......
......@@ -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;
}
......
......@@ -20,7 +20,7 @@
*/
class Broken extends RelationshipPluginBase {
public function uiName($short = FALSE) {
public function adminLabel($short = FALSE) {
return t('Broken/missing handler');
}
......
......@@ -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();
......
......@@ -20,7 +20,7 @@
*/
class Broken extends SortPluginBase {
public function uiName($short = FALSE) {
public function adminLabel($short = FALSE) {
return t('Broken/missing handler');
}
......
......@@ -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));
}
}
......@@ -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(
......
......@@ -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",
......
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