'radios', '#title' => t('Update method'), '#description' => t('Automatic log retrieval requires cron.'), '#default_value' => isset($repository) ? $repository['git_specific']['update_method'] : VERSIONCONTROL_GIT_UPDATE_CRON, '#weight' => 10, '#options' => array( VERSIONCONTROL_GIT_UPDATE_CRON => t('Automatic log retrieval.'), ), ); } /** * Implementation of hook_versioncontrol_extract_repository_data(): * Extract GIT specific repository additions from the repository * editing/adding form's submitted values. */ function versioncontrol_git_versioncontrol_extract_repository_data($form_values) { if (!isset($form_values['versioncontrol_git'])) { return array(); } $modules = trim($form_values['modules']); $modules = empty($modules) ? array() : explode(' ', $modules); return array( 'git_specific' => array( // 'modules' => $modules, 'update_method' => $form_values['update_method'], // 'updated' => $form_values['updated'], // 'run_as_user' => $form_values['run_as_user'], ), ); } /** * Implementation of hook_versioncontrol_alter_repository_list(): * Add GIT specific columns into the list of GIT repositories. * By changing the @p $header and @p $rows_by_repo_id arguments, * the repository list can be customized accordingly. * * @param $vcs * The unique string identifier for the version control system that * the passed repository list covers. * @param $repositories * An array of repositories of the given version control system. * Array keys are the repository ids, and array values are the * repository arrays like returned from versioncontrol_get_repository(). * @param $header * A list of columns that will be passed to theme('table'). * @param $rows_by_repo_id * An array of existing table rows, with repository ids as array keys. * Each row already includes the generic column values, and for each row * there is a repository with the same repository id given in the * @p $repositories parameter. */ function versioncontrol_git_versioncontrol_alter_repository_list($vcs, $repositories, &$header, &$rows_by_repo_id) { if ($vcs != 'git') { return; } $header[] = t('Update method'); $header[] = t('Last updated'); foreach ($rows_by_repo_id as $repo_id => $row) { // $modules = array(); // $rows_by_repo_id[$repo_id][] = theme('item_list', $modules); if ($repositories[$repo_id]['git_specific']['update_method'] == VERSIONCONTROL_GIT_UPDATE_CRON) { $rows_by_repo_id[$repo_id][] = t('logs (!fetch)', array( '!fetch' => l(t('fetch now'), 'admin/project/versioncontrol-repositories/update/git/'. $repo_id) )); } $rows_by_repo_id[$repo_id][] = $repositories[$repo_id]['git_specific']['updated'] ? format_date($repositories[$repo_id]['git_specific']['updated'], 'small') : t('never'); } }