diff --git a/core/modules/user/lib/Drupal/user/Plugin/Block/UserNewBlock.php b/core/modules/user/lib/Drupal/user/Plugin/Block/UserNewBlock.php index 847512acf35..d7269a3cff9 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/Block/UserNewBlock.php +++ b/core/modules/user/lib/Drupal/user/Plugin/Block/UserNewBlock.php @@ -72,7 +72,11 @@ class UserNewBlock extends BlockBase { '#items' => array(), ); foreach ($items as $account) { - $build['#items'][] = theme('username', array('account' => $account)); + $username = array( + '#theme' => 'username', + '#account' => $account, + ); + $build['#items'][] = drupal_render($username); } return $build; } diff --git a/core/modules/user/lib/Drupal/user/Plugin/Block/UserOnlineBlock.php b/core/modules/user/lib/Drupal/user/Plugin/Block/UserOnlineBlock.php index f2452c9d58e..3f5b0b2b455 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/Block/UserOnlineBlock.php +++ b/core/modules/user/lib/Drupal/user/Plugin/Block/UserOnlineBlock.php @@ -95,7 +95,11 @@ class UserOnlineBlock extends BlockBase { if ($authenticated_count && $max_users) { $uids = db_query_range('SELECT uid FROM {users} WHERE access >= :interval AND uid > 0 ORDER BY access DESC', 0, $max_users, array(':interval' => $interval))->fetchCol(); foreach (user_load_multiple($uids) as $account) { - $build['#items'][] = theme('username', array('account' => $account)); + $username = array( + '#theme' => 'username', + '#account' => $account, + ); + $build['#items'][] = drupal_render($username); } } diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/field/Name.php b/core/modules/user/lib/Drupal/user/Plugin/views/field/Name.php index d36f618b74c..b09e84a8506 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/views/field/Name.php +++ b/core/modules/user/lib/Drupal/user/Plugin/views/field/Name.php @@ -85,7 +85,11 @@ class Name extends User { } elseif (!empty($this->options['link_to_user'])) { $account->name = $this->getValue($values); - return theme('username', array('account' => $account)); + $username = array( + '#theme' => 'username', + '#account' => $account, + ); + return drupal_render($username); } } // If we want a formatted username, do that. diff --git a/core/modules/user/user.admin.inc b/core/modules/user/user.admin.inc index 95a03820554..f9982e84927 100644 --- a/core/modules/user/user.admin.inc +++ b/core/modules/user/user.admin.inc @@ -47,13 +47,20 @@ function user_admin_account() { $users_roles[] = $roles[$user_role->rid]; } asort($users_roles); - + $username = array( + '#theme' => 'username', + '#account' => $account, + ); + $item_list = array( + '#theme' => 'item_list', + '#items' => $users_roles, + ); $options[$account->uid] = array( - 'username' => theme('username', array('account' => $account)), - 'status' => $status[$account->status], - 'roles' => theme('item_list', array('items' => $users_roles)), + 'username' => drupal_render($username), + 'status' => $status[$account->status], + 'roles' => drupal_render($item_list), 'member_for' => format_interval(REQUEST_TIME - $account->created), - 'access' => $account->access ? t('@time ago', array('@time' => format_interval(REQUEST_TIME - $account->access))) : t('never'), + 'access' => $account->access ? t('@time ago', array('@time' => format_interval(REQUEST_TIME - $account->access))) : t('never'), ); $links = array(); $links['edit'] = array( @@ -83,7 +90,9 @@ function user_admin_account() { '#rows' => $options, '#empty' => t('No people available.'), ); - $form['pager'] = array('#markup' => theme('pager')); + $form['pager'] = array( + '#theme' =>'pager', + ); return $form; } @@ -137,10 +146,15 @@ function user_admin_permissions($form, $form_state, $rid = NULL) { 'warning' => !empty($perm_item['restrict access']) ? t('Warning: Give to trusted roles only; this permission has security implications.') : '', ); $options[$perm] = ''; + $user_permission_description = array( + '#theme' => 'user_permission_description', + '#permission_item' => $perm_item, + '#hide' => $hide_descriptions, + ); $form['permission'][$perm] = array( '#type' => 'item', '#markup' => $perm_item['title'], - '#description' => theme('user_permission_description', array('permission_item' => $perm_item, 'hide' => $hide_descriptions)), + '#description' => drupal_render($user_permission_description), ); foreach ($role_names as $rid => $name) { // Builds arrays for checked boxes for each role @@ -224,8 +238,19 @@ function theme_user_admin_permissions($variables) { foreach (element_children($form['role_names']) as $rid) { $header[] = array('data' => drupal_render($form['role_names'][$rid]), 'class' => array('checkbox')); } - $output = theme('system_compact_link'); - $output .= theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'permissions'))); + $system_compact_link = array( + '#theme' => 'system_compact_link', + ); + $table = array( + '#theme' => 'table', + '#header' => $header, + '#rows' => $rows, + '#attributes' => array( + 'id' => 'permissions', + ), + ); + $output = drupal_render($system_compact_link); + $output .= drupal_render($table); $output .= drupal_render_children($form); return $output; }