function spaces_handler_field_node::options_form in Spaces 6.3
Same name and namespace in other branches
- 7.3 includes/spaces_handler_field_node.inc \spaces_handler_field_node::options_form()
- 7 includes/spaces_handler_field_node.inc \spaces_handler_field_node::options_form()
Override of options_form().
File
- includes/
spaces_handler_field_node.inc, line 19
Class
Code
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
// @TODO: atm this assumes a pattern of spaces_{$type} for the PURL
// provider corresponding to each space type. Fixing this requires some
// serious overhaul of the explicit connection (read: there is none
// currently) between a space type and its PURL provider.
$types = array();
foreach (spaces_types() as $type => $info) {
if (strpos('node/%node', $info['path']) === 0) {
$types["spaces_{$type}"] = $info['title'];
}
}
if (!empty($types)) {
$form['spaces']['#tree'] = TRUE;
$form['spaces']['frontpage'] = array(
'#title' => t('Link to space frontpage'),
'#description' => t('Link a group node to its frontpage instead of its node page.'),
'#type' => 'checkbox',
'#default_value' => !empty($this->options['spaces']['frontpage']),
'#process' => array(
'views_process_dependency',
),
'#dependency' => array(
'edit-options-link-to-node' => array(
1,
),
),
);
$form['spaces']['type'] = array(
'#title' => t('Space type'),
'#type' => 'select',
'#options' => $types,
'#default_value' => !empty($this->options['spaces']['type']),
'#process' => array(
'views_process_dependency',
),
'#dependency' => array(
'edit-options-spaces-frontpage' => array(
1,
),
),
);
}
}