Author: cfinck
Date: Sat Jul 7 16:43:00 2007
New Revision: 27451
URL:
http://svn.reactos.org/svn/reactos?rev=27451&view=rev
Log:
- Show the number of found files
- Add and change some localization strings
- Output error messages of "ajax-getfiles-provider.php" also as XML. This
prevents syntax error messages in the XML interpreters of some browsers (like Firefox),
which have no bad influence, but show up in the error log anyway
- Replace the <button> tag with an <input> tag, this looks better in Konqueror
and probably other browsers as well :-)
Modified:
trunk/web/reactos.org/htdocs/getbuilds/ajax-getfiles-provider.php
trunk/web/reactos.org/htdocs/getbuilds/getbuilds.css
trunk/web/reactos.org/htdocs/getbuilds/getbuilds.js.php
trunk/web/reactos.org/htdocs/getbuilds/index.php
trunk/web/reactos.org/htdocs/getbuilds/lang/de.inc.php
trunk/web/reactos.org/htdocs/getbuilds/lang/en.inc.php
Modified:
trunk/web/reactos.org/htdocs/getbuilds/ajax-getfiles-provider.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/getbuilds/a…
==============================================================================
---
trunk/web/reactos.org/htdocs/getbuilds/ajax-getfiles-provider.php (original)
+++
trunk/web/reactos.org/htdocs/getbuilds/ajax-getfiles-provider.php Sat Jul 7 16:43:00
2007
@@ -36,11 +36,13 @@
// Entry point
+ header("Content-type: text/xml");
+
if( !isset( $_GET["get"] ) || !isset( $_GET["startrev"] ) )
- die("Necessary information not specified!");
+ die("<error><message>Necessary information not
specified!</message></error>");
if( $_GET["endrev"] - $_GET["startrev"] > $REV_RANGE_LIMIT )
- die("Maximum revision range limit of $REV_RANGE_LIMIT exceeded!");
+ die(
"<error><message>LIMIT</message><limit>$REV_RANGE_LIMIT</limit></error>"
);
switch( $_GET["get"] )
{
@@ -58,7 +60,7 @@
break;
default:
- die("Wrong input for parameter 'get'!");
+ die("<error><message>Wrong input for parameter
'get'!</message></error>");
}
$file_patterns = array();
@@ -71,16 +73,15 @@
if( $_GET["livecd-rel"] == 1 )
$file_patterns[] = "#livecd-[0-9]+-rel#";
- header("Content-type: text/xml");
- echo "<fileinformation>";
-
$exitloop = false;
$filenum = 0;
$firstrev = 0;
$lastrev = 0;
$morefiles = 0;
- $dir = opendir( $ISO_DIR ) or die("opendir failed!");
+ $dir = opendir( $ISO_DIR ) or die("<error><message>opendir
failed!</message></error>");
+ echo "<fileinformation>";
+
while( $fname = readdir($dir) )
if( preg_match( "#-([0-9]+)-#", $fname, $matches ) )
$fnames[ $matches[1] ][] = $fname;
Modified:
trunk/web/reactos.org/htdocs/getbuilds/getbuilds.css
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/getbuilds/g…
==============================================================================
---
trunk/web/reactos.org/htdocs/getbuilds/getbuilds.css (original)
+++
trunk/web/reactos.org/htdocs/getbuilds/getbuilds.css Sat Jul 7 16:43:00 2007
@@ -75,13 +75,17 @@
margin-bottom: 2em;
}
-#controlbox button {
+#controlbox input {
font-weight: bold;
}
#ajaxloadinginfo {
font-weight: bold;
margin-left: 20px;
+}
+
+#infotable {
+ width: 100%;
}
#pagesbox {
Modified:
trunk/web/reactos.org/htdocs/getbuilds/getbuilds.js.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/getbuilds/g…
==============================================================================
---
trunk/web/reactos.org/htdocs/getbuilds/getbuilds.js.php (original)
+++
trunk/web/reactos.org/htdocs/getbuilds/getbuilds.js.php Sat Jul 7 16:43:00 2007
@@ -10,6 +10,7 @@
var currentpage;
var endrev;
+var filenum;
var fullrange;
var inputbox_startrev;
var inputbox_endrev;
@@ -85,20 +86,37 @@
function getfilesCallback(http_request, data)
{
- // "ajax-getfiles.php" always outputs text/xml data, so we have to check here
if it's really XML or just an error message
- if( http_request.responseText.substr(0, 1) != "<" )
- {
- alert( http_request.responseText );
+ // Check for an error
+ if( http_request.responseXML.getElementsByTagName("error").length > 0 )
+ {
+ // For some errors, we show a localized error message
+ if(
http_request.responseXML.getElementsByTagName("message")[0].firstChild.data ==
"LIMIT" )
+ alert( '<?php printf( $getbuilds_langres["rangelimitexceeded"],
"' +
http_request.responseXML.getElementsByTagName(\"limit\")[0].firstChild.data +
'" ); ?>' );
+ else
+ alert(
http_request.responseXML.getElementsByTagName("message")[0].firstChild.data );
+
loadingsplash(0);
return;
}
var html = "";
-
+
if( data["requesttype"] == "FirstPageFullLoad" ||
data["requesttype"] == "PageSwitch" )
{
+ html += '<table id="infotable" cellspacing="0"
cellpadding="0"><tr><td id="infobox">';
+
+ if( data["requesttype"] == "FirstPageFullLoad" )
+ {
+ filenum = parseInt(
http_request.responseXML.getElementsByTagName("filenum")[0].firstChild.data );
+ html += '<?php printf( $getbuilds_langres["foundfiles"],
"<span id=\"filenum\">' + filenum + '</span>" );
?>';
+ }
+ else
+ html += document.getElementById("infobox").innerHTML;
+
+ html += '</td>';
+
// Page number boxes
- html += '<div id="pagesbox">';
+ html += '<td id="pagesbox">';
if( currentpage == 1 )
{
@@ -123,9 +141,7 @@
html += ' - ' +
http_request.responseXML.getElementsByTagName("firstrev")[0].firstChild.data +
' ... ' +
http_request.responseXML.getElementsByTagName("lastrev")[0].firstChild.data +
'</option>';
}
else
- {
html += document.getElementById("pagesel").innerHTML;
- }
html += '</select> ';
@@ -140,7 +156,7 @@
html += '<a href="javascript:lastPage()" title="<?php echo
$getbuilds_langres["lastpage_title"];
?>">»</a>';
}
- html += '</div>';
+ html += '</td></tr></table>';
// File table
html += '<table class="datatable" cellspacing="0"
cellpadding="1">';
@@ -150,7 +166,7 @@
var files = http_request.responseXML.getElementsByTagName("file");
if( files.length == 0 )
- html += '<tr class="odd"><td><?php echo
$getbuilds_langres["nofiles1"]; ?>' + fullrange + '<?php echo
$getbuilds_langres["nofiles2"];
?></td><td> </td><td> </td></tr>';
+ html += '<tr class="odd"><td><?php printf(
$getbuilds_langres["nofiles"], "' + fullrange + '" );
?></td><td> </td><td> </td></tr>';
else
{
var oddeven = false;
@@ -192,6 +208,9 @@
else if( data["requesttype"] == "FirstPageAddPage" )
{
pagecount++;
+ filenum += parseInt(
http_request.responseXML.getElementsByTagName("filenum")[0].firstChild.data );
+
+ document.getElementById("filenum").firstChild.data = filenum;
// As always, we have to work around an IE bug
// If I use "innerHTML" here, the first <OPTION> start tag gets dropped
in the IE...
Modified:
trunk/web/reactos.org/htdocs/getbuilds/index.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/getbuilds/i…
==============================================================================
---
trunk/web/reactos.org/htdocs/getbuilds/index.php (original)
+++
trunk/web/reactos.org/htdocs/getbuilds/index.php Sat Jul 7 16:43:00 2007
@@ -111,7 +111,7 @@
'</table>' +
'<div id="controlbox">' +
- '<button type="button" onclick="showRev();"><?php
echo $getbuilds_langres["showrev"]; ?></button>' +
+ '<input type="button" onclick="showRev();"
value="<?php echo $getbuilds_langres["showrev"]; ?>" />'
+
'<span id="ajaxloadinginfo">' +
'<img src="images/ajax_loading.gif"> <?php echo
$getbuilds_langres["gettinglist"]; ?>...' +
Modified:
trunk/web/reactos.org/htdocs/getbuilds/lang/de.inc.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/getbuilds/l…
==============================================================================
---
trunk/web/reactos.org/htdocs/getbuilds/lang/de.inc.php (original)
+++
trunk/web/reactos.org/htdocs/getbuilds/lang/de.inc.php Sat Jul 7 16:43:00 2007
@@ -28,6 +28,8 @@
$getbuilds_langres["rangeinfo"] = "Sie können eine Revisionsnummer (z.B.
<i>27154</i>) oder einen Revisionsbereich (z.B.
<i>27000-27154</i>) eingeben.";
$getbuilds_langres["isotype"] = "CD-Image-Typen anzeigen";
+ $getbuilds_langres["foundfiles"] = "%s Dateien gefunden!";
+
$getbuilds_langres["firstpage_title"] = "Gehe zur ersten Seite";
$getbuilds_langres["prevpage_title"] = "Vorherige Seite";
$getbuilds_langres["prevpage"] = "Zurück";
@@ -41,7 +43,8 @@
$getbuilds_langres["filedate"] = "Zuletzt geändert";
$getbuilds_langres["pleasewait"] = "Bitte warten";
- $getbuilds_langres["nofiles1"] = "Für Revision ";
- $getbuilds_langres["nofiles2"] = "gibt es keine vorkompilierten
Dateien!";
+ $getbuilds_langres["nofiles"] = "Für Revision %s gibt es keine
vorkompilierten Dateien!";
$getbuilds_langres["invalidrev"] = "Ungültige Revisionsnummer!";
+
+ $getbuilds_langres["rangelimitexceeded"] = "Der Revisionsbereich darf
maximal %s Revisionen umfassen!";
?>
Modified:
trunk/web/reactos.org/htdocs/getbuilds/lang/en.inc.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/getbuilds/l…
==============================================================================
---
trunk/web/reactos.org/htdocs/getbuilds/lang/en.inc.php (original)
+++
trunk/web/reactos.org/htdocs/getbuilds/lang/en.inc.php Sat Jul 7 16:43:00 2007
@@ -28,6 +28,8 @@
$getbuilds_langres["rangeinfo"] = "You can enter a revision number (e.g.
<i>27154</i>) or a revision range (e.g.
<i>27000-27154</i>).";
$getbuilds_langres["isotype"] = "Show CD Image types";
+ $getbuilds_langres["foundfiles"] = "Found %s files!";
+
$getbuilds_langres["firstpage_title"] = "Go to the first page";
$getbuilds_langres["prevpage_title"] = "Previous page";
$getbuilds_langres["prevpage"] = "Previous";
@@ -41,7 +43,8 @@
$getbuilds_langres["filedate"] = "Last changed";
$getbuilds_langres["pleasewait"] = "Please wait";
- $getbuilds_langres["nofiles1"] = "There are no prebuilt files for
revision ";
- $getbuilds_langres["nofiles2"] = "!";
+ $getbuilds_langres["nofiles"] = "There are no prebuilt files for
revision %s!";
$getbuilds_langres["invalidrev"] = "Invalid revision number!";
+
+ $getbuilds_langres["rangelimitexceeded"] = "The revision range can only
comprise a maximum of %s revisions!";
?>