| 9 | | $form['disk_space_limit'] = array( |
|---|
| | 9 | $form['i_general'] = array( |
|---|
| | 10 | '#type' => 'fieldset', |
|---|
| | 11 | '#title' => 'General Settings', |
|---|
| | 12 | '#description' => 'The settings apply to all the utilities below.', |
|---|
| | 13 | ); |
|---|
| | 14 | $form['i_general']['email_warnings_role'] = array( |
|---|
| | 15 | '#type' => 'textfield', |
|---|
| | 16 | '#title' => t('Role to receive warning emails'), |
|---|
| | 17 | '#default_value' => variable_get('email_warnings_role', 'site administrator'), |
|---|
| | 18 | '#size' => 20, |
|---|
| | 19 | '#maxlength' => 25, |
|---|
| | 20 | '#description' => t("The role entered here here will receive warning messages by email."), |
|---|
| | 21 | '#required' => TRUE, |
|---|
| | 22 | ); |
|---|
| | 23 | $form['i_diskspace'] = array( |
|---|
| | 24 | '#type' => 'fieldset', |
|---|
| | 25 | '#title' => 'Disk Space Usage Settings', |
|---|
| | 26 | '#description' => 'These settings apply to disk usage on this site.', |
|---|
| | 27 | ); |
|---|
| | 28 | $form['i_diskspace']['disk_space_limit'] = array( |
|---|
| 19 | | $form['disk_space_warnings_role'] = array( |
|---|
| 20 | | '#type' => 'textfield', |
|---|
| 21 | | '#title' => t('Role to receive warning emails'), |
|---|
| 22 | | '#default_value' => variable_get('disk_space_warnings_role', 'site administrator'), |
|---|
| 23 | | '#size' => 20, |
|---|
| 24 | | '#maxlength' => 25, |
|---|
| 25 | | '#description' => t("The role entered here here will receive warning messages by email should the site exceed the space limitations."), |
|---|
| 26 | | '#required' => TRUE, |
|---|
| 27 | | ); |
|---|
| | 38 | $form['i_hostingdate'] = array( |
|---|
| | 39 | '#type' => 'fieldset', |
|---|
| | 40 | '#title' => 'Hosting date settings.', |
|---|
| | 41 | '#description' => 'These settings apply to the length and expiry of hosting contracts.', |
|---|
| | 42 | ); |
|---|
| | 43 | $next_year = time() + 31556926; |
|---|
| | 44 | $now = time(); |
|---|
| | 45 | $expiry_date = variable_get('hosting_expiry_date', $next_year); |
|---|
| | 46 | $start_date = variable_get('hosting_start_date',$now); |
|---|
| | 47 | $form['i_hostingdate']['hosting_start_date'] = array( |
|---|
| | 48 | '#type' => 'date', |
|---|
| | 49 | '#title' => t('Hosting start date.'), |
|---|
| | 50 | '#default_value' => array( |
|---|
| | 51 | 'month' => format_date($start_date, 'custom', 'n'), |
|---|
| | 52 | 'day' => format_date($start_date, 'custom', 'j'), |
|---|
| | 53 | 'year' => format_date($start_date, 'custom', 'Y'), |
|---|
| | 54 | ), |
|---|
| | 55 | '#description' => t("Hosting for this site began on the date here. This should not be changed once set."), |
|---|
| | 56 | '#required' => TRUE, |
|---|
| | 57 | ); |
|---|
| | 58 | $form['i_hostingdate']['hosting_expiry_date'] = array( |
|---|
| | 59 | '#type' => 'date', |
|---|
| | 60 | '#title' => t('Hosting expiry date.'), |
|---|
| | 61 | '#default_value' => array( |
|---|
| | 62 | 'month' => format_date($expiry_date, 'custom', 'n'), |
|---|
| | 63 | 'day' => format_date($expiry_date, 'custom', 'j'), |
|---|
| | 64 | 'year' => format_date($expiry_date, 'custom', 'Y'), |
|---|
| | 65 | ), |
|---|
| | 66 | '#description' => t("Hosting for this site expires on the date here. Users with the role defined above will recieve reminder emails when the renewal date approaches"), |
|---|
| | 67 | '#required' => TRUE, |
|---|
| | 68 | ); |
|---|
| | 69 | $hosting_term_period = drupal_map_assoc( |
|---|
| | 70 | array( |
|---|
| | 71 | 31536000, |
|---|
| | 72 | 2*31536000, |
|---|
| | 73 | 3*31536000, |
|---|
| | 74 | 4*31536000, |
|---|
| | 75 | 5*31536000, |
|---|
| | 76 | 6*31536000, |
|---|
| | 77 | 7*31536000, |
|---|
| | 78 | 8*31536000, |
|---|
| | 79 | 9*31536000, |
|---|
| | 80 | 10*31536000, |
|---|
| | 81 | 11*31536000, |
|---|
| | 82 | 12*31536000 |
|---|
| | 83 | ), 'format_interval' |
|---|
| | 84 | ); |
|---|
| | 85 | $form['i_hostingdate']['hosting_term'] = array( |
|---|
| | 86 | '#type' => 'select', |
|---|
| | 87 | '#title' => t('Web hosting term'), |
|---|
| | 88 | '#default_value' => variable_get('hosting_term', 31536000), |
|---|
| | 89 | '#options' => $hosting_term_period, |
|---|
| | 90 | '#description' => t(""), |
|---|
| | 91 | '#required' => TRUE, |
|---|
| | 92 | ); |
|---|
| | 93 | |
|---|