function bootstrap_site_alert_admin in Bootstrap Site Alert 7
Configuration Form for the site alerts.
1 string reference to 'bootstrap_site_alert_admin'
- bootstrap_site_alert_menu in ./
bootstrap_site_alert.module - Implements hook_menu().
File
- includes/
bootstrap_site_alert.admin.inc, line 11 - The bootstrap_site_alert Admin Settings file.
Code
function bootstrap_site_alert_admin() {
$form = array();
$form['description'] = array(
'#markup' => t('<h3>Use this form to setup the bootstrap site alert.</h3>
<p>Make sure you select the checkbox if you want to turn the alerts on</p>'),
);
$form['bootstrap_site_alert_active'] = array(
'#type' => 'checkbox',
'#title' => t('If Checked, Bootstrap Site Alert is Active.'),
'#default_value' => variable_get('bootstrap_site_alert_active', FALSE),
);
$form['bootstrap_site_alert_severity'] = array(
'#type' => 'select',
'#title' => t('Severity'),
'#options' => array(
'alert-success' => t('Success'),
'alert-info' => t('Info'),
'alert-warning' => t('Warning'),
'alert-danger' => t('Danger'),
),
'#empty_option' => t('- SELECT -'),
'#default_value' => variable_get('bootstrap_site_alert_severity', NULL),
'#required' => TRUE,
);
$form['bootstrap_site_alert_dismiss'] = array(
'#type' => 'checkbox',
'#title' => t('Make this alert dismissable?'),
'#default_value' => variable_get('bootstrap_site_alert_dismiss', FALSE),
);
$form['bootstrap_site_alert_no_admin'] = array(
'#type' => 'checkbox',
'#title' => t('Hide this alert on admin pages?'),
'#default_value' => variable_get('bootstrap_site_alert_no_admin', FALSE),
);
// Need to load the text_format default a little differently.
$message = variable_get('bootstrap_site_alert_message', array(
'value' => '',
'format' => NULL,
));
$form['bootstrap_site_alert_message'] = array(
'#type' => 'text_format',
'#title' => t('Alert Message'),
'#default_value' => $message['value'],
'#required' => TRUE,
);
$form['#submit'][] = 'bootstrap_site_alert_custom_submit';
return system_settings_form($form);
}