Хранилища Subversion ant

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

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

/trunk/classic.php
26,7 → 26,14
$dist = $secure->wrapInt($_GET["d"]);
$vers = $secure->wrapInt($_GET["v"]);
$reps = $_GET["r"];
 
$ID = $_GET["id"];
if(isset($ID)){
list($dist,$vers,$repstring) = split(",",$ID);
if(isset($repstring)){
$status=3;
$reps = split("-",$repstring);
}
}
$infomsg = array( _("Step"), _("Next step"), _("Mirror selection"), _("Choosing a distribution"), _("Choosing a version of distribution"), _("Selection of repositories"), _("Get sources.list") );
 
if (!isset($status)) { $status = 0; };
94,11 → 101,12
break;
}
 
if ($status==3){$link='<div class="sllink"><a title="Ссылка на этот source.list" href=./classic.php?id='.$dist.",".$vers.",".$getreps.'>#</a></div>';}
$steps="<a href='classic.php'>".$infomsg[0]." 0</a> ::";
if ($status>0){ $steps .= "<a href='classic.php?step=1&m=".$mirr."'> ".$infomsg[0]." 1</a> ::"; } else { $steps.=" ".$infomsg[0]." 1 ::"; }
if ($status>1){ $steps .= "<a href='classic.php?step=2&m=".$mirr."&d=".$dist."'> ".$infomsg[0]." 2</a> ::"; } else{ $steps.=" ".$infomsg[0]." 2 ::"; }
if ($status>2){ $steps .= "<a href='classic.php?step=3&m=".$mirr."&d=".$dist."&v=".$vers."'> ".$infomsg[0]." 3</a> ::"; } else { $steps.=" ".$infomsg[0]." 3 ::"; }
if ($status>3){ $steps .= "<a href='".$_SERVER["php_self"]."'> ".$infomsg[0]." 4</a>"; } else { $steps.=" ".$infomsg[0]." 4"; }
if ($status>3){ $steps .= "<a href=./classic.php?id='.$dist.','.$vers.','.$getreps.'>' ".$infomsg[0]." 4</a>"; } else { $steps.=" ".$infomsg[0]." 4"; }
 
$smarty->assign('feedaddr',$_SERVER["HTTP_HOST"].dirname($_SERVER["PHP_SELF"]));
$smarty->assign('stepinfo',$infomsg[0]);
/trunk/modern.php
89,12 → 89,18
var distroValue = $('#distro').val();
var versionValue = $('#distver').val();
if (distroValue != 0 && versionValue != 0) {
var repar = $('input.repbox:checked');//.serialize();
repar=repar.serialize(); // fix this shit
$('#replist').css('display','block');
$('#replist').load('./m-process.php?status=3&d='+distroValue+'&v='+versionValue+'&'+repar);
$.get('./m-process.php',{d:distroValue,v:versionValue,status:4},function(data){ $('#getfile').css('display','block'); $('#getfile').html(data); });
} else {
var repar = $('input.repbox:checked');
if(repar.length==0){
$('#replist').css('display','none');
$('#getfile').css('display','none');
}else{
repar=repar.serialize();
$('#replist').css('display','block');
$('#getfile').css('display','block');
$('#replist').load('./m-process.php?status=3&d='+distroValue+'&v='+versionValue+'&'+repar);
$('#getfile').load('./m-process.php?status=4&d='+distroValue+'&v='+versionValue+'&'+repar);
}
} else {
$('#replist').css('display','none');
$('#getfile').css('display','none');
}
121,11 → 127,7
$modern .= "<label>"._("Version of distro")."</label><br>";
$modern .= "<select id='distver' disabled='disabled'><option></option>";
$modern .= "</select></div>";
 
$modern .= "<div id='cboxes'>";
$modern .= "<pre id='reps'></pre>";
$modern .= "</div>";
 
$modern .= "<pre id='replist'></pre>";
$modern .= "<p id='getfile'></p>";
 
/trunk/admin.php
30,7 → 30,7
 
// Admin file/interface
$admin = "./admin.php";
$imgdir = "./themes/icons/".$core->getSetting('icons',$db);
$imgdir = "./themes/icons/".$theme->getIconSetName($core,$db);
 
switch ($err) {
case '1':
898,29 → 898,38
$theme->SetTheme($chtheme,$db);
$theme->setIcon($chicon,$db);
$display.='<p style="color:red;">Тема измененна</p>';
}
$themename = $theme->getThemeName($core,$db); // TODO нарисавать интерфейс поюзабельнее
$display.= '<b>Текущая тема: '.$themename.'</b><br>';
$display.= '<form action="admin.php" method="GET">';
$themename = $theme->getThemeName($core,$db);
$iconsname = $theme->getIconSetName($core,$db);
 
