By podarok on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Issue links:
Description:
A few core theme functions have been removed to make the theme layer in Drupal 8 simpler and easier to extend with a custom layer like in a true framework.
- theme_user_list() - this function was just a wrapper around theme_item_list().
- All theme_pager_*() functions that were rendering links to pages have been removed. theme_pager() now builds a render array, where links are expressed as '#type' => 'link' elements.
- theme_book_title_link() - replaced by l()
…and a few more (feel free to add follow-up issues to this list).
theme_user_list()
user_list is now exposed as a renderable array and there's no theme_user_list() in core anymore.
Drupal 7
function user_block_view($delta = '') {
global $user;
$block = array();
switch ($delta) {
//...
case 'new':
if (user_access('access content')) {
// Retrieve a list of new users who have subsequently accessed the site successfully.
$items = db_query_range('SELECT uid, name FROM {users} WHERE status <> 0 AND access <> 0 ORDER BY created DESC', 0, variable_get('user_block_whois_new_count', 5))->fetchAll();
$output = theme('user_list', array('users' => $items));
$block['subject'] = t('Who\'s new');
$block['content'] = $output;
}
//...
}
return $block;
}
Drupal 8
user_list has become item_list now.
function user_block_view($delta = '') {
$block['content'] = array(
'#theme' => 'item_list__user__new',
'#items' => array(),
);
}
function user_block_view($delta = '') {
$block['subject'] = t('Who\'s online');
$block['content'] = array(
'#theme' => 'item_list__user__online',
'#items' => array(),
'#prefix' => '<p>' . format_plural($authenticated_count, 'There is currently 1 user online.', 'There are currently @count users online.') . '</p>',
);
Impacts:
Site builders, administrators, editors
Module developers
Themers
Comments
Perhaps change this CR's title to something less... alarming?
Just a quick suggestion - I was scanning through the change records list and saw this one and thought "What! They've got rid of theme functions?!?!?"Ahh, I see - just got rid of one or two theme functions.Not the whole concept of theme functions.Dandy.Ahh. I see. We have got rid of theme functions: #1831138: Completely new theme/template system: Twig.
Well I feel stupid :p