function _coder_settings_array in Coder 6
Same name and namespace in other branches
- 5.2 coder.module \_coder_settings_array()
- 5 coder.module \_coder_settings_array()
- 6.2 coder.module \_coder_settings_array()
Generate settings array for either modules or themes.
Parameters
$form_state: Form array passed to submit function (note: entries that are processed. are removed for efficiency's sake).
$type: String type to generate settings for, either 'module' or 'theme'.
Return value
Settings lookup array in form module/theme name => 1
2 calls to _coder_settings_array()
- coder_page_form in ./
coder.module - Implementation of hook_form().
- coder_settings_form_submit in ./
coder.module - Callback function for settings page in Drupal 5.
File
- ./
coder.module, line 555 - 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_settings_array(&$form_state, $type) {
$typekey = "coder_{$type}s-";
$typelen = strlen($typekey);
$systems = array();
foreach ($form_state['storage'] as $key => $value) {
if (substr($key, 0, $typelen) == $typekey) {
if ($value == 1) {
$system = substr($key, $typelen);
$systems[$system] = 1;
}
unset($form_state['storage'][$key]);
unset($form_state['values'][$key]);
}
}
return $systems;
}