diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/BreakLockForm.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/BreakLockForm.php
index 7dc1ee3478aa33b86219d4f8d5ab630ff01b96e2..d9c8c567a879a3d60b59d844c5e700ba64f44091 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/Form/BreakLockForm.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/BreakLockForm.php
@@ -84,7 +84,11 @@ protected function getQuestion() {
protected function getDescription() {
$locked = $this->tempStore->getMetadata($this->view->id());
$accounts = $this->entityManager->getStorageController('user')->load(array($locked->owner));
- return t('By breaking this lock, any unsaved changes made by !user will be lost.', array('!user' => theme('username', array('account' => reset($accounts)))));
+ $username = array(
+ '#theme' => 'username',
+ '#account' => reset($accounts),
+ );
+ return t('By breaking this lock, any unsaved changes made by !user will be lost.', array('!user' => drupal_render($username)));
}
/**
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
index 94bc9661523d6073e0433844eee7cb8d33e9601e..f401af798a109344fdcafe8af456c5da84cc1de3 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
@@ -120,10 +120,19 @@ public function form(array $form, array &$form_state) {
$form['#attributes']['class'] = array('form-edit');
if ($view->isLocked()) {
+ $username = array(
+ '#theme' => 'username',
+ '#account' => user_load($view->lock->owner),
+ );
+ $lock_message_substitutions = array(
+ '!user' => drupal_render($username),
+ '!age' => format_interval(REQUEST_TIME - $view->lock->updated),
+ '!break' => url('admin/structure/views/view/' . $view->id() . '/break-lock'),
+ );
$form['locked'] = array(
'#type' => 'container',
'#attributes' => array('class' => array('view-locked', 'messages', 'messages--warning')),
- '#children' => t('This view is being edited by user !user, and is therefore locked from editing by others. This lock is !age old. Click here to break this lock.', array('!user' => theme('username', array('account' => user_load($view->lock->owner))), '!age' => format_interval(REQUEST_TIME - $view->lock->updated), '!break' => url('admin/structure/views/view/' . $view->id() . '/break-lock'))),
+ '#children' => t('This view is being edited by user !user, and is therefore locked from editing by others. This lock is !age old. Click here to break this lock.', $lock_message_substitutions),
'#weight' => -10,
);
}
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php
index 7bb130ec5d53f289393da0bd5c3dae60840773e6..758996095f284758ad7789c83fdbf49462fb2c52 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php
@@ -38,9 +38,13 @@ public function load() {
* Overrides Drupal\Core\Entity\EntityListController::buildRow();
*/
public function buildRow(EntityInterface $view) {
+ $view_name = array(
+ '#theme' => 'views_ui_view_info',
+ '#view' => $view,
+ );
return array(
'data' => array(
- 'view_name' => theme('views_ui_view_info', array('view' => $view)),
+ 'view_name' => drupal_render($view_name),
'description' => $view->get('description'),
'tag' => $view->get('tag'),
'path' => implode(', ', $view->getPaths()),
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php
index 5877f28d23d5f2b450abe6e9f178c52215d4ef84..df88b0584afa75317c7a5eeb8476f52d15fd2bd9 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php
@@ -682,30 +682,28 @@ public function renderPreview($display_id, $args = array()) {
// Assemble the preview, the query info, and the query statistics in the
// requested order.
- if ($show_location === 'above') {
+ $table = array(
+ '#theme' => 'table',
+ '#prefix' => '
',
+ '#suffix' => '
',
+ );
+ if ($show_location === 'above' || $show_location === 'below') {
if ($combined) {
- $output .= '' . theme('table', array('rows' => array_merge($rows['query'], $rows['statistics']))) . '
';
+ $table['#rows'] = array_merge($rows['query'], $rows['statistics']);
}
else {
- $output .= '' . theme('table', array('rows' => $rows['query'])) . '
';
+ $table['#rows'] = $rows['query'];
}
}
- elseif ($show_stats === 'above') {
- $output .= '' . theme('table', array('rows' => $rows['statistics'])) . '
';
+ elseif ($show_stats === 'above' || $show_stats === 'below') {
+ $table['#rows'] = $rows['statistics']);
}
- $output .= $preview;
-
- if ($show_location === 'below') {
- if ($combined) {
- $output .= '' . theme('table', array('rows' => array_merge($rows['query'], $rows['statistics']))) . '
';
- }
- else {
- $output .= '' . theme('table', array('rows' => $rows['query'])) . '
';
- }
+ if ($show_location === 'above' || $show_stats === 'above') {
+ $output .= drupal_render($table) . $preview;
}
- elseif ($show_stats === 'below') {
- $output .= '' . theme('table', array('rows' => $rows['statistics'])) . '
';
+ elseif ($show_location === 'below' || $show_stats === 'below') {
+ $output .= $preview . drupal_render($table);
}
_current_path($old_q);
diff --git a/core/modules/views_ui/views_ui.theme.inc b/core/modules/views_ui/views_ui.theme.inc
index a0a26303f39514dcb17bd1921ddb35f4ff951f06..301bcd98cbf3d691a7194e45075d105e8f078f6d 100644
--- a/core/modules/views_ui/views_ui.theme.inc
+++ b/core/modules/views_ui/views_ui.theme.inc
@@ -212,10 +212,18 @@ function theme_views_ui_build_group_filter_form($variables) {
);
$rows[] = array('data' => $data, 'id' => 'views-row-' . $group_id, 'class' => array('draggable'));
}
- $table = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('class' => array('views-filter-groups'), 'id' => 'views-filter-groups'))) . drupal_render($form['add_group']);
+ $table = array(
+ '#theme' => 'table',
+ '#header' => $header,
+ '#rows' => $rows,
+ '#attributes' => array(
+ 'class' => array('views-filter-groups'),
+ 'id' => 'views-filter-groups',
+ ),
+ );
drupal_add_tabledrag('views-filter-groups', 'order', 'sibling', 'weight');
$render_form = drupal_render_children($form);
- return $output . $render_form . $table . $more;
+ return $output . $render_form . drupal_render($table) . drupal_render($form['add_group']) . $more;
}
/**
@@ -294,12 +302,29 @@ function theme_views_ui_rearrange_filter_form(&$vars) {
if (!empty($ungroupable_rows)) {
drupal_add_tabledrag('views-rearrange-filters-ungroupable', 'order', 'sibling', 'weight');
$header = array(t('Ungroupable filters'), t('Weight'), array('class' => array('views-hide-label'), 'data' => t('Group')), array('class' => array('views-hide-label'), 'data' => t('Remove')));
- $output .= theme('table', array('header' => $header, 'rows' => $ungroupable_rows, 'attributes' => array('id' => 'views-rearrange-filters-ungroupable', 'class' => array('arrange'))));
+ $table = array(
+ '#theme' => 'table',
+ '#header' => $header,
+ '#rows' => $ungroupable_rows,
+ '#attributes' => array(
+ 'id' => 'views-rearrange-filters-ungroupable',
+ 'class' => array('arrange'),
+ ),
+ );
+ $output .= drupal_render($table);
}
// Set up tabledrag so that the weights are changed when rows are dragged.
drupal_add_tabledrag('views-rearrange-filters', 'order', 'sibling', 'weight');
- $output .= theme('table', array('rows' => $rows, 'attributes' => array('id' => 'views-rearrange-filters', 'class' => array('arrange'))));
+ $table = array(
+ '#theme' => 'table',
+ '#rows' => $rows,
+ '#attributes' => array(
+ 'id' => 'views-rearrange-filters',
+ 'class' => array('arrange'),
+ ),
+ );
+ $output .= drupal_render($table);
$output .= '';
// When JavaScript is enabled, the button for adding a new group should be
@@ -385,7 +410,12 @@ function theme_views_ui_style_plugin_table($variables) {
// Add the special 'None' row.
$rows[] = array(t('None'), '', '', '', '', '', array('align' => 'center', 'data' => drupal_render($form['default'][-1])), '', '');
- $output .= theme('table', array('header' => $header, 'rows' => $rows));
+ $table = array(
+ '#theme' => 'table',
+ '#header' => $header,
+ '#rows' => $rows,
+ );
+ $output .= drupal_render($table);
$output .= drupal_render_children($form);
return $output;
}