function views_rss_handler_field_term_node_tid::options_form in Views RSS 6.2
Same name and namespace in other branches
- 7.2 views/views_rss_handler_field_term_node_tid.inc \views_rss_handler_field_term_node_tid::options_form()
File
- views/
views_rss_handler_field_term_node_tid.inc, line 18 - Field handler to display all taxonomy terms of a node.
Class
- views_rss_handler_field_term_node_tid
- @file Field handler to display all taxonomy terms of a node.
Code
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
// New display type: "RSS <category> element".
$form['type']['#weight'] = 2;
$form['separator']['#weight'] = 3;
$form['type']['#options']['rss_category'] = t('RSS <category> element');
// Additional options for "domain" attribute.
$form['rss_domain'] = array(
'#type' => 'select',
'#title' => t('<em>Domain</em> attribute'),
'#description' => t("<em>domain</em> attribute identifies the category's taxonomy.") . ' ' . l('[?]', 'http://www.rssboard.org/rss-profile#element-channel-item-category', array(
'attributes' => array(
'title' => t('Need more information?'),
),
)),
'#options' => array(
'none' => t('None'),
'path' => t('Path'),
'alias' => t('URL alias'),
),
'#default_value' => $this->options['rss_domain'],
'#process' => array(
'views_process_dependency',
),
'#dependency' => array(
'radio:options[type]' => array(
'rss_category',
),
),
'#weight' => 3,
);
// Output terms with their parents.
// Example: parent2/parent1/term
$form['rss_include_parents'] = array(
'#type' => 'checkbox',
'#title' => t('Include term parents'),
'#description' => t('Output terms from hierarchical vocabularies together with their parents (slash-delimited).'),
'#default_value' => $this->options['rss_include_parents'],
'#process' => array(
'views_process_dependency',
),
'#dependency' => array(
'radio:options[type]' => array(
'rss_category',
),
),
'#weight' => 4,
);
// Output terms with their parents and vocabulary.
// Example: vocabulary/parent2/parent1/term
$form['rss_include_vocabulary'] = array(
'#type' => 'checkbox',
'#title' => t('Include term vocabulary'),
'#description' => t('Add vocabulary name before term parents.'),
'#default_value' => $this->options['rss_include_vocabulary'],
'#process' => array(
'ctools_dependent_process',
),
'#process' => array(
'views_process_dependency',
),
'#dependency_count' => 2,
'#dependency' => array(
'radio:options[type]' => array(
'rss_category',
),
'edit-options-rss-include-parents' => array(
1,
),
),
'#weight' => 5,
);
// Hide "Link this field to its term page" checkbox
// if "RSS <category> element" is selected as "Display type".
$form['link_to_taxonomy']['#weight'] = 4;
$form['link_to_taxonomy']['#process'] = array(
'views_process_dependency',
);
$form['link_to_taxonomy']['#dependency'] = array(
'radio:options[type]' => array(
'ul',
'ol',
'separator',
),
);
$form['link_to_taxonomy']['#prefix'] = '<div id="edit-options-link-to-taxonomy-wrapper" style="padding-left:0">';
$form['link_to_taxonomy']['#suffix'] = '</div>';
}