You are here

function hosting_quota_admin_defaults_form in Hosting 6.2

Same name and namespace in other branches
  1. 7.4 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 33

Code

function hosting_quota_admin_defaults_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' => $quota['title'],
      '#description' => $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;
}