mirror of
https://github.com/reactos/reactos.git
synced 2024-12-26 17:14:41 +00:00
Locate latest revision ISO
svn path=/trunk/; revision=16973
This commit is contained in:
parent
a7acccff70
commit
db35c17756
1 changed files with 25 additions and 4 deletions
|
@ -109,9 +109,12 @@ function printMenu($revision)
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="7">
|
<td colspan="4">
|
||||||
<input type="submit" name="getnextiso" value="Next ISO" tabindex="4" style="border: 1px solid #000000"></input>
|
<input type="submit" name="getnextiso" value="Next ISO" tabindex="4" style="border: 1px solid #000000"></input>
|
||||||
</td>
|
</td>
|
||||||
|
<td colspan="3" align="right">
|
||||||
|
<input type="submit" name="getlatestiso" value="Latest ISO" tabindex="5" style="border: 1px solid #000000"></input>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
@ -139,7 +142,7 @@ if (revision) revision.focus();
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNextRevisionISO($branch, $revision)
|
function locateRevisionISO($branch, $revision, $latest)
|
||||||
{
|
{
|
||||||
$revision = intval($revision);
|
$revision = intval($revision);
|
||||||
$path = ISO_PATH . "\\" . $branch;
|
$path = ISO_PATH . "\\" . $branch;
|
||||||
|
@ -153,13 +156,16 @@ function getNextRevisionISO($branch, $revision)
|
||||||
$d->close();
|
$d->close();
|
||||||
|
|
||||||
if (is_array($filelist)) {
|
if (is_array($filelist)) {
|
||||||
usort($filelist, "dm_usort_cmp_desc");
|
$sortFunction = $latest ? "dm_usort_cmp" : "dm_usort_cmp_desc";
|
||||||
|
usort($filelist, $sortFunction);
|
||||||
reset($filelist);
|
reset($filelist);
|
||||||
while (list($key, $filename) = each($filelist)) {
|
while (list($key, $filename) = each($filelist)) {
|
||||||
if (ereg('ReactOS-' . $branch . '-r([0-9]*).iso', $filename, $regs))
|
if (ereg('ReactOS-' . $branch . '-r([0-9]*).iso', $filename, $regs))
|
||||||
{
|
{
|
||||||
$thisRevision = intval($regs[1]);
|
$thisRevision = intval($regs[1]);
|
||||||
if ($thisRevision > $revision)
|
if (($latest) && ($thisRevision < $revision))
|
||||||
|
return $regs[1];
|
||||||
|
else if ($thisRevision > $revision)
|
||||||
return $regs[1];
|
return $regs[1];
|
||||||
$lastRevision = $thisRevision;
|
$lastRevision = $thisRevision;
|
||||||
}
|
}
|
||||||
|
@ -169,6 +175,15 @@ function getNextRevisionISO($branch, $revision)
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getNextRevisionISO($branch, $revision)
|
||||||
|
{
|
||||||
|
return locateRevisionISO($branch, $revision, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getLatestRevisionISO($branch)
|
||||||
|
{
|
||||||
|
return locateRevisionISO($branch, 999999, true);
|
||||||
|
}
|
||||||
|
|
||||||
function main()
|
function main()
|
||||||
{
|
{
|
||||||
|
@ -199,6 +214,12 @@ else if (!empty($_POST["getnextiso"]) && !empty($_POST["branch"]) && !empty($_PO
|
||||||
printMenu(getNextRevisionISO($_POST["branch"], $_POST["revision"]));
|
printMenu(getNextRevisionISO($_POST["branch"], $_POST["revision"]));
|
||||||
printFooter();
|
printFooter();
|
||||||
}
|
}
|
||||||
|
else if (!empty($_POST["getlatestiso"]) && !empty($_POST["branch"]))
|
||||||
|
{
|
||||||
|
printHeader();
|
||||||
|
printMenu(getLatestRevisionISO($_POST["branch"]));
|
||||||
|
printFooter();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printHeader();
|
printHeader();
|
||||||
|
|
Loading…
Reference in a new issue