errorlevelpermission.module in Error Level Permission 7
File
errorlevelpermission.module
View source
<?php
function errorlevelpermission_permission() {
return array(
'errorlevelpermission show errors' => array(
'title' => t('Show errors and warnings'),
),
'errorlevelpermission show all' => array(
'title' => t('Show errors, warnings and notices'),
),
);
}
function errorlevelpermission_init() {
global $conf;
if (!empty($conf['error_level'])) {
variable_set('error_level', ERROR_REPORTING_HIDE);
}
$level = user_access('errorlevelpermission show all') ? ERROR_REPORTING_DISPLAY_ALL : (user_access('errorlevelpermission show errors') ? ERROR_REPORTING_DISPLAY_SOME : ERROR_REPORTING_HIDE);
$conf['error_level'] = $level;
}
function errorlevelpermission_form_system_logging_settings_alter(&$form, &$form_state, $form_id) {
$form['error_level'] = array(
'#type' => 'item',
'#title' => t('Error messages to display'),
'#description' => t('Error Level Permission module took this over with <a href="@link">its permissions</a>.', array(
'@link' => url('admin/people/permissions', array(
'fragment' => 'module-errorlevelpermission',
)),
)),
);
}