function theme_hosting_quota_admin_list in Hosting 7.4
Same name and namespace in other branches
- 6.2 quota/hosting_quota.module \theme_hosting_quota_admin_list()
- 7.3 quota/hosting_quota.module \theme_hosting_quota_admin_list()
Theme the admin list of client quotas
Parameters
$variables array:
Return value
string String containing table
1 theme call to theme_hosting_quota_admin_list()
- hosting_quota_admin_client_list in quota/
hosting_quota.admin.inc - Page callback for admin/hosting/quotas
File
- quota/
hosting_quota.module, line 435 - Implement quota's for the resource used by client.
Code
function theme_hosting_quota_admin_list($variables) {
$client_quotas = $variables['client_quotas'];
$resources = $variables['resources'];
$items_per_page = $variables['items_per_page'];
$header = array(
t('Client'),
);
$rows = array();
foreach ($resources as $resource) {
$header[] = t('@resource (Used / Limit)', array(
'@resource' => $resource['title'],
));
}
foreach ($client_quotas as $client_nid => $quotas) {
$row = array();
$row[] = l($quotas['name'], "node/{$client_nid}");
foreach ($resources as $resource => $resource_info) {
// Provide a visual indication if the usage is over the limit
if ($quotas[$resource]['usage'] > $quotas[$resource]['limit']) {
$row[] = array(
'data' => "{$quotas[$resource]['rendered usage']} / {$quotas[$resource]['rendered limit']}",
'class' => array(
'warning',
),
);
}
else {
$row[] = "{$quotas[$resource]['rendered usage']} / {$quotas[$resource]['rendered limit']}";
}
}
$rows[] = $row;
}
return '<p>' . t('Usage information for the last month.') . '</p>' . theme('table', array(
'header' => $header,
'rows' => $rows,
)) . theme('pager', array(
'tags' => array(),
));
}