function _coder_settings_array in Coder 6.2
Same name and namespace in other branches
- 5.2 coder.module \_coder_settings_array()
- 5 coder.module \_coder_settings_array()
- 6 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 572
Code
function _coder_settings_array(&$form_state, $type) {
$typekey = "coder_{$type}s-";
$typelen = drupal_strlen($typekey);
$systems = array();
foreach ($form_state['storage'] as $key => $value) {
if (drupal_substr($key, 0, $typelen) == $typekey) {
if ($value == 1) {
$system = drupal_substr($key, $typelen);
$systems[$system] = 1;
}
unset($form_state['storage'][$key]);
unset($form_state['values'][$key]);
}
}
return $systems;
}