Index: station_archive.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/station/archive/station_archive.module,v
retrieving revision 1.45
diff -u -p -r1.45 station_archive.module
--- station_archive.module	20 Sep 2009 21:06:09 -0000	1.45
+++ station_archive.module	26 Nov 2009 03:23:29 -0000
@@ -146,10 +146,12 @@ function station_archive_nodeapi(&$node,
       case 'view':
         // If it's in the archives, set the menu appropriately
         if ($page && !$teaser && isset($node->station_archive)) {
-          $breadcrumb[] = array('path' => 'station', 'title' => t('Station'));
-          $breadcrumb[] = array('path' => 'station/archives', 'title' => t('Archives'));
-          $breadcrumb[] = array('path' => 'station/archives/'. $node->station_archive['program_nid'], 'title' => $node->station_archive['program_title']);
-          $breadcrumb[] = array('path' => 'node/'. $node->nid);
+          $breadcrumb = array(
+             l(t('Home'), NULL),
+             l(t('Station'), 'station'),
+             l(t('Archives'), 'station/archives'),
+             l($node->station_archive['program_title'], 'station/archives/'. $node->station_archive['program_nid']),
+          );
           drupal_set_breadcrumb($breadcrumb);
 
           // Provide information to admins on the import and deletion dates.
@@ -247,7 +249,7 @@ function station_archive_form_alter(&$fo
   }
 }
 
-function station_archive_node_form_validate($form, &$form_state) {
+function station_archive_node_form_validate(&$form, &$form_state) {
   // If they clicked the button, reload the program information
   if (isset($form_state['clicked_button']['#value']) && t('Reload Program') == $form_state['clicked_button']['#value']) {
     $gmt_timestamp = isset($form_state['values']['station_archive']['aired']) ? $form_state['values']['station_archive']['aired'] : time();
@@ -271,10 +273,17 @@ function station_archive_node_form_valid
     }
     else {
       // we've got program information
+      $djs = array();
+      if (!empty($program->field_station_program_dj)) {
+        foreach ($program->field_station_program_dj as $entry) {
+          $user = user_load($entry);
+          $djs[] = $user->name;
+        }
+      }
       $program_nid = $program->nid;
       $audio_tags['title'] = $program->title;
-      $audio_tags['artist'] = station_anded_list($program->djs);
-      $audio_tags['genre'] = $program->genre;
+      $audio_tags['artist'] = station_anded_list($djs);
+      $audio_tags['genre'] = isset($program->field_station_program_genre[0]['value']) ? $program->field_station_program_genre[0]['value'] : '';
       $audio_tags['url_source'] = $program->node_url;
     }
     $audio_tags['year'] = date('Y', $local_timestamp);
@@ -439,11 +448,12 @@ function _station_archive_update_program
 
   // Insert a program for unschedule times.
   $programs[0] = array(
-    'program_nid' => 0,
+    'nid' => 0,
     'title' => variable_get('station_archive_unscheduled_title', t('DJ Auto mix')),
   );
 
   foreach ($programs as $program) {
+    $program['program_nid'] = $program['nid'];
     db_query("DELETE FROM {station_archive_program} WHERE program_nid = %d", $program['program_nid']);
     drupal_write_record('station_archive_program', $program);
   }
@@ -691,10 +701,11 @@ function _station_archive_get_hour_term(
 }
 
 /**
- * Implementation of hook_view_api().
+ * Implementation of hook_views_api().
  */
 function station_archive_views_api() {
   return array(
     'api' => 2.0,
+    'path' => drupal_get_path('module', 'station_archive'),
   );
 }
Index: station_archive.views_default.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/station/archive/station_archive.views_default.inc,v
retrieving revision 1.1
diff -u -p -r1.1 station_archive.views_default.inc
--- station_archive.views_default.inc	26 Nov 2009 02:16:27 -0000	1.1
+++ station_archive.views_default.inc	26 Nov 2009 03:23:30 -0000
@@ -5,134 +5,152 @@
  * Implementation of hook_views_default_views().
  */
 function station_archive_views_default_views() {
-  $view = new stdClass();
+  /*
+   * View 'station_archive_audio'
+   */
+  $view = new view;
   $view->name = 'station_archive_audio';
   $view->description = 'Archived audio';
-  $view->access = array (
-);
-  $view->view_args_php = '';
-  $view->page = TRUE;
-  $view->page_title = 'Archive';
-  $view->page_header = '';
-  $view->page_header_format = '1';
-  $view->page_footer = '';
-  $view->page_footer_format = '1';
-  $view->page_empty = 'Sorry, no audio could be found for this program.';
-  $view->page_empty_format = '1';
-  $view->page_type = 'teaser';
-  $view->url = 'station/archives';
-  $view->use_pager = TRUE;
-  $view->nodes_per_page = '30';
-  $view->menu = TRUE;
-  $view->menu_title = 'Archive';
-  $view->menu_tab = FALSE;
-  $view->menu_tab_weight = '0';
-  $view->menu_tab_default = FALSE;
-  $view->menu_tab_default_parent = NULL;
-  $view->menu_tab_default_parent_type = 'tab';
-  $view->menu_parent_tab_weight = '0';
-  $view->menu_parent_title = '';
-  $view->sort = array (
-    array (
-      'tablename' => 'node',
+  $view->tag = 'station_archive';
+  $view->view_php = '';
+  $view->base_table = 'node';
+  $view->is_cacheable = FALSE;
+  $view->api_version = 2;
+  $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
+  $handler = $view->new_display('default', 'Defaults', 'default');
+  $handler->override_option('sorts', array(
+    'created' => array(
+      'id' => 'created',
+      'table' => 'node',
       'field' => 'created',
-      'sortorder' => 'DESC',
-      'options' => 'normal',
+      'order' => 'DESC',
+      'granularity' => 'second',
     ),
-  );
-  $view->argument = array (
-    array (
-      'type' => 'station_archive_program_nid',
-      'argdefault' => '4',
-      'title' => 'Archive of %1',
-      'options' => '',
+  ));
+  $handler->override_option('arguments', array(
+    'program_nid' => array(
+      'default_action' => 'ignore',
+      'style_plugin' => 'default_summary',
+      'style_options' => array(),
       'wildcard' => 'all',
-      'wildcard_substitution' => 'all programs',
-    ),
-    array (
-      'type' => 'rss_feed',
-      'argdefault' => '2',
+      'wildcard_substitution' => 'All',
       'title' => '',
-      'options' => '',
-      'wildcard' => '',
-      'wildcard_substitution' => '',
-    ),
-  );
-  $view->field = array (
-  );
-  $view->filter = array (
-    array (
-      'tablename' => 'node',
+      'breadcrumb' => '',
+      'default_argument_type' => 'fixed',
+      'default_argument' => '',
+      'validate_type' => 'none',
+      'validate_fail' => 'not found',
+      'break_phrase' => 0,
+      'not' => 0,
+      'id' => 'program_nid',
+      'table' => 'station_archive_item',
+      'field' => 'program_nid',
+      'validate_user_argument_type' => 'uid',
+      'validate_user_roles' => array(
+        '2' => 0,
+      ),
+      'relationship' => 'none',
+      'default_options_div_prefix' => '',
+      'default_argument_user' => 0,
+      'default_argument_fixed' => '',
+      'default_argument_php' => '',
+      'validate_argument_node_type' => array(
+        'audio' => 0,
+        'station_program' => 0,
+        'station_schedule' => 0,
+        'page' => 0,
+        'story' => 0,
+      ),
+      'validate_argument_node_access' => 0,
+      'validate_argument_nid_type' => 'nid',
+      'validate_argument_vocabulary' => array(
+        '1' => 0,
+      ),
+      'validate_argument_type' => 'tid',
+      'validate_argument_transform' => 0,
+      'validate_user_restrict_roles' => 0,
+      'validate_argument_php' => '',
+    ),
+  ));
+  $handler->override_option('filters', array(
+    'type' => array(
+      'id' => 'type',
+      'table' => 'node',
       'field' => 'type',
-      'operator' => 'OR',
-      'options' => '',
-      'value' => array (
-  0 => 'audio',
-),
-    ),
-  );
-  $view->exposed_filter = array (
-  );
-  $view->requires = array(node);
-  $views[$view->name] = $view;
-
-
-
-
-
-  $view = new stdClass();
-  $view->name = 'station_archive_audio_rss';
-  $view->description = 'Station Archive';
-  $view->access = array (
-);
-  $view->view_args_php = '';
-  $view->page = TRUE;
-  $view->page_title = 'Program Archive';
-  $view->page_header = '';
-  $view->page_header_format = '1';
-  $view->page_footer = '';
-  $view->page_footer_format = '1';
-  $view->page_empty = '';
-  $view->page_empty_format = '1';
-  $view->page_type = 'views_rss';
-  $view->url = 'station/archives/rss';
-  $view->use_pager = TRUE;
-  $view->nodes_per_page = '20';
-  $view->sort = array (
-    array (
-      'tablename' => 'node',
-      'field' => 'created',
-      'sortorder' => 'DESC',
-      'options' => 'normal',
-    ),
-  );
-  $view->argument = array (
-    array (
-      'type' => 'station_archive_program_nid',
-      'argdefault' => '2',
-      'title' => 'Archive of %1',
-      'options' => '',
-      'wildcard' => 'all',
-      'wildcard_substitution' => 'all programs',
-    ),
-  );
-  $view->field = array (
-  );
-  $view->filter = array (
-    array (
-      'tablename' => 'node',
-      'field' => 'type',
-      'operator' => 'OR',
-      'options' => '',
-      'value' => array (
-  0 => 'audio',
-),
-    ),
-  );
-  $view->exposed_filter = array (
-  );
-  $view->requires = array(node);
+      'value' => array(
+        '0' => 'audio',
+      ),
+      'operator' => 'in',
+    ),
+  ));
+  $handler->override_option('access', array(
+    'type' => 'none',
+    'role' => array(),
+    'perm' => '',
+  ));
+  $handler->override_option('cache', array(
+    'type' => 'none',
+  ));
+  $handler->override_option('title', 'Archive');
+  $handler->override_option('header_format', '1');
+  $handler->override_option('footer_format', '1');
+  $handler->override_option('empty', 'Sorry, no audio could be found for this program.');
+  $handler->override_option('empty_format', '1');
+  $handler->override_option('items_per_page', '30');
+  $handler->override_option('use_pager', TRUE);
+  $handler->override_option('row_plugin', 'node');
+  $handler->override_option('row_options', array(
+    'teaser' => TRUE,
+    'links' => TRUE,
+  ));
+  $handler = $view->new_display('page', 'Page', 'page_1');
+  $handler->override_option('path', 'station/archives');
+  $handler->override_option('menu', array(
+    'type' => 'normal',
+    'title' => 'Archive',
+    'description' => '',
+    'weight' => 0,
+    'name' => 'navigation',
+  ));
+  $handler->override_option('tab_options', array(
+    'type' => 'none',
+    'title' => '',
+    'description' => '',
+    'weight' => '0',
+  ));
+  $handler = $view->new_display('feed', 'Feed', 'feed_1');
+  $handler->override_option('style_plugin', 'rss');
+  $handler->override_option('style_options', array(
+    'mission_description' => FALSE,
+    'description' => '',
+  ));
+  $handler->override_option('row_plugin', 'node_rss');
+  $handler->override_option('row_options', array(
+    'relationship' => 'none',
+    'item_length' => 'default',
+  ));
+  $handler->override_option('path', 'station/archives/%/feed');
+  $handler->override_option('menu', array(
+    'type' => 'none',
+    'title' => '',
+    'description' => '',
+    'weight' => 0,
+    'name' => 'navigation',
+  ));
+  $handler->override_option('tab_options', array(
+    'type' => 'none',
+    'title' => '',
+    'description' => '',
+    'weight' => 0,
+  ));
+  $handler->override_option('displays', array(
+    'page_1' => 'page_1',
+    'default' => 0,
+  ));
+  $handler->override_option('sitename_title', FALSE);
   $views[$view->name] = $view;
 
   return $views;
 }
+
+
