Index: views/project_issue.views.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/project_issue/views/project_issue.views.inc,v retrieving revision 1.5 diff -u -p -r1.5 project_issue.views.inc --- views/project_issue.views.inc 28 Jan 2009 06:01:07 -0000 1.5 +++ views/project_issue.views.inc 30 Jan 2009 06:15:11 -0000 @@ -224,6 +224,7 @@ function project_issue_views_plugins() { $path = drupal_get_path('module', 'project_issue'); $views_path = drupal_get_path('module', 'views'); return array( + 'module' => 'project_issue', 'style' => array( 'project_issue_table' => array( 'title' => t('Project issue table'), @@ -240,5 +241,19 @@ function project_issue_views_plugins() { 'type' => 'normal', ), ), + 'display' => array( + 'project_issue_page' => array( + 'title' => t('Project issue page'), + 'help' => t('Display the view as a page with special issue-specific header information.'), + 'handler' => 'project_issue_plugin_display_project_issue_page', + 'parent' => 'page', + 'path' => "$path/views/plugins", + 'uses hook menu' => TRUE, + 'use pager' => TRUE, + 'accept attachments' => FALSE, + 'admin' => t('Issue page'), + ), + ), ); } + Index: views/plugins/project_issue_plugin_display_project_issue_page.inc =================================================================== RCS file: views/plugins/project_issue_plugin_display_project_issue_page.inc diff -N views/plugins/project_issue_plugin_display_project_issue_page.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ views/plugins/project_issue_plugin_display_project_issue_page.inc 30 Jan 2009 06:15:11 -0000 @@ -0,0 +1,83 @@ + ''); + } + + function options_summary(&$categories, &$options) { + parent::options_summary($categories, $options); + $header_type = $this->get_option('header_type'); + $header_options = $this->get_header_options(); + $options['header_type'] = array( + 'category' => 'issue_page', + 'title' => t('Header type'), + 'value' => $header_options[$header_type], + ); + } + + function get_header_options() { + return array( + 'links_all' => t('Issue links'), + 'links_project' => t('Per-project issue links'), + 'search_links_all' => t('Advanced search links'), + 'search_links_project' => t('Advanced search per-project links'), + 'user_projects_table' => t('My projects table'), + ); + } + + function options_form(&$form, &$form_state) { + parent::options_form($form, $form_state); + if ($form_state['section'] == 'header_type') { + $form['#title'] .= t('What type of header to display for this view.'); + $form['header_type'] = array( + '#type' => 'radios', + '#options' => $this->get_header_options(), + '#default_value' => $this->get_option('header_type'), + ); + } + } + + function options_submit($form, &$form_state) { + parent::options_submit($form, $form_state); + if ($form_state['section'] == 'header_type') { + $this->set_option('header_type', $form_state['values']['header_type']); + } + } + + function render_header() { + switch ($this->get_option('header_type')) { + case 'links_all': + return 'links_all'; + + case 'links_project': + return 'links_project'; + + case 'search_links_all': + return 'search_links_all'; + + case 'search_links_project': + return 'search_links_project'; + + case 'user_projects_table': + return 'user_projects_table'; + + } + } +} +