You are here

function hosting_quota_admin_defaults_form in Hosting 7.4

Same name and namespace in other branches
  1. 6.2 quota/hosting_quota.admin.inc \hosting_quota_admin_defaults_form()
  2. 7.3 quota/hosting_quota.admin.inc \hosting_quota_admin_defaults_form()

Callback for admin/hosting/quotas/defaults

1 string reference to 'hosting_quota_admin_defaults_form'
hosting_quota_menu in quota/hosting_quota.module
Implements hook_menu().

File

quota/hosting_quota.admin.inc, line 41
hosting_quota.admin.inc Admin forms for the quota module.

Code

function hosting_quota_admin_defaults_form($form, $form_state) {
  $form = array();
  $all_resources = module_invoke_all('hosting_quota_resource');
  $form['info'] = array(
    '#type' => 'markup',
    '#prefix' => '<p>',
    '#value' => t('Set default limits for each resource. This value will be used as the default value when new clients are created and to set quota limits for all clients currently without limits'),
    '#suffix' => '</p>',
  );
  $form['quota'] = array(
    '#type' => 'fieldset',
    '#title' => t('Client quota settings'),
    '#access' => user_access('edit all quotas'),
    '#collapsible' => FALSE,
    '#collapsed' => FALSE,
  );
  foreach ($all_resources as $resource => $quota) {
    $form['quota'][$resource] = array(
      '#title' => check_plain($quota['title']),
      '#description' => check_plain($quota['description']),
      '#type' => 'textfield',
      '#default_value' => variable_get("hosting_quota_default_{$resource}", 0),
    );
  }
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Submit'),
  );
  $form['#tree'] = TRUE;
  return $form;
}