function spaces_features_form in Spaces 5.2
Same name and namespace in other branches
- 5 spaces_admin.inc \spaces_features_form()
- 6.3 spaces.admin.inc \spaces_features_form()
- 6 spaces_admin.inc \spaces_features_form()
- 6.2 spaces_admin.inc \spaces_features_form()
- 7.3 spaces.admin.inc \spaces_features_form()
- 7 spaces.admin.inc \spaces_features_form()
FEATURE SETTINGS ===================================================
2 string references to 'spaces_features_form'
- spaces_active_space_menu in ./
spaces.module - A mild abstraction of hook_menu() items that can be used by implementing modules to embed/graft relevant spaces items into the menu tree. Should only be used when the $may_cache argument of hook_menu() is false.
- spaces_preset_form in ./
spaces_admin.inc - Form for adding or editing a spaces preset.
File
- ./
spaces_admin.inc, line 515
Code
function spaces_features_form($space) {
// Set a wide layout for themes that support it
context_set('theme', 'layout', 'wide');
spaces_preset_enforce($space);
$form = _spaces_features_form($space);
// Add customization link if feature is not disabled
$form['customize'] = array(
'#tree' => TRUE,
);
foreach (element_children($form['features']) as $id) {
if (isset($space->features[$id]) && $space->features[$id] != SPACES_FEATURE_DISABLED) {
$form['customize'][$id] = array(
'#type' => 'markup',
'#value' => l(t('Customize'), 'spaces/customize/' . $id),
);
}
}
// Lock features
if ($space->preset) {
$presets = spaces_presets($space->type);
$preset = $presets[$space->preset];
if (isset($preset['locked']['features'])) {
foreach ($preset['preset']['locked']['features'] as $id => $value) {
if ($value) {
$form['features'][$id]['#disabled'] = true;
$form['features'][$id]['#locked'] = true;
// attribute used in theme layer
}
}
}
}
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Submit'),
'#weight' => 10,
);
return $form;
}