function hosting_quota_node_view in Hosting 7.4
Same name and namespace in other branches
- 7.3 quota/hosting_quota.module \hosting_quota_node_view()
Implements hook_node_view().
File
- quota/
hosting_quota.module, line 342 - Implement quota's for the resource used by client.
Code
function hosting_quota_node_view($node, $view_mode, $langcode) {
global $user;
if ($node->type == 'client') {
$allowed_clients = array_keys(hosting_get_client_from_user($user->uid));
if (user_access('view all quotas') || in_array($node->nid, $allowed_clients) && user_access('view own quota')) {
$node->content['info']['quota'] = array(
'#type' => 'item',
'#title' => 'Quota',
'#markup' => theme('hosting_quota_client', array(
'node' => $node,
)),
'#weight' => 5,
);
}
}
}