Commit a4484238 authored by catch's avatar catch

Issue #2007052 by thedavidmeister: Replace theme() with drupal_render() in views.module.

parent bc7e09a4
......@@ -117,7 +117,8 @@ function views_ajax_form_wrapper($form_id, &$form_state) {
$response = new AjaxResponse();
$display = '';
if ($messages = theme('status_messages')) {
$status_messages = array('#theme' => 'status_messages');
if ($messages = drupal_render($status_messages)) {
$display = '<div class="views-messages">' . $messages . '</div>';
}
$display .= $output;
......
......@@ -79,7 +79,11 @@ public function formatMessages(array $messages) {
$type .= ' messages';
$message = '';
if (count($messages) > 1) {
$message = theme('item_list', array('items' => $messages));
$item_list = array(
'#theme' => 'item_list',
'#items' => $messages,
);
$message = drupal_render($item_list);
}
elseif ($messages) {
$message = array_shift($messages);
......
......@@ -31,8 +31,9 @@ protected function defineOptions() {
public function buildOptionsForm(&$form, &$form_state) {
parent::buildOptionsForm($form, $form_state);
$variables = array(
'items' => array(
$item_list = array(
'#theme' => 'item_list',
'#items' => array(
'@start -- the initial record number in the set',
'@end -- the last record number in the set',
'@total -- the total records in the set',
......@@ -43,7 +44,7 @@ public function buildOptionsForm(&$form, &$form_state) {
'@page_count -- the total page count',
),
);
$list = theme('item_list', $variables);
$list = drupal_render($item_list);
$form['content'] = array(
'#title' => t('Display'),
'#type' => 'textarea',
......
......@@ -1695,11 +1695,12 @@ public function buildOptionsForm(&$form, &$form_state) {
foreach ($options[$type] as $key => $value) {
$items[] = $key . ' == ' . $value;
}
$output .= theme('item_list',
array(
'items' => $items,
'type' => $type
));
$item_list = array(
'#theme' => 'item_list',
'#items' => $items,
'#type' => $type,
);
$output .= drupal_render($item_list);
}
}
}
......@@ -1848,7 +1849,10 @@ public function buildOptionsForm(&$form, &$form_state) {
);
$form['analysis'] = array(
'#markup' => '<div class="form-item">' . theme('item_list', array('items' => $funcs)) . '</div>',
'#theme' => 'item_list',
'#prefix' => '<div class="form-item">',
'#items' => $funcs,
'#suffix' => '</div>',
);
$form['rescan_button'] = array(
......@@ -2083,8 +2087,11 @@ protected function formatThemes($themes) {
}
$fixed[] = $template;
}
return theme('item_list', array('items' => array_reverse($fixed)));
$item_list = array(
'#theme' => 'item_list',
'#items' => array_reverse($fixed),
);
return drupal_render($item_list);
}
/**
......
......@@ -870,11 +870,12 @@ public function buildOptionsForm(&$form, &$form_state) {
foreach ($options[$type] as $key => $value) {
$items[] = $key . ' == ' . $value;
}
$output .= theme('item_list',
array(
'items' => $items,
'type' => $type
));
$item_list = array(
'#theme' => 'item_list',
'#items' => $items,
'#type' => $type,
);
$output .= drupal_render($item_list);
}
}
}
......
......@@ -79,12 +79,13 @@ function render_items($items) {
return implode($this->sanitizeValue($this->options['separator'], 'xss_admin'), $items);
}
else {
return theme('item_list',
array(
'items' => $items,
'title' => NULL,
'type' => $this->options['type']
));
$item_list = array(
'#theme' => 'item_list',
'#items' => $items,
'#title' => NULL,
'#type' => $this->options['type'],
);
return drupal_render($item_list);
}
}
}
......
......@@ -51,8 +51,12 @@ public function attachTo($display_id, $path, $title) {
if (empty($this->view->feed_icon)) {
$this->view->feed_icon = '';
}
$this->view->feed_icon .= theme('feed_icon', array('url' => $url, 'title' => $title));
$feed_icon = array(
'#theme' => 'feed_icon',
'#url' => $url,
'#title' => $title,
);
$this->view->feed_icon .= drupal_render($feed_icon);
drupal_add_html_head_link(array(
'rel' => 'alternate',
'type' => 'application/rss+xml',
......
......@@ -555,10 +555,10 @@ function hook_views_query_alter(ViewExecutable &$view, QueryPluginBase &$query)
*
* @param array $rows
* An associative array with two keys:
* - query: An array of rows suitable for theme('table'), containing
* - query: An array of rows suitable for '#theme' => 'table', containing
* information about the query and the display title and path.
* - statistics: An array of rows suitable for theme('table'), containing
* performance statistics.
* - statistics: An array of rows suitable for '#theme' => 'table',
* containing performance statistics.
* @param \Drupal\views\ViewExecutable $view
* The view object.
*
......@@ -579,7 +579,8 @@ function hook_views_preview_info_alter(array &$rows, ViewExecutable $view) {
*
* @param array $links
* A renderable array of links which will be displayed at the top of the
* view edit form. Each entry will be in a form suitable for theme('link').
* view edit form. Each entry will be in a form suitable for
* '#theme' => 'link'.
* @param \Drupal\views\ViewExecutable $view
* The view object being edited.
* @param string $display_id
......
......@@ -587,7 +587,11 @@ function template_preprocess_views_view_table(&$vars) {
$title = t('sort by @s', array('@s' => $label));
if ($active == $field) {
$label .= theme('tablesort_indicator', array('style' => $initial));
$tablesort_indicator = array(
'#theme' => 'tablesort_indicator',
'#style' => $initial,
);
$label .= drupal_render($tablesort_indicator);
}
$query['order'] = $field;
......@@ -1181,14 +1185,16 @@ function theme_views_mini_pager($vars) {
'#wrapper_attributes' => array('class' => array('pager-next')),
) + $li_next;
return theme('item_list',
array(
'items' => $items,
'title' => NULL,
'type' => 'ul',
'attributes' => array('class' => array('pager')),
)
$item_list = array(
'#theme' => 'item_list',
'#items' => $items,
'#title' => NULL,
'#type' => 'ul',
'#attributes' => array(
'class' => array('pager'),
),
);
return drupal_render($item_list);
}
/**
......
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