diff --git a/core/modules/user/user.admin.inc b/core/modules/user/user.admin.inc deleted file mode 100644 index 56a2b94..0000000 --- a/core/modules/user/user.admin.inc +++ /dev/null @@ -1,91 +0,0 @@ - array('data' => t('Username'), 'field' => 'u.name'), - 'status' => array('data' => t('Status'), 'field' => 'u.status', 'class' => array(RESPONSIVE_PRIORITY_LOW)), - 'roles' => array('data' => t('Roles'), 'class' => array(RESPONSIVE_PRIORITY_LOW)), - 'member_for' => array('data' => t('Member for'), 'field' => 'u.created', 'sort' => 'desc', 'class' => array(RESPONSIVE_PRIORITY_LOW)), - 'access' => array('data' => t('Last access'), 'field' => 'u.access', 'class' => array(RESPONSIVE_PRIORITY_LOW)), - 'operations' => t('Operations'), - ); - - $query = db_select('users', 'u'); - $query->condition('u.uid', 0, '<>'); - - $count_query = clone $query; - $count_query->addExpression('COUNT(u.uid)'); - - $query = $query - ->extend('Drupal\Core\Database\Query\PagerSelectExtender') - ->extend('Drupal\Core\Database\Query\TableSortExtender'); - $query - ->fields('u', array('uid')) - ->limit(50) - ->orderByHeader($header) - ->setCountQuery($count_query); - $uids = $query->execute() - ->fetchCol('uid'); - - $destination = drupal_get_destination(); - $accounts = user_load_multiple($uids); - - foreach ($accounts as $account) { - $users_roles = $account->getRoles(); - unset($users_roles[0]); - asort($users_roles); - $username = array( - '#theme' => 'username', - '#account' => $account, - ); - $item_list = array( - '#theme' => 'item_list', - '#items' => $users_roles, - ); - $options[$account->id()] = array( - 'username' => drupal_render($username), - 'status' => $account->isActive() ? t('active') : t('blocked'), - 'roles' => drupal_render($item_list), - 'member_for' => format_interval(REQUEST_TIME - $account->getCreatedTime()), - 'access' => $account->getLastAccessedTime() ? t('@time ago', array('@time' => format_interval(REQUEST_TIME - $account->getLastAccessedTime()))) : t('never'), - ); - $links = array(); - $links['edit'] = array( - 'title' => t('Edit'), - 'href' => 'user/' . $account->id() . '/edit', - 'query' => $destination, - ); - if (module_invoke('content_translation', 'translate_access', $account)) { - $links['translate'] = array( - 'title' => t('Translate'), - 'href' => 'user/' . $account->id() . '/translations', - 'query' => $destination, - ); - } - $options[$account->id()]['operations']['data'] = array( - '#type' => 'operations', - '#links' => $links, - ); - - } - - $form['accounts'] = array( - '#theme' => 'table', - '#header' => $header, - '#rows' => $options, - '#empty' => t('No people available.'), - ); - $form['pager'] = array( - '#theme' =>'pager', - ); - - return $form; -}