Хранилища Subversion ant

Сравнить редакции

Не учитывать пробелы Редакция 51 → Редакция 52

/trunk/modern.php
67,9 → 67,11
tmpSelect.clearSelect();
adjustReps();
$('#replist').css('display','none');
$('#getfile').css('display','none');
} else {
$.getJSON('m-process.php',{d:distroValue,status:1},function(data) { tmpSelect.fillSelect(data).attr('disabled',''); adjustReps(); });
$('#replist').css('display','none');
$('#getfile').css('display','none');
}
};
// Выбор версии дистрибутива
77,7 → 79,8
var distroValue = $('#distro').val();
var versionValue = $('#distver').val();
if (distroValue != 0 && versionValue != 0) {
$.get('m-process.php',{d:distroValue,v:versionValue,status:2},function(data){ $('#replist').css('display','block'); $('#replist').html(data); },'html');
$.get('m-process.php',{d:distroValue,v:versionValue,status:2},function(data){ $('#replist').css('display','block'); $('#replist').html(data); });
$.get('m-process.php',{d:distroValue,v:versionValue,status:3},function(data){ $('#getfile').css('display','block'); $('#getfile').html(data); });
}
}
 
102,6 → 105,7
$modern .= "<select id='distver' disabled='disabled'><option></option>";
$modern .= "</select></div>";
$modern .= "<pre id='replist'></pre>";
$modern .= "<p id='getfile'></p>";
 
$smarty->assign('modern',$modern);
$smarty->assign('scripts',$scripts);
/trunk/index.php
67,9 → 67,11
tmpSelect.clearSelect();
adjustReps();
$('#replist').css('display','none');
$('#getfile').css('display','none');
} else {
$.getJSON('m-process.php',{d:distroValue,status:1},function(data) { tmpSelect.fillSelect(data).attr('disabled',''); adjustReps(); });
$('#replist').css('display','none');
$('#getfile').css('display','none');
}
};
// Выбор версии дистрибутива
77,7 → 79,8
var distroValue = $('#distro').val();
var versionValue = $('#distver').val();
if (distroValue != 0 && versionValue != 0) {
$.get('m-process.php',{d:distroValue,v:versionValue,status:2},function(data){ $('#replist').css('display','block'); $('#replist').html(data); },'html');
$.get('m-process.php',{d:distroValue,v:versionValue,status:2},function(data){ $('#replist').css('display','block'); $('#replist').html(data); });
$.get('m-process.php',{d:distroValue,v:versionValue,status:3},function(data){ $('#getfile').css('display','block'); $('#getfile').html(data); });
}
}
 
102,6 → 105,7
$modern .= "<select id='distver' disabled='disabled'><option></option>";
$modern .= "</select></div>";
$modern .= "<pre id='replist'></pre>";
$modern .= "<p id='getfile'></p>";
 
$smarty->assign('modern',$modern);
$smarty->assign('scripts',$scripts);
/trunk/m-process.php
27,7 → 27,7
$status = abs(intval($_GET["status"]));
 
header('Content-Type: text/html; charset=utf-8');
//if($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
if($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
 
switch($status) {
case '1':
46,6 → 46,7
case '2':
$query =& $db->query("SELECT * FROM settings");
$settings = array();
$result = "# Ant: sources.list generator :: http://track.altlug.ru/projects/show/ant\n\n";
while ($query->fetchInto($setting, DB_FETCHMODE_ASSOC)) {
$settings[stripslashes($setting["opt"])] = stripslashes($setting["optvalue"]);
};
69,11 → 70,14
$repscheme = str_replace("{DIST}",stripslashes($infodist["vcodename"]),$repscheme);
$repscheme = str_replace("{SECT}",$sections,$repscheme);
$result .= $repscheme."\n";
$result .= "# ".stripslashes($resinfo["repdescribe"])."\n".$repscheme."\n";
}
break;
case '3':
$result = "<a href='./get.php?id=".$dist.",".$vers."'>Получить sources.list файлом</a>";
break;
}
print $result;
//}
}
 
?>
/trunk/templates/index.tpl
5,9 → 5,9
{if $status == 0}
<h2>Выбор дистрибутива</h2>
<form action='./index.php' method='get'>
<p><input type='hidden' name='step' value='1' /></p>
<p><input type='hidden' name='step' value='1'></p>
{$linux}
<p><input type='submit' value=' Выбрать дистрибутив ' /></p>
<p><input type='submit' value=' Выбрать дистрибутив '></p>
</form>
{/if}
 
14,9 → 14,9
{if $status == 1}
<h2>Выбор версии дистрибутива</h2>
<form action='./index.php' method='get'>
<p><input type='hidden' name='step' value='2' /></p>
<p><input type='hidden' name='step' value='2'></p>
{$version}
<p><input type='submit' value=' Получить sources.list ' /></p>
<p><input type='submit' value=' Получить sources.list '></p>
</form>
{/if}
 
25,6 → 25,6
{/if}
</div>
 
<div id='footer'><a href="http://track.altlug.ru/projects/show/ant">Ant {$antversion}</a></div>
<div id='footer'><a href="http://track.altlug.ru/projects/show/ant">Ant {$antversion}</a> {$interface}</div>
 
