function coder_upgrade_modules_build in Coder 7
Same name and namespace in other branches
- 7.2 coder_upgrade/includes/conversion.inc \coder_upgrade_modules_build()
Returns form content for modules tab.
Parameters
array $modules: User selections or default values.
Return value
array Form item.
1 call to coder_upgrade_modules_build()
- coder_upgrade_conversions_form in coder_upgrade/
includes/ conversion.inc - Form builder for the module conversion form.
File
- coder_upgrade/
includes/ conversion.inc, line 208
Code
function coder_upgrade_modules_build(&$modules) {
// Build the module list.
$header = array(
'name' => array(
'data' => t('Name'),
'field' => 'name',
),
'path' => array(
'data' => t('Location'),
'field' => 'path',
),
);
$i = 0;
$rows = coder_upgrade_module_list();
foreach ($rows as $key => $row) {
$rows[$key]['name'] = isset($modules[$key]) ? l($row['name'], coder_upgrade_patch_link($key)) : $row['name'];
$rows[$key]['#weight'] = ++$i;
}
$module_fs = array(
'#type' => 'fieldset',
'#title' => t('Modules'),
'#description' => t('... residing in the selected modules (beneath the drupal directory).'),
'#tree' => TRUE,
);
$module_fs['list'] = array(
'#type' => 'tableselect',
'#header' => $header,
'#options' => $rows,
'#default_value' => isset($modules) ? $modules : array(),
'#empty' => t('No modules available'),
);
return $module_fs;
}