function _coder_get_default_settings in Coder 6.2
Same name and namespace in other branches
- 5.2 coder.module \_coder_get_default_settings()
- 5 coder.module \_coder_get_default_settings()
- 6 coder.module \_coder_get_default_settings()
Returns a active settings array for coder.
@note The name is a misnomer, but is a largely correct characterization for most of Coder's settings as the variables usually do not exist.
Parameters
$args: String settings argument, can be 'settings', 'active', 'core', 'all' and 'default'.
Return value
Associative array of settings in form setting name => setting value.
3 calls to _coder_get_default_settings()
- coder_admin_settings in ./
coder.module - Implementation of settings page for Drupal 5.
- coder_drush_review in ./
coder.drush.inc - coder_page_form in ./
coder.module - Implementation of hook_form().
File
- ./
coder.module, line 611
Code
function _coder_get_default_settings($arg = 'default') {
$settings['coder_reviews'] = variable_get('coder_reviews', _coder_default_reviews());
$settings['coder_severity'] = variable_get('coder_severity', SEVERITY_NORMAL);
// Determine any options based on the passed in URL.
switch ($arg) {
case 'settings':
$settings['coder_includes'] = 1;
break;
case 'active':
$settings['coder_active_modules'] = 1;
break;
case 'core':
$settings['coder_core'] = 1;
$settings['coder_includes'] = 1;
break;
case 'all':
$settings['coder_core'] = 1;
$settings['coder_includes'] = 1;
$settings['coder_all'] = 1;
break;
case 'contrib':
$settings['coder_includes'] = 1;
$settings['coder_contrib'] = 1;
break;
case 'patches':
$settings['coder_patches'] = 1;
break;
case 'default':
$settings['coder_active_modules'] = variable_get('coder_active_modules', 1);
$settings['coder_core'] = variable_get('coder_core', 0);
$settings['coder_includes'] = variable_get('coder_includes', 0);
$settings['coder_includes_exclusions'] = variable_get('coder_includes_exclusions', '');
$settings['coder_modules'] = variable_get('coder_modules', array());
$settings['coder_themes'] = variable_get('coder_themes', array());
break;
default:
$settings['coder_includes'] = 1;
$settings['coder_includes_exclusions'] = variable_get('coder_includes_exclusions', '');
// TODO: Does this need to go into coder_themes sometimes?
$settings['coder_modules'] = array(
$arg => $arg,
);
break;
}
return $settings;
}