{include file="footer.tpl"}
/trunk/templates/header.tpl
1,10 → 1,9
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru" lang="ru">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>{$title}</title>
<link rel="stylesheet" type="text/css" href="./css/ant.css" />
<link rel="stylesheet" type="text/css" href="./css/ant.css">
</head>
<body>
/trunk/templates/classic.tpl
5,9 → 5,9
{if $status == 0}
<h2>Выбор дистрибутива</h2>
<form action='./classic.php' method='get'>
<p><input type='hidden' name='step' value='1' /></p>
<p><input type='hidden' name='step' value='1'></p>
{$linux}
<p><input type='submit' value=' Выбрать дистрибутив ' /></p>
<p><input type='submit' value=' Выбрать дистрибутив '></p>
</form>
{/if}
 
14,9 → 14,9
{if $status == 1}
<h2>Выбор версии дистрибутива</h2>
<form action='./classic.php' method='get'>
<p><input type='hidden' name='step' value='2' /></p>
<p><input type='hidden' name='step' value='2'></p>
{$version}
<p><input type='submit' value=' Получить sources.list ' /></p>
<p><input type='submit' value=' Получить sources.list '></p>
</form>
{/if}
 
25,6 → 25,6
{/if}
</div>
 
<div id='footer'><a href="http://track.altlug.ru/projects/show/ant">Ant {$antversion}</a></div>
<div id='footer'><a href="http://track.altlug.ru/projects/show/ant">Ant {$antversion}</a>{$interface}</div>
 
{include file="footer.tpl"}
/trunk/templates/header.js.tpl
1,11 → 1,10
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru" lang="ru">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>{$title}</title>
<link rel="stylesheet" type="text/css" href="./css/ant.css" />
<link rel="stylesheet" type="text/css" href="./css/ant.css">
<script type="text/javascript" src="./js/jquery.js"></script>
<script type="text/javascript">
{$scripts}
/trunk/templates/modern.tpl
3,6 → 3,6
 
{$modern}
 
<div id='footer'><a href="http://track.altlug.ru/projects/show/ant">Ant {$antversion}</a></div>
<div id='footer'><a href="http://track.altlug.ru/projects/show/ant">Ant {$antversion}</a>{$interface}</div>
 
{include file="footer.tpl"}
/trunk/get.php
Новый файл
0,0 → 1,79
<?php
 
/**
* Project: Ant: sources.list generator
* File: classic.php
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
 
include "lib/init.php";
$ID = $_GET["id"];
 
list($dist,$vers) = split(",",$ID);
 
if ($ID!='') {
 
$query =& $db->query("SELECT * FROM settings");
$settings = array();
while ($query->fetchInto($setting, DB_FETCHMODE_ASSOC)) {
$settings[stripslashes($setting["opt"])] = stripslashes($setting["optvalue"]);
};
 
$query =& $db->query("SELECT * FROM version v JOIN distribution d ON d.dist_id=v.dist_id JOIN dtype p ON d.disttype=p.type_id WHERE v.dist_id='$dist' AND v.version_id='$vers'");
$query->fetchInto($infodist, DB_FETCHMODE_ASSOC);
 
$query =& $db->query("SELECT * FROM repository r JOIN ver2rep v ON r.rep_id=v.rep_id JOIN version v2 ON v.ver_id=v2.version_id JOIN scheme s ON s.scheme_id=r.scheme_id WHERE v.ver_id='$vers' ORDER BY r.rtype_id, r.scheme_id ASC");
$result = "# Ant: sources.list generator :: http://track.altlug.ru/project/show/ant\n\n";
 
while ($query->fetchInto($resinfo, DB_FETCHMODE_ASSOC)) {
$repscheme = stripslashes($resinfo["scheme"]);
$querysect =& $db->query("SELECT * FROM section s JOIN sect2rep r ON s.sect_id=r.sect_id WHERE
r.rep_id='$resinfo[rep_id]'");
$sections = "";
while ($querysect->fetchInto($section,DB_FETCHMODE_ASSOC)) {
$sections .= stripslashes($section["sectname"])." ";
}
 
$repscheme = str_replace("{TYPE}",stripslashes($infodist["type"]),$repscheme);
$repscheme = str_replace("{PROTO}",$settings["proto"],$repscheme);
$repscheme = str_replace("{URL}",$settings["url"],$repscheme);
$repscheme = str_replace("{REP}",stripslashes($resinfo["repname"]),$repscheme);
$repscheme = str_replace("{DIST}",stripslashes($infodist["vcodename"]),$repscheme);
$repscheme = str_replace("{SECT}",$sections,$repscheme);
$result .= "# ".stripslashes($resinfo["repdescribe"])."\n".$repscheme."\n";
}
 
$HTTPHeader1 = "Content-type: text/plain";
$HTTPHeader2 = "Content-length: ".strlen($result);
$HTTPHeader3 = "Content-disposition: attachment; filename=sources.list\n\n";
 
header($HTTPHeader1);
header($HTTPHeader2);
header($HTTPHeader3);
print $result;
 
} else {
 
header("Location: ./");
 
}
 
?>
/trunk/classic.php
82,10 → 82,10
$repscheme = str_replace("{DIST}",stripslashes($infodist["vcodename"]),$repscheme);
$repscheme = str_replace("{SECT}",$sections,$repscheme);
$result .= $repscheme."\n";
$result .= "# ".stripslashes($resinfo["repdescribe"])."\n".$repscheme."\n";
}
$result .= "</pre>";
$result = $info.$result;
$result = $info.$result."<p><a href='./get.php?id=".$dist.",".$vers."'>Получить sources.list файлом</a></p>";
}
 
$smarty->assign('status',$status);