26,48 → 26,17 |
$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(!empty($dist)){$status=1;}; |
if(!empty($vers)){$status=2;}; |
if(!empty($repstring)){ |
$status=4; |
$reps = split("-",$repstring); |
}; |
}elseif(!empty($dist)){ |
$location="./classic.php?id=".$dist; |
if(!empty($vers)){$location.=",".$vers;} |
if(!empty($reps)){ |
for ($i=0;$i<count($reps);$i++) { |
$shortreps .= $reps[$i]; |
if ($i<count($reps)-1) { |
$shortreps .= "-"; |
} |
} |
$location.=",".$shortreps; |
} |
header("Location: ".$location); |
exit; |
|
$query =& $db->query("SELECT * FROM distribution"); |
while ($query->fetchInto($data, DB_FETCHMODE_ASSOC)) { |
$linux .= "<p><input type='radio' name='d' value='".$data["dist_id"]."'><span class='".$secure->stripStr($data["distua"])."'>".$secure->stripStr($data["distname"])."</span></p>\n"; |
} |
$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; }; |
|
switch ($status) { |
case 0: |
// Выбор дистрибутива |
$query =& $db->query("SELECT * FROM distribution"); |
$linux .= "<input type='hidden' name='m' value='".$mirror."'>"; |
while ($query->fetchInto($data, DB_FETCHMODE_ASSOC)) { |
$linux .= "<p><input type='radio' name='d' value='".$data["dist_id"]."'><span class='".$secure->stripStr($data["distua"])."'>".$secure->stripStr($data["distname"])."</span></p>\n"; |
} |
break; |
case 1: |
// Выбор версии |
if (isset($dist)) { |
$query =& $db->query("SELECT * FROM version v JOIN distribution d ON d.dist_id=v.dist_id WHERE v.dist_id='$dist'"); |
$distvers = "<input type='hidden' name='m' value='".$mirror."'>"; |
$distvers .= "<p><input type='hidden' name='d' value='".$dist."'></p>\n"; |
$distvers = "<p><input type='hidden' name='d' value='".$dist."'></p>\n"; |
while ($query->fetchInto($version, DB_FETCHMODE_ASSOC)) { |
if ($version["vname"]!="") { |
$distname = "“".$secure->stripStr($version["vname"])."”"; |
75,54 → 44,51 |
$distname = ""; |
} |
$distvers .= "<p><input type='radio' name='v' value='".$version["version_id"]."' /><span class='".$secure->stripStr($version["distua"])."'>".$secure->stripStr($version["distname"])." ".$secure->stripStr($version["version"])." ".$distname."</span></p>\n"; |
} break; |
case 2; |
// Выбор репозиториев |
$repos = "<input type='hidden' name='m' value='".$mirror."'>"; |
} |
} |
|
if ($status==2) |
{ |
$repos = ""; |
$repodata=$core->getRepList($dist,$vers,$db); |
$repos.="<input type='hidden' name='d' value='".$dist."'><input type='hidden' name='v' value='".$vers."'>"; |
for($i=0;$i<count($repodata[0]);$i++) { |
if ($repodata[3][$i]==true){$ch="checked";} else{$ch="";} |
$repos.="<input type='checkbox' name='r[]' ".$ch." value='".$repodata[0][$i]."'>".$repodata[1][$i]." <em>(".$repodata[2][$i].")</em><br>"; |
}; |
$steps .= "<a href='classic.php?step='".$status."'&d='".$dist."'> ".$info[0]." ".$status."</a> ::"; |
break; |
case 3; |
// Получение sources.list |
for($i=0;$i<count($repodata[0]);$i++) { |
$repos.="<input type='hidden' name='d' value='".$dist."'><input type='hidden' name='v' value='".$vers."'>"; |
if ($repodata[3][$i]==true){$ch="checked";} else{$ch="";} |
$repos.="<input type='checkbox' name='r[]' ".$ch." value='".$repodata[0][$i]."'>".$repodata[1][$i]." <em>(".$repodata[2][$i].")</em><br>"; |
}; |
} |
|
if ($status==3) { |
$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); |
|
|
$distname = ""; |
if ($infodist["vname"]!="") { |
$distname = "“".$secure->stripStr($infodist["vname"])."”"; |
} |
$info = "<h2>"._("Repositories for")." <em class='".$secure->stripStr($infodist["distua"])."-em'>".$secure->stripStr($infodist["distname"])." ".$secure->stripStr($infodist["version"])." ".$distname."</em></h2>"; |
$result = "<p>"._("Copy this strings into file")." <span id='sourceslist'>/etc/apt/sources.list</span>:</p><pre>"; |
$result .= $core->getSourceList($dist,$vers,$reps,$db); |
$result .= "</pre>"; |
$result = $info.$result."<p><a href='./get.php?id=".$dist.",".$vers.",".$repstring."'>".$infomsg[6]."</a></p>"; |
|
$link="<div class='sllink'><a title='"._("Link to this sources.list")."' href=./classic.php?id=".$mirror.",".$dist.",".$vers.",".$repstring.">#</a></div>"; |
break; |
$info = "<h2>Репозитории для <em class='".$secure->stripStr($infodist["distua"])."-em'>".$secure->stripStr($infodist["distname"])." ".$secure->stripStr($infodist["version"])." ".$distname."</em></h2>"; |
$result = "<p>Скопируйте эти строки в файл <span id='sourceslist'>/etc/apt/sources.list</span>:</p><pre>"; |
$result .= $core->getSourceList($dist,$vers,$reps,$db); |
$result .= "</pre>"; |
for ($i=0;$i<count($reps);$i++) { |
$getreps .= $reps[$i]; |
if ($i<count($reps)-1) { |
$getreps .= "-"; |
} |
} |
$result = $info.$result."<p><a href='./get.php?id=".$dist.",".$vers.",".$getreps."'>Получить sources.list файлом</a></p>"; |
} |
|
if ($status==3){$link='<div class="sllink"><a title="Ссылка на этот source.list" href=./classic.php?id='.$dist.",".$vers.",".$repstring.'>#</a></div>';} |
$steps="<a href='classic.php'>".$infomsg[0]." 1</a> ::"; |
if ($status>0){ $steps .= "<a href='classic.php?id=".$dist."'> ".$infomsg[0]." 2</a> ::"; } else { $steps.=" ".$infomsg[0]." 2 ::"; } |
if ($status>1){ $steps .= "<a href='classic.php?id=".$dist.",".$vers."'> ".$infomsg[0]." 3</a> ::"; } else{ $steps.=" ".$infomsg[0]." 3 ::"; } |
if ($status>2){ $steps .= '<a href=./classic.php?id='.$dist.','.$vers.','.$repstring.'>'.$infomsg[0].' 4</a>'; } else { $steps.=" ".$infomsg[0]." 4"; } |
if ($status==3){$link='<div class="sllink"><a title="Ссылка на этот source.list" href='.$_SERVER['php_self'].'>#</a></div>';} |
$steps='<a href="classic.php">Шаг 1</a> ::'; |
if ($status>0){ $steps.='<a href="classic.php?step=1&d='.$dist.'"> Шаг 2</a> ::';} else{$steps.=' Шаг 2 ::';} |
if ($status>1){ $steps.='<a href="classic.php?step=2&d='.$dist.'&v='.$vers.'"> Шаг 3</a> ::';} else{$steps.=' Шаг 3 ::';} |
if ($status==3){ $steps.='<a href="'.$_SERVER['php_self'].'"> Шаг 4</a>';} else{$steps.=' Шаг 4';} |
|
$smarty->assign('feedaddr',$_SERVER["HTTP_HOST"].dirname($_SERVER["PHP_SELF"])); |
$smarty->assign('stepinfo',$infomsg[0]); |
$smarty->assign('nextstep',$infomsg[1]); |
$smarty->assign('distrochoose',$infomsg[3]); |
$smarty->assign('distrovchoose',$infomsg[4]); |
$smarty->assign('repselect',$infomsg[5]); |
$smarty->assign('getsourceslist',$infomsg[6]); |
$smarty->assign('link',$link); |
$smarty->assign('status',$status); |
$smarty->assign('linux',$linux); |
$smarty->assign('mirrors',$mirrors); |
$smarty->assign('steps',$steps); |
$smarty->assign('repos',$repos); |
$smarty->assign('version',$distvers); |
129,9 → 95,8 |
$smarty->assign('result',$result); |
$smarty->assign('antversion',$core->getSetting('version',$db)); |
$smarty->assign('title',$core->getSetting('codename',$db)); |
$smarty->assign('interface'," • <a href='./changelog.php'>"._("Changes")."</a> • ".$core->getInterfacesList($_SERVER["REQUEST_URI"],$db)); |
$smarty->assign('interface'," • <a href='./changelog.php'>Изменения</a> • ".$core->getInterfacesList($_SERVER["REQUEST_URI"],$db)); |
$smarty->assign('style',$core->getCSSList($db)); |
$smarty->assign('theme',$theme->getThemeName($core,$db)); |
|
$smarty->display('classic.tpl'); |
|