| 1 | <?php
|
|---|
| 2 |
|
|---|
| 3 | require "cvs.php3";
|
|---|
| 4 | require "stilovi.php3";
|
|---|
| 5 |
|
|---|
| 6 | /*
|
|---|
| 7 | * Parse argument(s)
|
|---|
| 8 | */
|
|---|
| 9 | if (isset($sFile))
|
|---|
| 10 | {
|
|---|
| 11 | if (isset($sRevision))
|
|---|
| 12 | {
|
|---|
| 13 | $sOperation = "viewfile";
|
|---|
| 14 | if ($sRevision == "HEAD")
|
|---|
| 15 | $sRevision = "";
|
|---|
| 16 | $sTitle = substr($sFile, 0, -2)."\nrev.: ". ($sRevision == "" ? "HEAD" : $sRevision);
|
|---|
| 17 | }
|
|---|
| 18 | else
|
|---|
| 19 | {
|
|---|
| 20 | $sOperation = "viewfileinfo";
|
|---|
| 21 | $sTitle = substr($sFile, 0, -2);
|
|---|
| 22 | }
|
|---|
| 23 | }
|
|---|
| 24 | else if (isset($sDir))
|
|---|
| 25 | {
|
|---|
| 26 | $sOperation = "viewdir";
|
|---|
| 27 | $sTitle = ($sDir == "." || $sDir =="") ? "./" : $sDir."/";
|
|---|
| 28 | $iSortColumn = (!isset($iSortColumn) || $iSortColumn == "") ?
|
|---|
| 29 | 0 : $iSortColumn = @(int)$iSortColumn;
|
|---|
| 30 | }
|
|---|
| 31 | else
|
|---|
| 32 | { /* default action: */
|
|---|
| 33 | $sOperation = "viewdir";
|
|---|
| 34 | $sDir = ".";
|
|---|
| 35 | $sTitle = "root";
|
|---|
| 36 | $iSortColumn = 0;
|
|---|
| 37 | }
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 | /*
|
|---|
| 41 | * Odin32 look.
|
|---|
| 42 | */
|
|---|
| 43 | require "01-PreTitle.php3";
|
|---|
| 44 | echo "Odin32 CVS: ", str_replace("\n", " ", $sTitle);
|
|---|
| 45 | require "02-PostTitle.php3";
|
|---|
| 46 |
|
|---|
| 47 | require "03-MainTableBeg.php3";
|
|---|
| 48 | require "04-ColumnOne.php3";
|
|---|
| 49 |
|
|---|
| 50 | require "05-ColumnTwoHeader.php3";
|
|---|
| 51 | echo "Odin32 CVS: ", str_replace("\n", "<br>", $sTitle);
|
|---|
| 52 | require "06-ColumnTwoHeader2.php3";
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 | /*
|
|---|
| 56 | *
|
|---|
| 57 | */
|
|---|
| 58 | flush();
|
|---|
| 59 |
|
|---|
| 60 | /*
|
|---|
| 61 | * Do the requested operation...
|
|---|
| 62 | */
|
|---|
| 63 | switch ($sOperation)
|
|---|
| 64 | {
|
|---|
| 65 |
|
|---|
| 66 | case "viewfileinfo":
|
|---|
| 67 | {
|
|---|
| 68 | $obj = new CVSFile($sFile, 0);
|
|---|
| 69 | if ($obj && $obj->fOk)
|
|---|
| 70 | {
|
|---|
| 71 | if (!$obj->PrintAllInfo())
|
|---|
| 72 | {
|
|---|
| 73 | echo "<p><i>PrintRevision failed.</i>";
|
|---|
| 74 | echo "<br><i>".$obj->sError."<br>";
|
|---|
| 75 | }
|
|---|
| 76 | }
|
|---|
| 77 | else
|
|---|
| 78 | { //error - complain
|
|---|
| 79 | echo "<p><i>An error occured while creating file object for $sFile.</i>";
|
|---|
| 80 | if ($obj)
|
|---|
| 81 | echo "<br><i>".$obj->sError."<br>";
|
|---|
| 82 | }
|
|---|
| 83 | break;
|
|---|
| 84 | }
|
|---|
| 85 |
|
|---|
| 86 | case "viewfile":
|
|---|
| 87 | {
|
|---|
| 88 | $obj = new CVSFile($sFile, 0);
|
|---|
| 89 | if ($obj && $obj->fOk)
|
|---|
| 90 | {
|
|---|
| 91 | if (!$obj->PrintRevision($sRevision))
|
|---|
| 92 | {
|
|---|
| 93 | echo "<p><i>PrintRevision failed.</i>";
|
|---|
| 94 | echo "<br><i>".$obj->sError."<br>";
|
|---|
| 95 | }
|
|---|
| 96 | }
|
|---|
| 97 | else
|
|---|
| 98 | { //error - complain
|
|---|
| 99 | echo "<p><i>An error occured while creating file object for $sFile.</i>";
|
|---|
| 100 | if ($obj)
|
|---|
| 101 | echo "<br><i>".$obj->sError."<br>";
|
|---|
| 102 | }
|
|---|
| 103 | break;
|
|---|
| 104 | }
|
|---|
| 105 |
|
|---|
| 106 |
|
|---|
| 107 | case "viewdir":
|
|---|
| 108 | {
|
|---|
| 109 | ListDirectory($sDir, $iSortColumn);
|
|---|
| 110 | break;
|
|---|
| 111 | }
|
|---|
| 112 |
|
|---|
| 113 | default:
|
|---|
| 114 | echo "IPE";
|
|---|
| 115 | }
|
|---|
| 116 |
|
|---|
| 117 |
|
|---|
| 118 | /*
|
|---|
| 119 | * Finish off the column
|
|---|
| 120 | */
|
|---|
| 121 | require "07-ColumnTwoFooter.php3";
|
|---|
| 122 |
|
|---|
| 123 | if (1)
|
|---|
| 124 | {
|
|---|
| 125 | require "08-News.php3";
|
|---|
| 126 | /*
|
|---|
| 127 | require "09-ContentsTitle.php3";
|
|---|
| 128 |
|
|---|
| 129 | TocBeg();
|
|---|
| 130 | TocEnd();
|
|---|
| 131 |
|
|---|
| 132 | */
|
|---|
| 133 | require "10-EndOfContent.php3";
|
|---|
| 134 | require "11-NetlabsContact.php3";
|
|---|
| 135 |
|
|---|
| 136 | $Kada=date ("j M Y", filemtime(__file__));
|
|---|
| 137 | require "12-OdinBanner.php3";
|
|---|
| 138 | }
|
|---|
| 139 | else
|
|---|
| 140 | {
|
|---|
| 141 | echo "</td>\n</tr></table>\n";
|
|---|
| 142 | echo "</td>\n</tr></table>\n";
|
|---|
| 143 | }
|
|---|
| 144 | require "13-Closing.php3";
|
|---|
| 145 |
|
|---|
| 146 |
|
|---|
| 147 | ?>
|
|---|