function hosting_quota_resource_render in Hosting 7.3
Same name and namespace in other branches
- 6.2 quota/hosting_quota.module \hosting_quota_resource_render()
- 7.4 quota/hosting_quota.module \hosting_quota_resource_render()
Rendering function for quotas
Parameters
$resource array|string: Either a resource retrieved via hosting_quota_get or the machine name of a resource
$usage int: The usage as returned by hosting_quota_get_usage
Return value
mixed The rendered usage string
2 calls to hosting_quota_resource_render()
- hosting_quota_admin_client_list in quota/
hosting_quota.admin.inc - Page callback for admin/hosting/quotas
- hosting_quota_get_all_info in quota/
hosting_quota.module - @todo Please document this function.
File
- quota/
hosting_quota.module, line 151 - Implement quota's for the resource used by client.
Code
function hosting_quota_resource_render($resource, $usage) {
$rendered_usage = '';
if (!is_array($resource)) {
$resource = hosting_quota_get($resource);
}
$resource_name = key($resource);
$resource = $resource[$resource_name];
if ($resource['module']) {
$rendered_usage = module_invoke($resource['module'], 'hosting_quota_resource_render', $resource_name, $usage);
}
return $rendered_usage;
}