[phpcvsview-cvs-updates] phpcvsview/Themes/Default theme.css,1.2,1.3 theme.php,1.2,1.3
Status: Pre-Alpha
Brought to you by:
bcheesem
From: Brian C. <bch...@us...> - 2004-10-04 11:40:29
|
Update of /cvsroot/phpcvsview/phpcvsview/Themes/Default In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv635 Modified Files: theme.css theme.php Log Message: Theme support enhanced with code to provide the directory listing. Index: theme.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/Themes/Default/theme.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** theme.php 3 Oct 2004 14:03:04 -0000 1.2 --- theme.php 4 Oct 2004 11:40:17 -0000 1.3 *************** *** 11,14 **** --- 11,18 ---- * @copyright 2003-2004 Brian A Cheeseman **/ + + $FolderIcon = "Themes/Default/Images/folder.gif"; + $FileIcon = "Themes/Default/Images/file.gif"; + $ParentIcon = "Themes/Default/Images/parent.gif"; function GetPageHeader($Title="", $Heading="") { *************** *** 44,46 **** --- 48,169 ---- } // End of function GetPageFooter() + function GetQuickLinkBar($ModPath = "/", $Prefix = "Navigate to: ", $LinkLast = false, $LastIsFile = false, $Revision = "") + { + // Add the quick link navigation bar. + $Dirs = explode("/", $ModPath); + $QLOut = "<div class=\"quicknav\">$Prefix<a href=\"$ScriptName\">Root</a> "; + $intCount = 1; + $OffSet = 2; + if ($LastIsFile) { + $OffSet = 1; + } + while($intCount < count($Dirs)-$OffSet){ + if (($intCount != count($Dirs)-$OffSet)) { + $QLOut .= "/ <a href=\"$ScriptName?mp=".ImplodeToPath($Dirs, "/", $intCount)."/\">".$Dirs[$intCount]."</a> "; + } + else + { + $QLOut .= "/ ".$Dirs[$intCount]." "; + } + $intCount++; + } // while + $QLOut .= "/ "; + if ($LinkLast) { + $QLOut .= "<a href=\"$ScriptName?mp=".ImplodeToPath($Dirs, "/", $intCount); + if ($LastIsFile) { + $QLOut .= "&fh#rd$Revision\">"; + } + else + { + $QLOut .= "/"; + } + } + $QLOut .= $Dirs[$intCount]; + if ($LinkLast) { + $QLOut .= "</a>"; + } + $QLOut .= "</div>\n"; + return $QLOut; + } + + function startDirList() + { + global $RowClass; + 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"; + } + + function endDirList() + { + echo " </table>\n"; + echo "<hr />"; + } + + function addParentDirectory($ModPath) + { + global $RowClass, $ParentIcon, $ScriptName, $ScriptPath; + $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/$ParentIcon\" /></a></td>\n"; + echo " <td><a href=\"$HREF\">Up one folder</a></td>\n"; + echo " <td> </td>\n"; + echo " <td> </td>\n"; + echo " <td> </td>\n"; + echo " <td> </td>\n"; + echo " </tr>\n"; + $RowClass = "row2"; + } + + function addFolders($ModPath, $Folders) + { + global $RowClass, $FolderIcon, $ScriptName, $ScriptPath; + foreach ($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/$FolderIcon\" /></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"; + } + } + } + + function addFiles($ModPath, $Files) + { + global $RowClass, $FileIcon, $ScriptName, $ScriptPath; + foreach ($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/$FileIcon\" /></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"; + } + } + } + ?> \ No newline at end of file Index: theme.css =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/Themes/Default/theme.css,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** theme.css 3 Oct 2004 14:03:04 -0000 1.2 --- theme.css 4 Oct 2004 11:40:17 -0000 1.3 *************** *** 8,13 **** font-family: Verdana, arial, sans-serif; font-size: 10pt; ! background-color: #ffffff; ! color: #000000; } img --- 8,13 ---- font-family: Verdana, arial, sans-serif; font-size: 10pt; ! background-color: #000000; ! color: #ffff99; } img *************** *** 17,21 **** a:link,a:active,a:visited { ! color: #6666ff; text-decoration: none; font-weight: bold; --- 17,21 ---- a:link,a:active,a:visited { ! color: #9999ff; text-decoration: none; font-weight: bold; *************** *** 23,27 **** a:hover { ! color: #9966ff; text-decoration: underline; font-weight: bold; --- 23,27 ---- a:hover { ! color: #ff99ff; text-decoration: underline; font-weight: bold; *************** *** 29,33 **** .head { ! background-color: #cccccc; } .footer --- 29,41 ---- .head { ! background-color: #666677; ! } ! .row1 ! { ! background-color: #000011; ! } ! .row2 ! { ! background-color: #222233; } .footer *************** *** 38,43 **** .quicknav { ! font-size: 10pt; text-align: left; } .title --- 46,52 ---- .quicknav { ! font-size: 8pt; text-align: left; + font-weight: bold; } .title *************** *** 46,62 **** font-size: 18pt; font-weight: bold; ! } ! .row1 ! { ! background-color: #ffffff; ! } ! .row2 ! { ! background-color: #ddddff; } table { ! /* margin:0px 0px 0px 0px; */ ! font-size: 10pt; border: 0px none; width: 100%; --- 55,64 ---- font-size: 18pt; font-weight: bold; ! font-style: italic; ! color: white; } table { ! font-size: 8pt; border: 0px none; width: 100%; *************** *** 67,70 **** { padding: 3px; - white-space: nowrap; } --- 69,71 ---- |