[phpcvsview-cvs-updates] phpcvsview/Themes/Yellow theme.php,1.6,1.7
Status: Pre-Alpha
Brought to you by:
bcheesem
From: Sijis A. <si...@us...> - 2005-09-17 06:45:46
|
Update of /cvsroot/phpcvsview/phpcvsview/Themes/Yellow In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25668/Themes/Yellow Modified Files: theme.php Log Message: - made output valid xhtml - code cleanup for cleaner xhtml output snf readability Index: theme.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/Themes/Yellow/theme.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** theme.php 18 Apr 2005 01:14:03 -0000 1.6 --- theme.php 17 Sep 2005 06:45:34 -0000 1.7 *************** *** 12,79 **** **/ ! $FolderIcon = "Themes/".$config['theme']."/Images/folder.png"; ! $FileIcon = "Themes/".$config['theme']."/Images/file.png"; ! $ParentIcon = "Themes/".$config['theme']."/Images/parent.png"; ! $ModuleIcon = "Themes/".$config['theme']."/Images/module.png"; ! $DownloadIcon = "Themes/".$config['theme']."/Images/download.png"; ! function GetPageHeader($Title="", $Heading="") { global $StartTime, $config, $env, $lang; $StartTime = microtime(); ! $PageHead = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'; ! $PageHead .= '<html><head>'; ! if ($Title != "") { ! $PageHead .= '<title>'.$Title.'</title>'; ! } ! $PageHead .= '<link href="Themes/'.$config['theme'].'/theme.css" rel="stylesheet" type="text/css" />'; ! // Add JavaScript to postback the change in theme selection. ! $PageHead .= '<script src="./phpcvsview.js" type="text/javascript"></script>'; ! $PageHead .= '</head>'; ! $PageHead .= '<body>'; ! if ($Heading != "") { ! $PageHead .= '<div class="title">'.$Heading.'</div>'; ! } ! $PageHead .= $lang['message']; ! $PageHead .= '<form class="themechanger" action="'.$_SERVER['PHP_SELF'].'">'; ! $PageHead .= ' '.$lang['change_cvsroot'].' <select name="reposSelect" class="reposchanger" onchange="postBackReposChange(this.form);">'; foreach($config['cvs'] as $key => $value){ ! $PageHead .= '<option value="'.$key.'"'; if ($key == $env['CVSROOT']) { $PageHead .= ' selected="selected"'; } ! $PageHead .= '>'.$value['description'].'</option>'; } ! $PageHead .= '</select><br />'; ! $PageHead .= $lang['change_theme'].' <select name="ThemeSelect" class="themechanger" onchange="postBackThemeChange(this.form);">'; ! foreach (GetThemeList() as $key=>$value) ! { ! $PageHead .= '<option value="'.$value.'"'; if ($value == $config['theme']) { $PageHead .= ' selected="selected"'; } ! $PageHead .= '>'.$value.'</option>'; } ! $PageHead .= '</select>'; ! $PageHead .= ' '.$lang['change_lang'].' <select name="langSelect" class="langchanger" onchange="postBackLangChange(this.form);">'; foreach(getLanguagesList() as $key => $value){ ! $PageHead .= '<option value="'.$value.'"'; if ($value == $config['language']) { $PageHead .= ' selected="selected"'; } ! $PageHead .= '>'.$value.'</option>'; } ! $PageHead .= '</select>'; ! $PageHead .= '<input type="hidden" name="URLRequest" value="'.$env['script_name']; $first = true; ! foreach ($_GET as $key=>$value) ! { if ($key != "tm") { if ($first != true) { ! $PageHead .= "&"; ! } ! else ! { $PageHead .= "?"; } --- 12,80 ---- **/ ! $FolderIcon = "Themes/".$config['theme']."/Images/folder.png"; ! $FileIcon = "Themes/".$config['theme']."/Images/file.png"; ! $ParentIcon = "Themes/".$config['theme']."/Images/parent.png"; ! $ModuleIcon = "Themes/".$config['theme']."/Images/module.png"; ! $DownloadIcon = "Themes/".$config['theme']."/Images/download.png"; ! function GetPageHeader($Title="phpCVSView Source Code Library", $Heading="phpCVSView Source Code Library") ! { global $StartTime, $config, $env, $lang; + $StartTime = microtime(); ! $PageHead = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'."\n"; ! $PageHead .= '<html xmlns="http://www.w3.org/1999/xhtml">'."\n"; ! $PageHead .= '<head>'."\n"; ! $PageHead .= ' <meta http-equiv="content-type" content="text/html; charset='.$lang['encoding'].'" />'."\n"; ! $PageHead .= ' <title>'.$Title.'</title>'."\n"; ! $PageHead .= ' <link href="'.$env['theme_path'].$config['theme'].'/theme.css" rel="stylesheet" type="text/css" />'."\n"; ! $PageHead .= ' <script src="./phpcvsview.js" type="text/javascript"></script>'."\n"; ! $PageHead .= '</head>'."\n"; ! $PageHead .= '<body>'."\n"; ! $PageHead .= '<div id="header">'."\n"; ! $PageHead .= ' <div class="title">'.$Heading.'</div>'."\n"; ! $PageHead .= ' <div class="headmsg">'.$lang['message'].'</div>'."\n"; ! $PageHead .= '</div>'."\n"; ! $PageHead .= '<div id="userOptions">'."\n"; ! $PageHead .= ' <form class="themechanger" action="'.$_SERVER['PHP_SELF'].'">'."\n"; ! $PageHead .= ' <p><label for="reposSelect">'.$lang['change_cvsroot'].'</label>'."\n"; ! $PageHead .= ' <select name="reposSelect" id="reposSelect" class="reposchanger" onchange="postBackReposChange(this.form);">'."\n"; foreach($config['cvs'] as $key => $value){ ! $PageHead .= ' <option value="'.$key.'"'; if ($key == $env['CVSROOT']) { $PageHead .= ' selected="selected"'; } ! $PageHead .= '>'.$value['description'].'</option>'."\n"; } ! $PageHead .= ' </select></p>'."\n"; ! $PageHead .= ' <p><label for="ThemeSelect">'.$lang['change_theme'].'</label>'."\n"; ! $PageHead .= ' <select name="ThemeSelect" id="ThemeSelect" class="themechanger" onchange="postBackThemeChange(this.form);">'."\n"; ! foreach (GetThemeList() as $key=>$value){ ! $PageHead .= ' <option value="'.$value.'"'; if ($value == $config['theme']) { $PageHead .= ' selected="selected"'; } ! $PageHead .= '>'.$value.'</option>'."\n"; } ! $PageHead .= ' </select>'."\n"; ! $PageHead .= ' <label for="langSelect">'.$lang['change_lang'].'</label>'."\n"; ! $PageHead .= ' <select name="langSelect" id="langSelect" class="langchanger" onchange="postBackLangChange(this.form);">'."\n"; foreach(getLanguagesList() as $key => $value){ ! $PageHead .= ' <option value="'.$value.'"'; if ($value == $config['language']) { $PageHead .= ' selected="selected"'; } ! $PageHead .= '>'.$value.'</option>'."\n"; } ! $PageHead .= ' </select>'."\n"; ! $PageHead .= ' <input type="hidden" name="URLRequest" value="'.$env['script_name']; $first = true; ! foreach ($_GET as $key=>$value) { if ($key != "tm") { if ($first != true) { ! $PageHead .= "&"; ! } else { $PageHead .= "?"; } *************** *** 82,98 **** } } ! $PageHead .= '"></form>'; return $PageHead; } ! function GetPageFooter() { global $StartTime, $lang; $EndTime = microtime(); ! $PageFoot = '<div class="footer">'.$lang['generated'].' '.number_format(microtime_diff($StartTime, $EndTime), 3).' '.$lang['seconds'].'<br />'; ! $PageFoot .= $lang['created_by']; ! $PageFoot .= '<p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml11" alt="'.$lang['icon_xhtml'].'" height="31" width="88" /></a> '; ! $PageFoot .= '<a href="http://jigsaw.w3.org/css-validator/check/referer"><img style="border:0;width:88px;height:31px" src="http://www.w3c.org/Icons/valid-css" alt="'.$lang['icon_css'].'" /></a></p>'; ! $PageFoot .= '</div>'; ! $PageFoot .= '</body></html>'; return $PageFoot; } --- 83,106 ---- } } ! $PageHead .= '" /></p>'."\n"; ! $PageHead .= ' </form>'."\n"; ! $PageHead .= '</div>'."\n"; ! return $PageHead; } ! function GetPageFooter() ! { global $StartTime, $lang; + $EndTime = microtime(); ! $PageFoot = '<div class="footer">'.$lang['generated'].' '.number_format(microtime_diff($StartTime, $EndTime), 3).' '.$lang['seconds'].'<br />'."\n"; ! $PageFoot .= ' '.$lang['created_by']."\n"; ! $PageFoot .= ' <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml11" alt="'.$lang['icon_xhtml'].'" height="31" width="88" /></a> '."\n"; ! $PageFoot .= ' <a href="http://jigsaw.w3.org/css-validator/check/referer"><img style="border:0;width:88px;height:31px" src="http://www.w3c.org/Icons/valid-css" alt="'.$lang['icon_css'].'" /></a></p>'."\n"; ! $PageFoot .= '</div>'."\n"; ! $PageFoot .= '</body>'."\n"; ! $PageFoot .= '</html>'."\n"; ! return $PageFoot; } *************** *** 135,139 **** $QLOut .= '</a>'; } ! $QLOut .= '</div>'; return $QLOut; } --- 143,148 ---- $QLOut .= '</a>'; } ! $QLOut .= '</div>'."\n"; ! return $QLOut; } *************** *** 142,148 **** { global $RowClass, $lang; ! echo '<hr />'; ! echo '<table>'; ! echo '<tr class="head"><th> </th><th> </th><th>'.$lang['file'].'</th><th>'.$lang['rev'].'</th><th>'.$lang['age'].'</th><th>'.$lang['author'].'</th><th>'.$lang['last_log'].'</th></tr>'; $RowClass = "row1"; } --- 151,166 ---- { global $RowClass, $lang; ! echo '<hr />'."\n"; ! echo ' <table>'."\n"; ! echo ' <tr class="head">'."\n"; ! echo ' <th> </th>'."\n"; ! echo ' <th> </th>'."\n"; ! echo ' <th>'.$lang['file'].'</th>'."\n"; ! echo ' <th>'.$lang['rev'].'</th>'."\n"; ! echo ' <th>'.$lang['age'].'</th>'."\n"; ! echo ' <th>'.$lang['author'].'</th>'."\n"; ! echo ' <th>'.$lang['last_log'].'</th>'."\n"; ! echo ' </tr>'."\n"; ! $RowClass = "row1"; } *************** *** 150,155 **** function endDirList() { ! echo '</table>'; ! echo '<hr />'; } --- 168,173 ---- function endDirList() { ! echo ' </table>'."\n"; ! echo '<hr />'."\n"; } *************** *** 159,171 **** $HREF = str_replace("//", "/", $env['script_name']."?mp=".substr($env['mod_path'], 0, strrpos(substr($env['mod_path'], 0, -1), "/"))."/"); ! echo '<tr class="'.$RowClass.'">'; ! echo '<td class="min"> </td>'; ! echo '<td class="min"><a href="'.$HREF.'"><img alt="'.$lang['icon_parent'].'" src="'.$env['script_path'].'/'.$ParentIcon.'" /></a></td>'; ! echo '<td class="min"><a href="'.$HREF.'">'.$lang['up_folder'].'</a></td>'; ! echo '<td> </td>'; ! echo '<td> </td>'; ! echo '<td> </td>'; ! echo '<td> </td>'; ! echo '</tr>'; $RowClass = "row2"; } --- 177,190 ---- $HREF = str_replace("//", "/", $env['script_name']."?mp=".substr($env['mod_path'], 0, strrpos(substr($env['mod_path'], 0, -1), "/"))."/"); ! echo ' <tr class="'.$RowClass.'">'."\n"; ! echo ' <td class="min"> </td>'."\n"; ! echo ' <td class="min"><a href="'.$HREF.'"><img alt="'.$lang['icon_parent'].'" src="'.$env['script_path'].'/'.$ParentIcon.'" /></a></td>'."\n"; ! echo ' <td class="min"><a href="'.$HREF.'">'.$lang['up_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"; } *************** *** 173,197 **** function addFolders($Folders) { ! global $RowClass, $DownloadIcon, $FolderIcon, $env; foreach ($Folders as $Folder) { $HREF = str_replace("//", "/", $env['script_name']."?mp=".$env['mod_path']."/".$Folder["Name"]."/"); ! echo '<tr class="'.$RowClass.'">'; if ($Folder["Name"] != "CVSROOT" && $Folder["Name"] != "Attic") { ! echo '<td class="min"><a href="'.$HREF.'&dp"><img alt="'.$lang['icon_dl'].'" src="'.$env['script_path'].'/'.$DownloadIcon.'" /></a></td>'; ! } else { ! echo '<td class="min"> </td>'; ! } ! echo '<td class="min"><a href="'.$HREF.'"><img alt="'.$lang['icon_dir'].'" src="'.$env['script_path'].'/'.$FolderIcon.'" /></a></td>'; ! echo '<td class="min"><a href="'.$HREF.'">'.$Folder["Name"].'</a></td>'; ! echo '<td> </td>'; ! echo '<td> </td>'; ! echo '<td> </td>'; ! echo '<td> </td>'; ! echo '</tr>'; ! if ($RowClass == "row1") { ! $RowClass = "row2"; } else { ! $RowClass = "row1"; } } } --- 192,214 ---- function addFolders($Folders) { ! global $RowClass, $DownloadIcon, $FolderIcon, $env, $lang; ! foreach ($Folders as $Folder) { $HREF = str_replace("//", "/", $env['script_name']."?mp=".$env['mod_path']."/".$Folder["Name"]."/"); ! echo ' <tr class="'.$RowClass.'">'."\n"; if ($Folder["Name"] != "CVSROOT" && $Folder["Name"] != "Attic") { ! echo ' <td class="min"><a href="'.$HREF.'&dp"><img alt="'.$lang['icon_dl'].'" src="'.$env['script_path'].'/'.$DownloadIcon.'" /></a></td>'."\n"; } else { ! echo ' <td class="min"> </td>'."\n"; } + echo ' <td class="min"><a href="'.$HREF.'"><img alt="'.$lang['icon_dir'].'" src="'.$env['script_path'].'/'.$FolderIcon.'" /></a></td>'."\n"; + echo ' <td class="min"><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"; + + $RowClass = ($RowClass == "row1")? "row2" : "row1"; } } *************** *** 199,225 **** function addModules($Modules) { ! global $RowClass, $DownloadIcon, $ModuleIcon, $env; foreach ($Modules as $Key => $Val) { // Add the row data here. $HREF = str_replace("//", "/", $env['script_name']."?mp=".$env['mod_path'].$Val."/"); ! echo '<tr class="'.$RowClass.'">'; if ($Val != "CVSROOT" && $Val != "Attic") { ! echo '<td class="min"><a href="'.$HREF.'&dp"><img alt="'.$lang['icon_dl'].'" src="'.$env['script_path'].'/'.$DownloadIcon.'" /></a></td>'; ! } else { ! echo '<td class="min"> </td>'; ! } ! echo '<td class="min"><a href="'.$HREF.'"><img alt="'.$lang['icon_mod'].'" src="'.$env['script_path'].'/'.$ModuleIcon.'" /></a></td>'; ! echo '<td class="min"><a href="'.$HREF.'">'.$Key.'</a></td>'; ! echo '<td> </td>'; ! echo '<td> </td>'; ! echo '<td> </td>'; ! echo '<td> </td>'; ! echo '</tr>'; ! if ($RowClass == "row1") { ! $RowClass = "row2"; } else { ! $RowClass = "row1"; } } } --- 216,239 ---- function addModules($Modules) { ! global $RowClass, $DownloadIcon, $ModuleIcon, $env, $lang; foreach ($Modules as $Key => $Val) { // Add the row data here. $HREF = str_replace("//", "/", $env['script_name']."?mp=".$env['mod_path'].$Val."/"); ! echo ' <tr class="'.$RowClass.'">'."\n"; if ($Val != "CVSROOT" && $Val != "Attic") { ! echo ' <td class="min"><a href="'.$HREF.'&dp"><img alt="'.$lang['icon_dl'].'" src="'.$env['script_path'].'/'.$DownloadIcon.'" /></a></td>'."\n"; } else { ! echo ' <td class="min"> </td>'."\n"; } + echo ' <td class="min"><a href="'.$HREF.'"><img alt="'.$lang['icon_mod'].'" src="'.$env['script_path'].'/'.$ModuleIcon.'" /></a></td>'."\n"; + echo ' <td class="min"><a href="'.$HREF.'">'.$Key.'</a></td>'."\n"; + echo ' <td> </td>'."\n"; + echo ' <td> </td>'."\n"; + echo ' <td> </td>'."\n"; + echo ' <td> </td>'."\n"; + echo ' </tr>'."\n"; + + $RowClass = ($RowClass == "row1")? "row2" : "row1"; } } *************** *** 233,250 **** $DateTime = strtotime($File["Revisions"][$File["Head"]]["date"]); $AGE = CalculateDateDiff($DateTime, strtotime(gmdate("M d Y H:i:s"))); ! echo '<tr class="'.$RowClass.'">'; ! echo '<td class="min"> </td>'; ! echo '<td align="center"><a href="'.$HREF.'&fh"><img alt="'.$lang['icon_file'].'" src="'.$env['script_path'].'/'.$FileIcon.'" /></a></td>'; ! echo '<td><a href="'.$HREF.'&fh">'.$File["Name"].'</a></td>'; ! echo '<td align="center"><a href="'.$HREF.'&fv&dt='.$DateTime.'">'.$File["Head"].'</a></td>'; ! echo '<td align="center">'.str_replace(" ", " ", $AGE).' '.$lang['ago'].'</td>'; ! echo '<td align="center">'.$File["Revisions"][$File["Head"]]["author"].'</td>'; ! echo '<td>'.str_replace(array("\n", " "), array("<br />", " "), $File["Revisions"][$File["Head"]]["LogMessage"]).'</td>'; ! echo '</tr>'; ! if ($RowClass == "row1") { ! $RowClass = "row2"; ! } else { ! $RowClass = "row1"; ! } } } --- 247,261 ---- $DateTime = strtotime($File["Revisions"][$File["Head"]]["date"]); $AGE = CalculateDateDiff($DateTime, strtotime(gmdate("M d Y H:i:s"))); ! echo ' <tr class="'.$RowClass.'">'."\n"; ! echo ' <td class="min"> </td>'."\n"; ! echo ' <td align="center"><a href="'.$HREF.'&fh"><img alt="'.$lang['icon_file'].'" src="'.$env['script_path'].'/'.$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">'.str_replace(" ", " ", $AGE).' '.$lang['ago'].'</td>'."\n"; ! echo ' <td align="center">'.$File["Revisions"][$File["Head"]]["author"].'</td>'."\n"; ! echo ' <td>'.str_replace(array("\n", " "), array("<br />", " "), $File["Revisions"][$File["Head"]]["LogMessage"]).'</td>'."\n"; ! echo ' </tr>'."\n"; ! ! $RowClass = ($RowClass == "row1")? "row2" : "row1"; } } *************** *** 255,274 **** $HREF = str_replace("//", "/", $env['script_name']."?mp=".$env['mod_path']); ! ! $DiffForm = '<form class="diffform" action="'.$_SERVER['PHP_SELF'].'">'; ! $DiffForm .= 'Diff between: <select name="DiffRev1" class="diffform">'; ! foreach ($CVSServer->FILES[0]["Revisions"] as $Revision) ! { ! $DiffForm .= '<option value="'.$Revision["Revision"].'">'.$Revision["Revision"].'</option>'; } ! $DiffForm .= '</select> and <select name="DiffRev2" class="diffform">'; ! foreach ($CVSServer->FILES[0]["Revisions"] as $Revision) ! { ! $DiffForm .= '<option value="'.$Revision["Revision"].'">'.$Revision["Revision"].'</option>'; } ! $DiffForm .= '</select><input type="hidden" name="URLDiffReq" value="'.$HREF.'">'; ! $DiffForm .= '<input type="button" value="Get Diff" onclick="postBackDiffRequest(this.form);">'; ! $DiffForm .= '</form>'; ! return $DiffForm; } --- 266,285 ---- $HREF = str_replace("//", "/", $env['script_name']."?mp=".$env['mod_path']); ! ! $DiffForm = '<form class="diffform" action="'.$_SERVER['PHP_SELF'].'">'."\n"; ! $DiffForm .= ' Diff between: <select name="DiffRev1" class="diffform">'."\n"; ! foreach ($CVSServer->FILES[0]["Revisions"] as $Revision){ ! $DiffForm .= ' <option value="'.$Revision["Revision"].'">'.$Revision["Revision"].'</option>'."\n"; } ! $DiffForm .= ' </select> and '."\n"; ! $DiffForm .= ' <select name="DiffRev2" class="diffform">'."\n"; ! foreach ($CVSServer->FILES[0]["Revisions"] as $Revision){ ! $DiffForm .= ' <option value="'.$Revision["Revision"].'">'.$Revision["Revision"].'</option>'."\n"; } ! $DiffForm .= ' </select>'."\n"; ! $DiffForm .= ' <input type="hidden" name="URLDiffReq" value="'.$HREF.'" />'."\n"; ! $DiffForm .= ' <input type="button" value="Get Diff" onclick="postBackDiffRequest(this.form);" />'."\n"; ! $DiffForm .= '</form>'."\n"; ! return $DiffForm; } |