function space_setting_home::form in Spaces 6
Same name and namespace in other branches
- 5.2 spaces.module \space_setting_home::form()
- 6.2 spaces.spaces.inc \space_setting_home::form()
Overrides space_setting::form
File
- ./
spaces.module, line 548
Class
- space_setting_home
- Provides a homepage setting for each space.
Code
function form($space, $value = array()) {
$options = array(
0 => '---',
);
foreach (spaces_features($space->type) as $f => $feature) {
if ($feature->spaces['menu'] && isset($space->features[$f]) && $space->features[$f] != SPACES_FEATURE_DISABLED) {
$options[$f] = $feature->spaces['label'];
}
}
$form = array(
'#title' => t('Homepage'),
'#description' => t('The default page for this space.'),
'#type' => 'select',
'#options' => $options,
'#validate' => array(
'spaces_setting_validate' => array(
$this->id,
),
),
'#default_value' => $value ? $value : 0,
);
return $form;
}