function _coder_get_default_settings in Coder 5.2
Same name and namespace in other branches
- 5 coder.module \_coder_get_default_settings()
- 6.2 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 493 - Developer Module that assists with code review and version upgrade that supports a plug-in extensible hook system so contributed modules can define additional review standards.
Code
function _coder_get_default_settings($args = 'default') {
$settings['coder_reviews'] = variable_get('coder_reviews', _coder_default_reviews());
$settings['coder_severity'] = variable_get('coder_severity', 5);
$settings['coder_cache'] = variable_get('coder_cache', 1);
// Determine any options based on the passed in URL.
switch ($args) {
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 '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_modules'] = variable_get('coder_modules', array());
$settings['coder_themes'] = variable_get('coder_themes', array());
break;
default:
$settings['coder_includes'] = 1;
// TODO: does this need to go into coder_themes sometimes?
$settings['coder_modules'] = array(
$args => $args,
);
break;
}
return $settings;
}