'CVS messages', 'page callback' => 'versioncontrol_cvslog_compat_commitlog_page', 'access arguments' => array($view_access), 'type' => MENU_CALLBACK, ); $items['cvs-application'] = array( 'title' => 'CVS application form', 'page callback' => 'versioncontrol_cvslog_compat_redirect', 'page arguments' => array('versioncontrol/register'), 'access arguments' => array($view_access), 'type' => MENU_CALLBACK, ); $items['project/developers/%'] = array( // old project* path 'title' => 'Developers', 'page callback' => 'versioncontrol_cvslog_compat_redirect', 'page arguments' => array('node/!1/developers', 2), 'type' => MENU_CALLBACK, 'access callback' => TRUE, ); $items['node/%/committers'] = array( // newer cvslog path 'title' => 'Developers', 'page callback' => 'versioncontrol_cvslog_compat_redirect', 'page arguments' => array('node/!1/developers', 1), 'type' => MENU_CALLBACK, 'access callback' => TRUE, ); return $items; } /** * Page callback for the 'cvs-application' menu path. */ function versioncontrol_cvslog_compat_redirect($path) { if (func_num_args() > 1) { $args = func_get_args(); $replacements = array(); for ($i = 1; $i < func_num_args(); $i++) { // starting from element #2 $replacements['!' . $i] = $args[$i]; } $path = strtr($path, $replacements); } drupal_goto($path, NULL, NULL, 301); } /** * Page callback for the 'cvs-application' menu path. */ function versioncontrol_cvslog_compat_commitlog_page() { $constraints = array('vcs' => array('cvs')); // Transform the query string into Version Control API constraints. if (is_numeric($_REQUEST['commit'])) { $constraints['vc_op_ids'] = array($_REQUEST['commit']); } if ($_REQUEST['user']) { $account = user_load($_REQUEST['user']); // There's no constraint for querying "either Drupal or VCS username" // currently, so let's fall back to the most reasonable switch. // (We can't have them both, as that would result in an "AND" operator.) if ($account) { $constraints['uids'] = array($_REQUEST['uid']); } else { $constraints['usernames'] = array($_REQUEST['user']); } } if (is_numeric($_REQUEST['uid'])) { $constraints['uids'] = array($_REQUEST['uid']); } if (is_numeric($_REQUEST['nid'])) { $constraints['nids'] = array($_REQUEST['nid']); } if ($_REQUEST['branch']) { $branch = strtoupper($_REQUEST['branch']) == 'HEAD' ? '' : $_REQUEST['branch']; $constraints['branches'] = array($branch); } if ($_REQUEST['file']) { $constraints['paths'] = array($_REQUEST['file']); } if (is_numeric($_REQUEST['rid'])) { $constraints['repo_ids'] = array($_REQUEST['rid']); } if ($_REQUEST['message']) { $constraints['message'] = array($_REQUEST['message']); } if (isset($_REQUEST['rss']) && $_REQUEST['rss']) { drupal_set_header('Content-Type: application/rss+xml; charset=utf-8'); print theme('commitlog_rss', $constraints); exit(); } // No RSS, return the regular HTML output. return commitlog_operations($constraints); }