$display.= '<form action="admin.php" method="GET">';
$display.= '<input type="hidden" name="mode" value="23">';
$display.= 'Тема:';
$display.= '<select id="cht" name="chtheme">';
$display.='<table>';
$display.='<tr><td>Текущий стиль:</td><td><b>'.$themename.'</b></td><td>';
$display.= '<select id="cht" name="chtheme">';
$dis=$theme->getThemesList('style');
foreach ($dis as $thm){
$display.= '<option>'.$thm.'</option>';//TODO add 'selected' to theme
if($themename==$thm){
$display.= '<option selected>'.$thm.'</option>';
}else{
$display.= '<option>'.$thm.'</option>';
}
}
$display.= '</select><br>Набор иконок:';
$display.= '</select></td></tr>';
$display.='<tr><td>Текущий набор иконок:</td><td><b>'.$iconsname.'</b></td><td>';
$display.= '<select id="chi" name="chicon">';
$dis=$theme->getThemesList('icon');
foreach ($dis as $thm){
$display.= '<option>'.$thm.'</option>';//TODO add 'selected' to theme
if($iconsname==$thm){
$display.= '<option selected>'.$thm.'</option>';
}else{
$display.= '<option>'.$thm.'</option>';
}
}
$display.= '</select><br>';
$display.= '</select></td></tr></table>';
$display.= '<button type="submit">Сменить тему</button>';
$display.= '</form>';
break;
// }
break;
}
 
/trunk/m-process.php
68,7 → 68,11
$result .= $core->getSourceList($dist,$vers,$reps,$db);
break;
case '4':
$result = "<a href='./get.php?id=".$dist.",".$vers."'>"._("Get sources.list")."</a>";
$repstring=$reps[0];
for($i=1;$i<count($reps);$i++){
$repstring.="-".$reps[$i];
}
$result = "<a href='./get.php?id=".$dist.",".$vers.",".$repstring."'>"._("Get sources.list")."</a>";
break;
}
print $result;
/trunk/get.php
26,14 → 26,15
 
list($dist,$vers,$reps) = split(",",$ID);
 
if ($ID!='') {
if (isset($ID)) {
 
if ($reps!="") {
if (isset($reps)) {
$getreps = array();
$getreps = split("-",$reps);
$result = $core->getSourceList($dist,$vers,$getreps,$db);
} else {
$result = $core->getRepListLegacy($dist,$vers,$db);
$dummyar[0] = "-1";
$result = $core->getSourceList($dist,$vers,$dummyar,$db);
}
 
$HTTPHeader1 = "Content-type: text/plain";
/trunk/lib/core.php
78,39 → 78,6
return $result;
}
// For backward compatibility for Modern interface. Current getRepList() crushed his.
function getRepListLegacy($distro,$version,$dblink) {
$query =& $dblink->query("SELECT * FROM settings");
$settings = array();
while ($query->fetchInto($setting, DB_FETCHMODE_ASSOC)) {
$settings[stripslashes($setting["opt"])] = stripslashes($setting["optvalue"]);
};
$query =& $dblink->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='$distro' AND v.version_id='$version'");
$query->fetchInto($infodist, DB_FETCHMODE_ASSOC);
$query =& $dblink->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 JOIN root r2 ON r2.root_id=r.root_id WHERE v.ver_id='$version' ORDER BY r.rtype_id, r.scheme_id ASC");
while ($query->fetchInto($resinfo, DB_FETCHMODE_ASSOC)) {
$repscheme = stripslashes($resinfo["scheme"]);
$querysect =& $dblink->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);
$repscheme = str_replace("{ROOT}",stripslashes($resinfo["root_folder"]),$repscheme);
$result .= "# ".stripslashes($resinfo["repdescribe"])."\n".$repscheme."\n\n";
}
return $result;
}
 
function getInfo($message,$dblink){
$answer = array();
 
/trunk/lib/theme.php
50,6 → 50,11
if (!file_exists('./themes/styles/'.$result.'/style.css')) $result='default';
return $result;
}
function getIconSetName($link,$dblink) { //TODO remove links
$result=$link->getSetting('icons',$dblink);
if (!file_exists('./themes/icons/'.$result.'/edit.png')) $result='tango';
return $result;
}
function setTheme($newtheme,$dblink){
$req =& $dblink->query("UPDATE settings SET optvalue='$newtheme' WHERE opt='theme'");
}