aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorU-AD\carlsoan <carlsoan@gophersjos7275.ad.uc.edu>2018-06-27 13:00:12 -0400
committerU-AD\carlsoan <carlsoan@gophersjos7275.ad.uc.edu>2018-06-27 13:00:12 -0400
commitcb0a8dec3d342d498bb0cd07eca89fdcdfca8e34 (patch)
tree503976ae4e551afc6dde1b3b2382b3a3498edeac
parenta0ab15dd080b22e7440fdd5ff200239db6d0e1d0 (diff)
added copy-only link in php
-rw-r--r--cgit.php.m422
1 files changed, 17 insertions, 5 deletions
diff --git a/cgit.php.m4 b/cgit.php.m4
index c2785f5..4c1ca02 100644
--- a/cgit.php.m4
+++ b/cgit.php.m4
@@ -2,11 +2,23 @@
<?php
$fileContents = array_unique(preg_grep("/^\/git.*\.git\//",explode("'",file_get_contents("CGITURL"))));
foreach ($fileContents as $thisLine) {
- $repoURL = str_replace("'","",$thisLine);
- $repoAboutURL = $repoURL . "about/";
- $repoTreeURL = $repoURL . "tree/";
- $repoName = str_replace("/git/","",str_replace("/.git/","",$thisLine));
- echo "<tr><td><a href=\"$repoAboutURL\">$repoName</a></td><td><a href=\"$repoTreeURL\">Code</a></td><td><a href=\"$repoURL\">Clone</a></td></tr>";
+ $repoURL = str_replace("'","",$thisLine);
+ $repoAboutURL = $repoURL . "about/";
+ $repoTreeURL = $repoURL . "tree/";
+ $repoName = str_replace("/git/","",str_replace("/.git/","",$thisLine));
+?>
+ <tr>
+ <td>
+ <a href="<?php echo "$repoAboutURL"; ?>"><?php echo "$repoName"; ?></a>
+ </td>
+ <td>
+ <a href="<?php echo "$repoTreeURL"; ?>">Code</a>
+ </td>
+ <td>
+ <a onClick="return false;" href="<?php echo "$repoURL"; ?>" title="Right-click and copy clone URL">Clone</a>
+ </td>
+ </tr>
+<?php
}
?>
</table>