? .git ? views/handlers/project_issue_handler_field_project_open_issue_count.inc ? views/plugins/project_issue_plugin_display_my_projects.inc ? views/plugins/project_issue_plugin_my_projects_table.inc Index: project_issue.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/project_issue/project_issue.module,v retrieving revision 1.177 diff -u -p -w -r1.177 project_issue.module --- project_issue.module 30 Jan 2010 19:01:33 -0000 1.177 +++ project_issue.module 5 Feb 2010 06:33:45 -0000 @@ -248,44 +248,14 @@ function project_issue_help($path, $arg) '
'. t('Default status') .'
'. '
'. t('The default status option will be used for new issues, and all users with the permission to create issues will automatically have permission to set this status. The default issue status cannot be deleted. If you wish to delete this status, first set a different status to default.') .'
'. ''; - - } - - // NOTE: This totally sucks, and is a dirty, ugly hack. Since we don't - // want to rely on PHP filtered headers for our views, and defining our - // own display plugin breaks other nice things like RSS, we just cheat - // and render these links in here. We'd like to remove this once a - // better solution is available that doesn't hard-code the paths. - if ($arg[0] == 'project' && $arg[1] == 'user') { - return project_issue_my_projects_table(); } + // Hack to display links at the top of the statistics and subscribe-mail pages. if ($arg[0] == 'project' && $arg[1] == 'issues') { - // If there's no other arg, we're done. - if (empty($arg[2])) { - return project_issue_query_result_links(); - } - // project/issues/user is a special case, since if there's an argument, - // it's a username, not a project. Furthermore, we don't want any links - // for anonymous. - if ($arg[2] == 'user') { - global $user; - if (empty($user->uid) && empty($arg[3])) { - return; - } - return project_issue_query_result_links(); - } - switch ($arg[2]) { - case 'search': - case 'statistics': - case 'subscribe-mail': + if ($arg[2] == 'statistics' || $arg[2] == 'subscribe-mail') { return project_issue_query_result_links($arg[3]); - - default: - return project_issue_query_result_links($arg[2]); } } - } /** @@ -1756,3 +1726,31 @@ function project_issue_project_page_link } } +/** + * Implementation of hook_views_post_render(). + */ +function project_issue_views_post_render(&$view, &$output, &$cache) { + // Add links to the top of the project_issue views. + // On the user projects view, we need to add the "my projects" table. + switch ($view->name) { + case 'project_issue_user_projects': + // Tack the "my projects" table onto the user projects view. + if ($view->current_display == 'page_1') { + $output = project_issue_my_projects_table() . $output; + } + break; + case 'project_issue_all_projects': + case 'project_issue_project': + case 'project_issue_search_all': + case 'project_issue_search_project': + case 'project_issue_user_issues': + if ($view->current_display == 'page_1') { + $arg = NULL; + if (isset($view->argument['pid'])) { + $arg = $view->argument['pid']->get_value(); + } + $output = project_issue_query_result_links($arg) . $output; + } + break; + } +}