Commit 334703ac authored by webchick's avatar webchick

Issue #2072303 by tim.plunkett: Modernize views_ui().module forms.

parent af00da69
......@@ -15,14 +15,14 @@
class AdvancedSettingsForm extends SystemConfigFormBase {
/**
* Implements \Drupal\Core\Form\FormInterface::getFormID().
* {@inheritdoc}
*/
public function getFormID() {
return 'views_ui_admin_settings_advanced';
}
/**
* Implements \Drupal\Core\Form\FormInterface::buildForm().
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state) {
$form = parent::buildForm($form, $form_state);
......@@ -30,39 +30,39 @@ public function buildForm(array $form, array &$form_state) {
$config = $this->configFactory->get('views.settings');
$form['cache'] = array(
'#type' => 'details',
'#title' => t('Caching'),
'#title' => $this->t('Caching'),
);
$form['cache']['skip_cache'] = array(
'#type' => 'checkbox',
'#title' => t('Disable views data caching'),
'#description' => t("Views caches data about tables, modules and views available, to increase performance. By checking this box, Views will skip this cache and always rebuild this data when needed. This can have a serious performance impact on your site."),
'#title' => $this->t('Disable views data caching'),
'#description' => $this->t("Views caches data about tables, modules and views available, to increase performance. By checking this box, Views will skip this cache and always rebuild this data when needed. This can have a serious performance impact on your site."),
'#default_value' => $config->get('skip_cache'),
);
$form['cache']['clear_cache'] = array(
'#type' => 'submit',
'#value' => t("Clear Views' cache"),
'#value' => $this->t("Clear Views' cache"),
'#submit' => array(array($this, 'cacheSubmit')),
);
$form['debug'] = array(
'#type' => 'details',
'#title' => t('Debugging'),
'#title' => $this->t('Debugging'),
);
$form['debug']['sql_signature'] = array(
'#type' => 'checkbox',
'#title' => t('Add Views signature to all SQL queries'),
'#description' => t("All Views-generated queries will include the name of the views and display 'view-name:display-name' as a string at the end of the SELECT clause. This makes identifying Views queries in database server logs simpler, but should only be used when troubleshooting."),
'#title' => $this->t('Add Views signature to all SQL queries'),
'#description' => $this->t("All Views-generated queries will include the name of the views and display 'view-name:display-name' as a string at the end of the SELECT clause. This makes identifying Views queries in database server logs simpler, but should only be used when troubleshooting."),
'#default_value' => $config->get('sql_signature'),
);
$form['debug']['no_javascript'] = array(
'#type' => 'checkbox',
'#title' => t('Disable JavaScript with Views'),
'#description' => t("If you are having problems with the JavaScript, you can disable it here. The Views UI should degrade and still be usable without javascript; it's just not as good."),
'#title' => $this->t('Disable JavaScript with Views'),
'#description' => $this->t("If you are having problems with the JavaScript, you can disable it here. The Views UI should degrade and still be usable without javascript; it's just not as good."),
'#default_value' => $config->get('no_javascript'),
);
......@@ -72,11 +72,11 @@ public function buildForm(array $form, array &$form_state) {
'#type' => 'details',
);
$form['extenders']['display_extenders'] = array(
'#title' => t('Display extenders'),
'#title' => $this->t('Display extenders'),
'#default_value' => array_filter($config->get('display_extenders')),
'#options' => $options,
'#type' => 'checkboxes',
'#description' => t('Select extensions of the views interface.')
'#description' => $this->t('Select extensions of the views interface.')
);
}
......@@ -84,7 +84,7 @@ public function buildForm(array $form, array &$form_state) {
}
/**
* Implements \Drupal\Core\Form\FormInterface::submitForm().
* {@inheritdoc}
*/
public function submitForm(array &$form, array &$form_state) {
$this->configFactory->get('views.settings')
......@@ -100,7 +100,7 @@ public function submitForm(array &$form, array &$form_state) {
*/
public function cacheSubmit() {
views_invalidate_cache();
drupal_set_message(t('The cache has been cleared.'));
drupal_set_message($this->t('The cache has been cleared.'));
}
}
......@@ -24,14 +24,14 @@ public function __construct($type = NULL) {
}
/**
* Implements \Drupal\views_ui\Form\Ajax\ViewsFormInterface::getFormKey().
* {@inheritdoc}
*/
public function getFormKey() {
return 'add-item';
}
/**
* Overrides \Drupal\views_ui\Form\Ajax\ViewsFormBase::getForm().
* {@inheritdoc}
*/
public function getForm(ViewStorageInterface $view, $display_id, $js, $type = NULL) {
$this->setType($type);
......@@ -39,14 +39,14 @@ public function getForm(ViewStorageInterface $view, $display_id, $js, $type = NU
}
/**
* Implements \Drupal\Core\Form\FormInterface::getFormID().
* {@inheritdoc}
*/
public function getFormID() {
return 'views_ui_add_item_form';
}
/**
* Implements \Drupal\Core\Form\FormInterface::buildForm().
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state) {
$view = &$form_state['view'];
......@@ -72,7 +72,7 @@ public function buildForm(array $form, array &$form_state) {
$type = $types[$type]['type'];
}
$form['#title'] = t('Add @type', array('@type' => $ltitle));
$form['#title'] = $this->t('Add @type', array('@type' => $ltitle));
$form['#section'] = $display_id . 'add-item';
// Add the display override dropdown.
......@@ -90,13 +90,13 @@ public function buildForm(array $form, array &$form_state) {
);
$form['override']['controls']['options_search'] = array(
'#type' => 'textfield',
'#title' => t('Search'),
'#title' => $this->t('Search'),
);
$groups = array('all' => t('- All -'));
$groups = array('all' => $this->t('- All -'));
$form['override']['controls']['group'] = array(
'#type' => 'select',
'#title' => t('Type'),
'#title' => $this->t('Type'),
'#options' => array(),
);
......@@ -137,7 +137,7 @@ public function buildForm(array $form, array &$form_state) {
$zebra_class = ($zebra % 2) ? 'odd' : 'even';
$form['options']['name'][$key] = array(
'#type' => 'checkbox',
'#title' => t('!group: !field', array('!group' => $option['group'], '!field' => $option['title'])),
'#title' => $this->t('!group: !field', array('!group' => $option['group'], '!field' => $option['title'])),
'#description' => $option['help'],
'#return_value' => $key,
'#prefix' => "<div class='$zebra_class filterable-option'>",
......@@ -161,17 +161,17 @@ public function buildForm(array $form, array &$form_state) {
}
else {
$form['options']['markup'] = array(
'#markup' => '<div class="form-item">' . t('There are no @types available to add.', array('@types' => $ltitle)) . '</div>',
'#markup' => '<div class="form-item">' . $this->t('There are no @types available to add.', array('@types' => $ltitle)) . '</div>',
);
}
// Add a div to show the selected items
$form['selected'] = array(
'#type' => 'item',
'#markup' => '<span class="views-ui-view-title">' . t('Selected:') . '</span> ' . '<div class="views-selected-options"></div>',
'#markup' => '<span class="views-ui-view-title">' . $this->t('Selected:') . '</span> ' . '<div class="views-selected-options"></div>',
'#theme_wrappers' => array('form_element', 'views_ui_container'),
'#attributes' => array('class' => array('container-inline', 'views-add-form-selected')),
);
$view->getStandardButtons($form, $form_state, 'views_ui_add_item_form', t('Add and configure @types', array('@types' => $ltitle)));
$view->getStandardButtons($form, $form_state, 'views_ui_add_item_form', $this->t('Add and configure @types', array('@types' => $ltitle)));
// Remove the default submit function.
$form['buttons']['submit']['#submit'] = array_filter($form['buttons']['submit']['#submit'], function($var) {
......
......@@ -17,26 +17,26 @@
class Analyze extends ViewsFormBase {
/**
* Implements \Drupal\views_ui\Form\Ajax\ViewsFormInterface::getFormKey().
* {@inheritdoc}
*/
public function getFormKey() {
return 'analyze';
}
/**
* Implements \Drupal\Core\Form\FormInterface::getFormID().
* {@inheritdoc}
*/
public function getFormID() {
return 'views_ui_analyze_view_form';
}
/**
* Implements \Drupal\Core\Form\FormInterface::buildForm().
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state) {
$view = &$form_state['view'];
$form['#title'] = t('View analysis');
$form['#title'] = $this->t('View analysis');
$form['#section'] = 'analyze';
$analyzer = Views::analyzer();
......@@ -55,7 +55,7 @@ public function buildForm(array $form, array &$form_state) {
}
/**
* Overrides \Drupal\views_ui\Form\Ajax\ViewsFormBase::submitForm().
* {@inheritdoc}
*/
public function submitForm(array &$form, array &$form_state) {
$form_state['redirect'] = 'admin/structure/views/view/' . $form_state['view']->id() . '/edit';
......
......@@ -25,14 +25,14 @@ public function __construct($type = NULL, $id = NULL) {
}
/**
* Implements \Drupal\views_ui\Form\Ajax\ViewsFormInterface::getFormKey().
* {@inheritdoc}
*/
public function getFormKey() {
return 'config-item';
}
/**
* Overrides \Drupal\views_ui\Form\Ajax\ViewsFormBase::getForm().
* {@inheritdoc}
*/
public function getForm(ViewStorageInterface $view, $display_id, $js, $type = NULL, $id = NULL) {
$this->setType($type);
......@@ -41,14 +41,14 @@ public function getForm(ViewStorageInterface $view, $display_id, $js, $type = NU
}
/**
* Implements \Drupal\Core\Form\FormInterface::getFormID().
* {@inheritdoc}
*/
public function getFormID() {
return 'views_ui_config_item_form';
}
/**
* Implements \Drupal\Core\Form\FormInterface::buildForm().
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state) {
$view = &$form_state['view'];
......@@ -71,7 +71,7 @@ public function buildForm(array $form, array &$form_state) {
if ($item) {
$handler = $executable->display_handler->getHandler($type, $id);
if (empty($handler)) {
$form['markup'] = array('#markup' => t("Error: handler for @table > @field doesn't exist!", array('@table' => $item['table'], '@field' => $item['field'])));
$form['markup'] = array('#markup' => $this->t("Error: handler for @table > @field doesn't exist!", array('@table' => $item['table'], '@field' => $item['field'])));
}
else {
$types = ViewExecutable::viewsHandlerTypes();
......@@ -115,7 +115,7 @@ public function buildForm(array $form, array &$form_state) {
// it to none.
$base_fields = Views::viewsDataHelper()->fetchFields($view->get('base_table'), $form_state['type'], $executable->display_handler->useGroupBy());
if (isset($base_fields[$item['table'] . '.' . $item['field']])) {
$relationship_options = array_merge(array('none' => t('Do not use a relationship')), $relationship_options);
$relationship_options = array_merge(array('none' => $this->t('Do not use a relationship')), $relationship_options);
}
$rel = empty($item['relationship']) ? 'none' : $item['relationship'];
if (empty($relationship_options[$rel])) {
......@@ -129,7 +129,7 @@ public function buildForm(array $form, array &$form_state) {
$form['options']['relationship'] = array(
'#type' => 'select',
'#title' => t('Relationship'),
'#title' => $this->t('Relationship'),
'#options' => $relationship_options,
'#default_value' => $rel,
'#weight' => -500,
......@@ -142,7 +142,7 @@ public function buildForm(array $form, array &$form_state) {
);
}
$form['#title'] = t('Configure @type: @item', array('@type' => $types[$type]['lstitle'], '@item' => $handler->adminLabel()));
$form['#title'] = $this->t('Configure @type: @item', array('@type' => $types[$type]['lstitle'], '@item' => $handler->adminLabel()));
if (!empty($handler->definition['help'])) {
$form['options']['form_description'] = array(
......@@ -169,7 +169,7 @@ public function buildForm(array $form, array &$form_state) {
// Add a 'remove' button.
$form['buttons']['remove'] = array(
'#type' => 'submit',
'#value' => t('Remove'),
'#value' => $this->t('Remove'),
'#submit' => array(array($this, 'remove')),
'#limit_validation_errors' => array(array('override')),
);
......@@ -183,7 +183,7 @@ public function buildForm(array $form, array &$form_state) {
}
/**
* Overrides \Drupal\views_ui\Form\Ajax\ViewsFormBase::validateForm().
* {@inheritdoc}
*/
public function validateForm(array &$form, array &$form_state) {
$form_state['handler']->validateOptionsForm($form['options'], $form_state);
......@@ -194,7 +194,7 @@ public function validateForm(array &$form, array &$form_state) {
}
/**
* Overrides \Drupal\views_ui\Form\Ajax\ViewsFormBase::submitForm().
* {@inheritdoc}
*/
public function submitForm(array &$form, array &$form_state) {
// Run it through the handler's submit function.
......
......@@ -24,14 +24,14 @@ public function __construct($type = NULL, $id = NULL) {
}
/**
* Implements \Drupal\views_ui\Form\Ajax\ViewsFormInterface::getFormKey().
* {@inheritdoc}
*/
public function getFormKey() {
return 'config-item-extra';
}
/**
* Overrides \Drupal\views_ui\Form\Ajax\ViewsFormBase::getForm().
* {@inheritdoc}
*/
public function getForm(ViewStorageInterface $view, $display_id, $js, $type = NULL, $id = NULL) {
$this->setType($type);
......@@ -40,14 +40,14 @@ public function getForm(ViewStorageInterface $view, $display_id, $js, $type = NU
}
/**
* Implements \Drupal\Core\Form\FormInterface::getFormID().
* {@inheritdoc}
*/
public function getFormID() {
return 'views_ui_config_item_extra_form';
}
/**
* Implements \Drupal\Core\Form\FormInterface::buildForm().
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state) {
$view = &$form_state['view'];
......@@ -69,13 +69,13 @@ public function buildForm(array $form, array &$form_state) {
if ($item) {
$handler = $executable->display_handler->getHandler($type, $id);
if (empty($handler)) {
$form['markup'] = array('#markup' => t("Error: handler for @table > @field doesn't exist!", array('@table' => $item['table'], '@field' => $item['field'])));
$form['markup'] = array('#markup' => $this->t("Error: handler for @table > @field doesn't exist!", array('@table' => $item['table'], '@field' => $item['field'])));
}
else {
$handler->init($executable, $executable->display_handler, $item);
$types = ViewExecutable::viewsHandlerTypes();
$form['#title'] = t('Configure extra settings for @type %item', array('@type' => $types[$type]['lstitle'], '%item' => $handler->adminLabel()));
$form['#title'] = $this->t('Configure extra settings for @type %item', array('@type' => $types[$type]['lstitle'], '%item' => $handler->adminLabel()));
$form['#section'] = $display_id . '-' . $type . '-' . $id;
......@@ -90,14 +90,14 @@ public function buildForm(array $form, array &$form_state) {
}
/**
* Overrides \Drupal\views_ui\Form\Ajax\ViewsFormBase::validateForm().
* {@inheritdoc}
*/
public function validateForm(array &$form, array &$form_state) {
$form_state['handler']->validateExtraOptionsForm($form['options'], $form_state);
}
/**
* Overrides \Drupal\views_ui\Form\Ajax\ViewsFormBase::submitForm().
* {@inheritdoc}
*/
public function submitForm(array &$form, array &$form_state) {
// Run it through the handler's submit function.
......
......@@ -25,14 +25,14 @@ public function __construct($type = NULL, $id = NULL) {
}
/**
* Implements \Drupal\views_ui\Form\Ajax\ViewsFormInterface::getFormKey().
* {@inheritdoc}
*/
public function getFormKey() {
return 'config-item-group';
}
/**
* Overrides \Drupal\views_ui\Form\Ajax\ViewsFormBase::getForm().
* {@inheritdoc}
*/
public function getForm(ViewStorageInterface $view, $display_id, $js, $type = NULL, $id = NULL) {
$this->setType($type);
......@@ -41,14 +41,14 @@ public function getForm(ViewStorageInterface $view, $display_id, $js, $type = NU
}
/**
* Implements \Drupal\Core\Form\FormInterface::getFormID().
* {@inheritdoc}
*/
public function getFormID() {
return 'views_ui_config_item_group_form';
}
/**
* Implements \Drupal\Core\Form\FormInterface::buildForm().
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state) {
$view = &$form_state['view'];
......@@ -65,7 +65,7 @@ public function buildForm(array $form, array &$form_state) {
);
$executable = $view->getExecutable();
if (!$executable->setDisplay($display_id)) {
views_ajax_render(t('Invalid display id @display', array('@display' => $display_id)));
views_ajax_render($this->t('Invalid display id @display', array('@display' => $display_id)));
}
$executable->initQuery();
......@@ -75,13 +75,13 @@ public function buildForm(array $form, array &$form_state) {
if ($item) {
$handler = $executable->display_handler->getHandler($type, $id);
if (empty($handler)) {
$form['markup'] = array('#markup' => t("Error: handler for @table > @field doesn't exist!", array('@table' => $item['table'], '@field' => $item['field'])));
$form['markup'] = array('#markup' => $this->t("Error: handler for @table > @field doesn't exist!", array('@table' => $item['table'], '@field' => $item['field'])));
}
else {
$handler->init($executable, $executable->display_handler, $item);
$types = ViewExecutable::viewsHandlerTypes();
$form['#title'] = t('Configure aggregation settings for @type %item', array('@type' => $types[$type]['lstitle'], '%item' => $handler->adminLabel()));
$form['#title'] = $this->t('Configure aggregation settings for @type %item', array('@type' => $types[$type]['lstitle'], '%item' => $handler->adminLabel()));
$handler->buildGroupByForm($form['options'], $form_state);
$form_state['handler'] = &$handler;
......@@ -93,7 +93,7 @@ public function buildForm(array $form, array &$form_state) {
}
/**
* Overrides \Drupal\views_ui\Form\Ajax\ViewsFormBase::submitForm().
* {@inheritdoc}
*/
public function submitForm(array &$form, array &$form_state) {
$item = &$form_state['handler']->options;
......
......@@ -22,14 +22,14 @@ public function __construct($type = NULL) {
}
/**
* Implements \Drupal\views_ui\Form\Ajax\ViewsFormInterface::getFormKey().
* {@inheritdoc}
*/
public function getFormKey() {
return 'display';
}
/**
* Overrides \Drupal\views_ui\Form\Ajax\ViewsFormBase::getFormState().
* {@inheritdoc}
*
* @todo Remove this and switch all usage of $form_state['section'] to
* $form_state['type'].
......@@ -41,7 +41,7 @@ public function getFormState(ViewStorageInterface $view, $display_id, $js) {
}
/**
* Overrides \Drupal\views_ui\Form\Ajax\ViewsFormBase::getForm().
* {@inheritdoc}
*/
public function getForm(ViewStorageInterface $view, $display_id, $js, $type = NULL) {
$this->setType($type);
......@@ -49,14 +49,14 @@ public function getForm(ViewStorageInterface $view, $display_id, $js, $type = NU
}
/**
* Implements \Drupal\Core\Form\FormInterface::getFormID().
* {@inheritdoc}
*/
public function getFormID() {
return 'views_ui_edit_display_form';
}
/**
* Implements \Drupal\Core\Form\FormInterface::buildForm().
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state) {
$view = &$form_state['view'];
......@@ -95,7 +95,7 @@ public function buildForm(array $form, array &$form_state) {
}
/**
* Overrides \Drupal\views_ui\Form\Ajax\ViewsFormBase::validateForm().
* {@inheritdoc}
*/
public function validateForm(array &$form, array &$form_state) {
$form_state['view']->getExecutable()->displayHandlers->get($form_state['display_id'])->validateOptionsForm($form['options'], $form_state);
......@@ -106,7 +106,7 @@ public function validateForm(array &$form, array &$form_state) {
}
/**
* Overrides \Drupal\views_ui\Form\Ajax\ViewsFormBase::submitForm().
* {@inheritdoc}
*/
public function submitForm(array &$form, array &$form_state) {
$form_state['view']->getExecutable()->displayHandlers->get($form_state['display_id'])->submitOptionsForm($form['options'], $form_state);
......
......@@ -16,26 +16,26 @@
class EditDetails extends ViewsFormBase {
/**
* Implements \Drupal\views_ui\Form\Ajax\ViewsFormInterface::getFormKey().
* {@inheritdoc}
*/
public function getFormKey() {
return 'edit-details';
}
/**
* Implements \Drupal\Core\Form\FormInterface::getFormID().
* {@inheritdoc}
*/
public function getFormID() {
return 'views_ui_edit_details_form';
}
/**
* Implements \Drupal\Core\Form\FormInterface::buildForm().
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state) {
$view = &$form_state['view'];
$form['#title'] = t('View name and description');
$form['#title'] = $this->t('View name and description');
$form['#section'] = 'details';
$form['details'] = array(
......@@ -44,27 +44,27 @@ public function buildForm(array $form, array &$form_state) {
);
$form['details']['label'] = array(
'#type' => 'textfield',
'#title' => t('Human-readable name'),
'#description' => t('A descriptive human-readable name for this view. Spaces are allowed'),
'#title' => $this->t('Human-readable name'),
'#description' => $this->t('A descriptive human-readable name for this view. Spaces are allowed'),
'#default_value' => $view->label(),
);
$form['details']['langcode'] = array(
'#type' => 'language_select',
'#title' => t('View language'),
'#description' => t('Language of labels and other textual elements in this view.'),
'#title' => $this->t('View language'),
'#description' => $this->t('Language of labels and other textual elements in this view.'),
'#default_value' => $view->get('langcode'),
);
$form['details']['tag'] = array(
'#type' => 'textfield',
'#title' => t('View tag'),
'#description' => t('Optionally, enter a comma delimited list of tags for this view to use in filtering and sorting views on the administrative page.'),
'#title' => $this->t('View tag'),
'#description' => $this->t('Optionally, enter a comma delimited list of tags for this view to use in filtering and sorting views on the administrative page.'),
'#default_value' => $view->get('tag'),
'#autocomplete_path' => 'admin/views/ajax/autocomplete/tag',
);
$form['details']['description'] = array(
'#type' => 'textfield',
'#title' => t('View description'),
'#description' => t('This description will appear on the Views administrative UI to tell you what the view is about.'),
'#title' => $this->t('View description'),
'#description' => $this->t('This description will appear on the Views administrative UI to tell you what the view is about.'),
'#default_value' => $view->get('description'),
);
......@@ -73,7 +73,7 @@ public function buildForm(array $form, array &$form_state) {
}
/**
* Overrides \Drupal\views_ui\Form\Ajax\ViewsFormBase::submitForm().
* {@inheritdoc}
*/
public function submitForm(array &$form, array &$form_state) {
$view = $form_state['view'];
......
......@@ -23,14 +23,14 @@ public function __construct($type = NULL) {
}
/**
* Implements \Drupal\views_ui\Form\Ajax\ViewsFormInterface::getFormKey().
* {@inheritdoc}
*/
public function getFormKey() {
return 'rearrange';
}
/**
* Overrides \Drupal\views_ui\Form\Ajax\ViewsFormBase::getForm().
* {@inheritdoc}
*/
public function getForm(ViewStorageInterface $view, $display_id, $js, $type = NULL) {
$this->setType($type);
......@@ -38,14 +38,14 @@ public function getForm(ViewStorageInterface $view, $display_id, $js, $type = NU
}
/**
* Implements \Drupal\Core\Form\FormInterface::getFormID().
* {@inheritdoc}
*/
public function getFormID() {
return 'views_ui_rearrange_form';
}
/**
* Implements \Drupal\Core\Form\FormInterface::buildForm().
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state) {
$view = &$form_state['view'];
......@@ -56,7 +56,7 @@ public function buildForm(array $form, array &$form_state) {
$executable = $view->getExecutable();
$executable->setDisplay($display_id);
$display = &$executable->displayHandlers->get($display_id);
$form['#title'] = t('Rearrange @type', array('@type' => $types[$type]['ltitle']));
$form['#title'] = $this->t('Rearrange @type', array('@type' => $types[$type]['ltitle']));
$form['#section'] = $display_id . 'rearrange-item';
if ($display->defaultableSections($types[$type]['plural'])) {
......@@ -74,8 +74,8 @@ public function buildForm(array $form, array &$form_state) {
$form['fields'] = array(
'#type' => 'table',
'#header' => array('', t('Weight'), t('Remove')),
'#empty' => t('No fields available.'),
'#header' => array('', $this->t('Weight'), $this->t('Remove')),
'#empty' => $this->t('No fields available.'),
'#tabledrag' => array(
array('order', 'sibling', 'weight'),
),
......@@ -101,7 +101,7 @@ public function buildForm(array $form, array &$form_state) {
);
}
else {
$form['fields'][$id]['name'] = array('#markup' => t('Broken field @id', array('@id' => $id)));
$form['fields'][$id]['name'] = array('#markup' => $this->t('Broken field @id', array('@id' => $id)));
}
$form['fields'][$id]['weight'] = array(
......@@ -115,7 +115,7 @@ public function buildForm(array $form, array &$form_state) {
'#id' => 'views-removed-' . $id,
'#attributes' => array('class' => array('views-remove-checkbox')),