function html_summary($proj) { global $nr_of_shortlog_lines; $repopath = get_repo_path($proj); html_summary_title(); html_desc($repopath); if (!isset($_GET['t']) && !isset($_GET['b'])) { html_shortlog($proj, $nr_of_shortlog_lines); } else { html_shortlog($proj, 4); } }
function git_render_page() { global $git_embed, $repos; $git_embed = true; /* Add the default css */ $git_css = true; /* Add the git logo in the footer */ $git_logo = true; $title = "git"; $repo_index = "index.aux"; $repo_directory = '/home/david/git/'; $geshi_directory = '/home/david/src/mediawiki/extensions/SyntaxHighlight_GeSHi/geshi'; //if git is not installed into standard path, we need to set the path $mypath = getenv("PATH"); $addpath = "/usr/lib/git-core"; if (isset($mypath)) { $mypath .= ":{$addpath}"; } else { $mypath = $addpath; } putenv("PATH={$mypath}"); //repos could be made by an embeder script if (!is_array($repos)) { $repos = array(); } if (file_exists($repo_index)) { $r = file($repo_index); foreach ($r as $repo) { $repos[] = trim($repo); } } else { if (file_exists($repo_directory) && is_dir($repo_directory)) { if ($handle = opendir($repo_directory)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { /* TODO: Check for valid git repos */ $repos[] = trim($repo_directory . $file); } } closedir($handle); } } } sort($repos); if ($geshi_directory != '') { require "{$geshi_directory}/geshi.php"; } if (!isset($git_embed) && $git_embed != true) { $git_embed = false; } foreach ($_GET as $var => $val) { $_GET[$var] = str_replace(";", "", $_GET[$var]); } $str = ''; if (isset($_GET['dl'])) { if ($_GET['dl'] == 'targz') { write_targz(get_repo_path($_GET['p'])); } else { if ($_GET['dl'] == 'zip') { write_zip(get_repo_path($_GET['p'])); } else { if ($_GET['dl'] == 'git_logo') { write_git_logo(); } else { if ($_GET['dl'] == 'plain') { write_plain(); } else { if ($_GET['dl'] == 'rss2') { write_rss2(); } } } } } } $str .= html_header($title); $str .= html_style($git_css); $str .= html_breadcrumbs(); if (isset($_GET['p'])) { $str .= html_spacer(); $str .= html_desc($_GET['p']); $str .= html_spacer(); $str .= html_summary($_GET['p']); $str .= html_spacer(); if ($_GET['a'] == "commitdiff") { $str .= html_diff($_GET['p'], $_GET['c'], $_GET['cp']); } else { $str .= html_browse($_GET['p']); } } else { $str .= html_spacer(); $str .= html_home($repos); } $str .= html_footer($git_logo); return $str; }