Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Lets play a game. Do you think it's possible to un-check "Emergency" on the settings form, and save that change?
* Form builder for settings form.
function honeybadger_settings_form($form, &$form_state) {
$form['honeybadger_api_key'] = array(
'#type' => 'textfield',
'#title' => t(' API key'),
'#default_value' => variable_get('honeybadger_api_key'. ''),
'#description' => t('Enter the <strong>Private API Key</strong> from the Setttings section of the project that corresponds with this site.')
$form['honeybadger_api_levels'] = array(
'#type' => 'checkboxes',
'#title' => t('Error levels to be sent to'),
'#description' => t('Only errors that correspond with the checked error levels will be sent to'),
'#options' => array(
WATCHDOG_EMERGENCY => t('Emergency'),
WATCHDOG_ALERT => t('Alert'),
WATCHDOG_CRITICAL => t('Critical'),
WATCHDOG_ERROR => t('Error'),
WATCHDOG_WARNING => t('Warning'),
WATCHDOG_NOTICE => t('Notice'),
WATCHDOG_INFO => t('Info'),
WATCHDOG_DEBUG => t('Debug'),
'#default_value' => variable_get('honeybadger_api_levels', array()),
return system_settings_form($form);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.