function spaces_dashboard_admin_form in Spaces 6.3
Same name and namespace in other branches
- 7.3 spaces_dashboard/spaces_dashboard.admin.inc \spaces_dashboard_admin_form()
- 7 spaces_dashboard/spaces_dashboard.admin.inc \spaces_dashboard_admin_form()
Provide a form that allows administrators to select which blcoks are available in which dashboards.
1 string reference to 'spaces_dashboard_admin_form'
- spaces_dashboard_menu in spaces_dashboard/
spaces_dashboard.module - Implementation of hook_menu()
File
- spaces_dashboard/
spaces_dashboard.admin.inc, line 43
Code
function spaces_dashboard_admin_form() {
$blocks = context_get_plugin('reaction', 'block')
->get_blocks(NULL, NULL, TRUE);
$default = variable_get('spaces_dashboard_blocks', array());
$form['spaces_dashboard_blocks'] = array(
'#tree' => TRUE,
'#theme' => 'spaces_dashboard_admin_form',
);
ksort($blocks);
foreach ($blocks as $k => $block) {
$module = spaces_dashboard_get_module($block);
$info = context_get_info('module', $module);
$form['spaces_dashboard_blocks'][$k] = array(
'#type' => 'checkbox',
'#title' => $block->info,
'#grouping' => $info['name'],
'#grouping_id' => $module,
);
if (isset($default[$k])) {
$form['spaces_dashboard_blocks'][$k]['#default_value'] = $default[$k];
}
}
return system_settings_form($form);
}