Skip to content

Instantly share code, notes, and snippets.

@mikeyp
Created June 21, 2013 22:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeyp/5834928 to your computer and use it in GitHub Desktop.
Save mikeyp/5834928 to your computer and use it in GitHub Desktop.
Lets play a game. Do you think it's possible to un-check "Emergency" on the settings form, and save that change?
<?php
/**
* Form builder for settings form.
*/
function honeybadger_settings_form($form, &$form_state) {
$form['honeybadger_api_key'] = array(
'#type' => 'textfield',
'#title' => t('Honeybadger.io API key'),
'#default_value' => variable_get('honeybadger_api_key'. ''),
'#description' => t('Enter the <strong>Private API Key</strong> from the Setttings section of the Honeybadger.io project that corresponds with this site.')
);
$form['honeybadger_api_levels'] = array(
'#type' => 'checkboxes',
'#title' => t('Error levels to be sent to Honeybadger.io'),
'#description' => t('Only errors that correspond with the checked error levels will be sent to Honeybadger.io.'),
'#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