[phpcvsview-cvs-updates] phpcvsview func_DirListing.php,1.4,1.5
Status: Pre-Alpha
Brought to you by:
bcheesem
From: Brian C. <bch...@us...> - 2004-10-04 11:51:43
|
Update of /cvsroot/phpcvsview/phpcvsview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2875 Modified Files: func_DirListing.php Log Message: Moved XHTML code generation to the theme. Index: func_DirListing.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/func_DirListing.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** func_DirListing.php 3 Oct 2004 14:03:04 -0000 1.4 --- func_DirListing.php 4 Oct 2004 11:51:32 -0000 1.5 *************** *** 14,25 **** function DisplayDirListing() { global $ModPath, $CVSROOT, $PServer, $UserName, $Password, $ScriptName, ! $HTMLTitle, $HTMLHeading, $HTMLTblHdBg, $HTMLTblCell1, $HTMLTblCell2; - // Calculate the path from the $ScriptName variable. - $ScriptPath = substr($ScriptName, 0, strrpos($ScriptName, "/")); - if ($ScriptPath == "") { - $ScriptPath = "/"; - } - // Create our CVS connection object and set the required properties. $CVSServer = new CVS_PServer($CVSROOT, $PServer, $UserName, $Password); --- 14,19 ---- function DisplayDirListing() { global $ModPath, $CVSROOT, $PServer, $UserName, $Password, $ScriptName, ! $HTMLTitle, $HTMLHeading, $FolderIcon, $FileIcon, $RowClass; // Create our CVS connection object and set the required properties. $CVSServer = new CVS_PServer($CVSROOT, $PServer, $UserName, $Password); *************** *** 41,122 **** // Add the quick link navigation bar. ! $Dirs = explode("/", $ModPath); ! echo "<div class=\"quicknav\">Navigate to: <a href=\"$ScriptName\">Root</a> "; ! $intCount = 1; ! while($intCount < count($Dirs)-2){ ! echo "/ <a href=\"$ScriptName?mp=".ImplodeToPath($Dirs, "/", $intCount)."/\">".$Dirs[$intCount]."</a> "; ! $intCount++; ! } // while ! echo "/ ".$Dirs[$intCount]."</div>\n"; // Start the output for the table. ! echo "<hr />\n"; ! echo "<table>\n"; ! echo " <tr class=\"head\">\n <th> </th>\n <th>File</th>\n <th>Rev.</th>\n <th>Age</th>\n <th>Author</th>\n <th>Last Log Entry</th>\n </tr>\n"; ! $RowClass = "row1"; // Do we need the "Back" operation. if (strlen($ModPath) > 1) { ! $HREF = str_replace("//", "/", "$ScriptName?mp=".substr($ModPath, 0, strrpos(substr($ModPath, 0, -1), "/"))."/"); ! echo " <tr class=\"$RowClass\">\n"; ! echo " <td align=\"center\"><a href=\"$HREF\"><img alt=\"parent\" src=\"$ScriptPath/images/parent.png\" /></a></td>\n"; ! echo " <td><a href=\"$HREF\">Previous Level</a></td>\n"; ! echo " <td> </td>\n"; ! echo " <td> </td>\n"; ! echo " <td> </td>\n"; ! echo " <td> </td>\n"; ! echo " </tr>\n"; ! $RowClass = "row2"; } ! // Process each folder and display a single row in a table. ! foreach ($CVSServer->FOLDERS as $Folder) ! { ! $HREF = str_replace("//", "/", "$ScriptName?mp=$ModPath/".$Folder["Name"]."/"); ! echo " <tr class=\"$RowClass\">\n"; ! echo " <td align=\"center\"><a href=\"$HREF\"><img alt=\"DIR\" src=\"$ScriptPath/images/folder.png\" /></a></td>\n"; ! echo " <td><a href=\"$HREF\">".$Folder["Name"]."</a></td>\n"; ! echo " <td> </td>\n"; ! echo " <td> </td>\n"; ! echo " <td> </td>\n"; ! echo " <td> </td>\n"; ! echo " </tr>\n"; ! if ($RowClass == "row1") { ! $RowClass = "row2"; ! } ! else ! { ! $RowClass = "row1"; ! } ! } ! foreach ($CVSServer->FILES as $File) ! { ! $HREF = str_replace("//", "/", "$ScriptName?mp=$ModPath/".$File["Name"]); ! $DateTime = strtotime($File["Revisions"][$File["Head"]]["date"]); ! $AGE = CalculateDateDiff($DateTime, strtotime(gmdate("M d Y H:i:s"))); ! echo " <tr class=\"$RowClass\" valign=\"top\">\n"; ! echo " <td align=\"center\"><a href=\"$HREF&fh\"><img alt=\"FILE\" src=\"$ScriptPath/images/file.png\" /></a></td>\n"; ! echo " <td><a href=\"$HREF&fh\">".$File["Name"]."</a></td>\n"; ! echo " <td align=\"center\"><a href=\"$HREF&fv&dt=$DateTime\">".$File["Head"]."</a></td>\n"; ! echo " <td align=\"center\">".$AGE." ago</td>\n"; ! echo " <td align=\"center\">".$File["Revisions"][$File["Head"]]["author"]."</td>\n"; ! echo " <td>".str_replace("\n", "<br />", $File["Revisions"][$File["Head"]]["LogMessage"])."</td>\n"; ! echo " </tr>\n"; ! if ($RowClass == "row1") { ! $RowClass = "row2"; ! } ! else ! { ! $RowClass = "row1"; ! } ! } ! ! $CVSServer->Disconnect(); // Close off our HTML table. ! echo " </table>\n"; ! echo "<hr />"; } else { // Else of if ($Response !== true) echo "Connection Failed."; --- 35,58 ---- // Add the quick link navigation bar. ! echo GetQuickLinkBar($ModPath); // Start the output for the table. ! startDirList(); // Do we need the "Back" operation. if (strlen($ModPath) > 1) { ! addParentDirectory($ScriptName, $ScriptPath, $ModPath); } ! // Display the folders within the table. ! addFolders($ModPath, $CVSServer->FOLDERS); ! // Display the files within the table. ! addFiles($ModPath, $CVSServer->FILES); // Close off our HTML table. ! endDirList(); + $CVSServer->Disconnect(); } else { // Else of if ($Response !== true) echo "Connection Failed."; |