summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLorenz Schori2011-10-22 12:22:00 (GMT)
committer Andrei Mateescu2011-10-22 21:30:18 (GMT)
commitd05516eee26b4da88302c60eaaac1d9a66564632 (patch)
tree92cc2b030711ee9966553a5c3ddeb92dfb383826
parent37a51225bbce68ecc949c72ca7dd0622122e54b8 (diff)
Fix options in nodequeue field handler
* Implement new method option_definition() replacing method options() * Fix copy paste typo (options['link_to_taxonomy'] instead of options['link_to_queue']) * Use ctools #dependency instead of #states otherwise no controls are shown in field settings popup.
-rw-r--r--includes/views/nodequeue_handler_field_all_queues.inc21
1 files changed, 10 insertions, 11 deletions
diff --git a/includes/views/nodequeue_handler_field_all_queues.inc b/includes/views/nodequeue_handler_field_all_queues.inc
index 82d935e..8b87d1f 100644
--- a/includes/views/nodequeue_handler_field_all_queues.inc
+++ b/includes/views/nodequeue_handler_field_all_queues.inc
@@ -10,11 +10,14 @@ class nodequeue_handler_field_all_queues extends views_handler_field_prerender_l
/**
* Provide meaningful defaults.
*/
- function options(&$options) {
- parent::options($options);
- $options['link_to_queue'] = TRUE;
- $options['limit'] = FALSE;
- $options['qids'] = array();
+ function option_definition() {
+ $options = parent::option_definition();
+
+ $options['link_to_queue'] = array('default' => TRUE);
+ $options['limit'] = array('default' => FALSE);
+ $options['qids'] = array('default' => array());
+
+ return $options;
}
/**
@@ -25,7 +28,7 @@ class nodequeue_handler_field_all_queues extends views_handler_field_prerender_l
$form['link_to_queue'] = array(
'#title' => t('Link this field to queue arrange page'),
'#type' => 'checkbox',
- '#default_value' => !empty($this->options['link_to_taxonomy']),
+ '#default_value' => !empty($this->options['link_to_queue']),
);
$form['limit'] = array(
@@ -47,11 +50,7 @@ class nodequeue_handler_field_all_queues extends views_handler_field_prerender_l
'#title' => t('Queues'),
'#options' => $options,
'#default_value' => $this->options['qids'],
- '#states' => array(
- 'visible' => array(
- ':input[name="options[limit]"]' => array('checked' => TRUE)
- ),
- ),
+ '#dependency' => array('edit-options-limit' => array(TRUE)),
);
}