? test.patch ? archive/Thumbs.db ? archive/scripts/1193091785.mp3 ? catalog/The Database.mdb ? catalog/fixit.php ? catalog/import.php ? schedule/station_schedule.install_ ? schedule/station_schedule.module_ ? schedule/views.inc_ ? schedule/images/Thumbs.db Index: archive/views.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/station/archive/views.inc,v retrieving revision 1.11 diff -u -p -u -p -r1.11 views.inc --- archive/views.inc 22 Nov 2007 06:23:21 -0000 1.11 +++ archive/views.inc 22 Nov 2007 06:48:13 -0000 @@ -34,11 +34,29 @@ function station_archive_views_tables() ), ), 'filters' => array( + 'is_scheduled' => array( + 'name' => t('Station Archive: Is in the archive'), + 'operator' => array('=' => t('Equals')), + 'value' => array( + '#type' => 'select', + '#options' => array( + 1 => t('Yes'), + 0 => t('No'), + ), + ), + 'handler' => 'station_handler_filter_is_in_archive', + 'help' => t("Filter weather the node is part of the station archive."), + ), 'permanent' => array( 'name' => t('Station Archive: Is in permanent archive'), - 'operator' => array('=' => 'Equals'), - 'list' => 'views_handler_operator_yesno', - 'list-type' => 'select', + 'operator' => array('=' => t('Equals')), + 'value' => array( + '#type' => 'select', + '#options' => array( + 1 => t('Yes'), + 0 => t('No'), + ), + ), 'help' => t('Filter weather the node is part of the permanent archive.'), ), ), @@ -133,4 +151,18 @@ function station_archive_handler_audio_p return l($value, $schedule['base_url'] .'/node/'. $data->station_archive_program_program_nid); } return check_plain($value); -} \ No newline at end of file +} + +function station_handler_filter_is_in_archive($op, $filterdata, $filterinfo, &$query) { + switch ($op) { + case 'handler': + $query->ensure_table('station_archive_item'); + if ($filterdata['value']) { + $query->add_where('{station_archive_item}.audio_nid IS NOT NULL'); + } + else { + $query->add_where('{station_archive_item}.audio_nid IS NULL'); + } + break; + } +}