? .svn ? theme/.svn ? views/.svn Index: views/xspf_playlist_views.views.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/xspf_playlist/xspf_playlist_views/views/Attic/xspf_playlist_views.views.inc,v retrieving revision 1.1.2.1 diff -u -p -r1.1.2.1 xspf_playlist_views.views.inc --- views/xspf_playlist_views.views.inc 7 Apr 2009 19:31:30 -0000 1.1.2.1 +++ views/xspf_playlist_views.views.inc 18 May 2009 13:36:18 -0000 @@ -37,7 +37,7 @@ function xspf_playlist_views_views_plugi 'theme path' => "$path/theme", 'theme file' => 'theme.inc', 'base' => array('node'), // only works with 'node' as base. - 'uses options' => FALSE, + 'uses options' => TRUE, 'type' => 'feed', ), ), Index: views/xspf_playlist_views_plugin_row_node_xspf_playlist.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/xspf_playlist/xspf_playlist_views/views/Attic/xspf_playlist_views_plugin_row_node_xspf_playlist.inc,v retrieving revision 1.1.2.1 diff -u -p -r1.1.2.1 xspf_playlist_views_plugin_row_node_xspf_playlist.inc --- views/xspf_playlist_views_plugin_row_node_xspf_playlist.inc 7 Apr 2009 19:31:30 -0000 1.1.2.1 +++ views/xspf_playlist_views_plugin_row_node_xspf_playlist.inc 18 May 2009 13:36:18 -0000 @@ -12,6 +12,19 @@ class xspf_playlist_views_plugin_row_node_xspf_playlist extends views_plugin_row { function option_definition() { $options = parent::option_definition(); + + $options['title'] = array( + 'default' => TRUE, + ); + $options['creator'] = array( + 'default' => TRUE, + ); + $options['info'] = array( + 'default' => TRUE, + ); + $options['image'] = array( + 'default' => TRUE, + ); return $options; } @@ -24,13 +37,54 @@ class xspf_playlist_views_plugin_row_nod $node->build_mode = NODE_BUILD_RSS; // convert the node to playlist items - if (!$item = xspf_playlist_node_items($node)) { + if (!$items = xspf_playlist_node_items($node)) { return; // could not generate a playlist item from the node } + // filter out unwanted information from the playlist + foreach ($this->options as $option => $option_val) { + if (!$this->options[$option]) { + foreach($items as $pos => $item) { + foreach ($item as $key => $data) { + if ($data['key'] == $option) unset($items[$pos][$key]); + } + } + } + } // set the namespace $this->view->style_plugin->namespaces = array('xmlns' => 'http://xspf.org/ns/0/'); - return theme($this->theme_functions(), $this->view, $this->options, $item); + return theme($this->theme_functions(), $this->view, $this->options, $items); + } + + /** + * Render the given style. + */ + function options_form(&$form, &$form_state) { + parent::options_form($form, $form_state); + $form['title'] = array( + '#type' => 'checkbox', + '#title' => t('Title'), + '#default_value' => $this->options['title'], + '#description' => t("Should the title be included in track listings?"), + ); + $form['creator'] = array( + '#type' => 'checkbox', + '#title' => t('Creator'), + '#default_value' => $this->options['creator'], + '#description' => t("Should the 'creator' metadata (author) be included in track listings?"), + ); + $form['info'] = array( + '#type' => 'checkbox', + '#title' => t('Info URL'), + '#default_value' => $this->options['info'], + '#description' => t("Should the Info URL be included in track listings?"), + ); + $form['image'] = array( + '#type' => 'checkbox', + '#title' => t('Image'), + '#default_value' => $this->options['image'], + '#description' => t("Should the image be included in track listings?"), + ); } -} +} \ No newline at end of file