function theme_gauth_user_services_list in Google Auth 7
Same name and namespace in other branches
- 7.2 gauth_user/gauth_user.admin.inc \theme_gauth_user_services_list()
Returns HTML for the page containing the list of accounts.
Parameters
array $variables: An associative array containing:
- accounts: An array of all the accounts returned by gauth_user_services_load().
See also
1 theme call to theme_gauth_user_services_list()
- gauth_user_services_list in gauth_user/
gauth_user.admin.inc - Menu callback; Listing of all current services accounts.
File
- gauth_user/
gauth_user.admin.inc, line 32 - Administration pages for Google Auth User Services.
Code
function theme_gauth_user_services_list($variables) {
$accounts = $variables['accounts'];
$header = array(
t('Name'),
t('Api key'),
t('Client Id'),
t('Client Secret'),
t('Services'),
t('Access Type'),
array(
'data' => t('Operations'),
'colspan' => 2,
),
);
$rows = array();
foreach ($accounts as $account) {
$row = array();
$row[] = $account->name;
$row[] = $account->developer_key;
$row[] = $account->client_id;
$row[] = $account->client_secret;
$row[] = implode(", ", gauth_google_services_names($account->services));
$row[] = $account->access_type;
$row[] = l(t('edit'), 'admin/config/services/gauth_user/edit/' . $account->id);
$row[] = l(t('delete'), 'admin/config/services/gauth_user/delete/' . $account->id);
$rows[] = $row;
}
if (empty($rows)) {
$rows[] = array(
array(
'colspan' => 5,
'data' => t('There are currently no Services Accounts. <a href="!url">Add a new one</a>.', array(
'!url' => url('admin/config/services/gauth_user/add'),
)),
),
);
}
$build['pager_table'] = array(
'#theme' => 'table',
'#header' => $header,
'#rows' => $rows,
);
$build['pager_pager'] = array(
'#theme' => 'pager',
);
return $build;
}