class space_setting_home in Spaces 6.2
Same name and namespace in other branches
- 5.2 spaces.module \space_setting_home
- 6 spaces.module \space_setting_home
Provides a homepage setting for each space.
Hierarchy
- class \space_setting_home implements space_setting
Expanded class hierarchy of space_setting_home
1 string reference to 'space_setting_home'
- spaces_spaces_settings in ./
spaces.module - Implementation of hook_spaces_settings().
File
- ./
spaces.spaces.inc, line 6
View source
class space_setting_home implements space_setting {
var $id;
function __construct($id = NULL) {
if ($id) {
$this->id = $id;
}
else {
$this->id = 'home';
}
}
function form($space, $value = array()) {
$options = array(
0 => '---',
);
// This is exceedingly hackish but effective way of ensuring that
// the link options provided are correct, especially when being
// generated on preset forms.
$original = spaces_get_space();
spaces_set_space($space, TRUE);
$links = menu_navigation_links('features');
spaces_set_space($original, TRUE);
$form = array();
if (count($links)) {
foreach ($links as $link) {
$options[$link['href']] = $link['title'];
}
$form = array(
'#title' => t('Homepage'),
'#description' => t('The default page for this space.'),
'#type' => 'select',
'#options' => $options,
'#default_value' => $value ? $value : 0,
);
}
return $form;
}
function validate($space, $value) {
// Exclude space "prototypes" (like that used for the preset form)
/*
if ($space->sid) {
if (!$value && is_array($space->features) && (array_sum($space->features) != 0)) {
form_set_error('settings]['. $this->id, t('You must select a homepage for this space.'));
}
}
*/
}
function submit($space, $value) {
return $value;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
space_setting_home:: |
property | |||
space_setting_home:: |
function |
Overrides space_setting:: |
||
space_setting_home:: |
function |
Overrides space_setting:: |
||
space_setting_home:: |
function |
Overrides space_setting:: |
||
space_setting_home:: |
function |
Overrides space_setting:: |