function html_ref($arguments, $prefix) { global $keepurl; if (!is_array($keepurl)) { $keepurl = array(); } $diff = array_diff_key($keepurl, $arguments); $ahref = $prefix . sanitized_url(); $a = array_keys($diff); foreach ($a as $d) { if ($diff[$d] != "") { $ahref .= "{$d}={$diff[$d]}&"; } } $a = array_keys($arguments); foreach ($a as $d) { if ($arguments[$d] != "") { $ahref .= "{$d}={$arguments[$d]}&"; } } $now = floor(time() / 15 / 60); // one hour $ahref .= "tm=" . $now; $ahref .= "\">"; return $ahref; }
function breadcrumbs() { echo "<div class=\"githead\">\n"; $crumb = "<a href=\"" . sanitized_url() . "\">projects</a> / "; if (isset($_GET['p'])) { $crumb .= html_ahref(array('p' => $_GET['p'], 'pg' => "")) . $_GET['p'] . "</a> / "; } if (isset($_GET['b'])) { $crumb .= "blob"; } if (isset($_GET['t'])) { $crumb .= "tree"; } if ($_GET['a'] == 'commitdiff') { $crumb .= 'commitdiff'; } echo $crumb; echo "</div>\n"; }
function write_rss2() { $proj = $_GET['p']; //$repo = get_repo_path($proj); $link = "http://{$_SERVER['HTTP_HOST']}" . sanitized_url() . "p={$proj}"; $c = git_commit($proj, "HEAD"); header("Content-type: text/xml", true); echo '<?xml version="1.0" encoding="UTF-8"?>'; ?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" > <channel> <title><?php echo $proj; ?> </title> <link><?php echo $link; ?> </link> <description><?php echo $proj; ?> </description> <pubDate><?php echo date('D, d M Y G:i:s', $c['date']); ?> </pubDate> <generator>http://code.google.com/p/git-php/</generator> <language>en</language> <?php for ($i = 0; $i < 10 && $c; $i++) { ?> <item> <title><?php echo $c['message']; ?> </title> <link><?php echo $link; ?> </link> <pubDate><?php echo date('D, d M Y G:i:s', $c['date']); ?> </pubDate> <guid isPermaLink="false"><?php echo $link; ?> </guid> <description><?php echo $c['message']; ?> </description> <content><?php echo $c['message']; ?> </content> </item> <?php $c = git_commit($proj, $c['parent']); $link = "http://{$_SERVER['HTTP_HOST']}" . sanitized_url() . "p={$proj}&a=commitdiff&h={$c['commit_id']}&hb={$c['parent']}&tm=0"; } ?> </channel> </rss> <?php die; }
function html_ahref($arguments, $text = "", $class = "") { $ahref = "<a "; if ($class != "") { $ahref .= "class=\"{$class}\" "; } $ahref .= "href=\""; $ahref .= sanitized_url(); foreach ($arguments as $key => $val) { if ($val != "") { $ahref .= "{$key}={$val}&"; } } $ahref = substr($ahref, 0, -1); $ahref .= "\">"; if ($text != "") { $ahref .= $text . "</a>\n"; } return $ahref; }
function send_the_submit_form() { html_spacer(); html_title("BUNDLE INFORMATION"); html_spacer(); echo "<div id=\"git-submit\">\n"; echo html_ref(array('p' => $_GET['p'], 'a' => "jump_to_tag"), "<form method=post enctype=\"multipart/form-data\" action=\""); echo "<div class=\"optiontable\">"; echo "<table>\n"; echo "<tr><td class=\"descol\">Short MEANINGFUL description </td><td class=\"valcol\"><input type=\"text\" name=\"commiter name\" size=\"40\"></td></tr>\n"; echo "<tr><td class=\"descol\">Bundle file </td><td class=\"valcol\"><input type=\"file\" name=\"bundle_file\" size=\"40\"></td></tr>\n"; echo "<tr><td class=\"descol\">enter the value <img src=\"" . sanitized_url() . "dl=human_check\"/> here </td><td class=\"valcol\"><input type=\"text\" name=\"check\" size=\"40\"></td></tr>\n"; echo "<tr><td class=\"descol\">Submit </td><td class=\"valcol\"><input type=\"submit\" name=\"action\" value=\"commit\" size=\"10\"></td></tr>\n"; echo "</table></div>\n"; echo "</form>\n"; echo "</div>\n"; send_the_help_section_of_submit(); }
function html_footer() { global $git_embed; global $git_logo; echo "<div class=\"gitfooter\">\n"; if (isset($_GET['p'])) { echo "<a class=\"rss_logo\" href=\"" . sanitized_url() . "p={$_GET['p']}&dl=rss2\" >RSS</a>\n"; } if ($git_logo) { echo "<a href=\"http://www.kernel.org/pub/software/scm/git/docs/\">" . "<img src=\"" . sanitized_url() . "dl=git_logo\" style=\"border-width: 0px;\"/></a>\n"; } echo "</div>\n"; echo "</div>\n"; if (!$git_embed) { echo "</body>\n"; echo "</html>\n"; } }