Хранилища Subversion ant

Редакция

Редакция 143 | Только различия | Не учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS

Редакция 143 Редакция 145
1
<?php
1
<?php
2
2
3
/**
3
/**
4
 * Project:     Ant: sources.list generator
4
 * Project:     Ant: sources.list generator
5
 * File:        classic.php
5
 * File:        classic.php
6
 *
6
 *
7
 * This application is free software; you can redistribute it and/or
7
 * This application is free software; you can redistribute it and/or
8
 * modify it under the terms of the GNU Lesser General Public
8
 * modify it under the terms of the GNU Lesser General Public
9
 * License as published by the Free Software Foundation; either
9
 * License as published by the Free Software Foundation; either
10
 * version 2.1 of the License, or (at your option) any later version.
10
 * version 2.1 of the License, or (at your option) any later version.
11
 *
11
 *
12
 * This application is distributed in the hope that it will be useful,
12
 * This application is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
 * Lesser General Public License for more details.
15
 * Lesser General Public License for more details.
16
 *
16
 *
17
 * You should have received a copy of the GNU Lesser General Public
17
 * You should have received a copy of the GNU Lesser General Public
18
 * License along with this library; if not, write to the Free Software
18
 * License along with this library; if not, write to the Free Software
19
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
 *
20
 *
21
 */
21
 */
22
22
23
23
24
require_once dirname(__FILE__)."/lib/init.php";
24
require_once dirname(__FILE__)."/lib/init.php";
25
$status = abs(intval($_GET["step"]));
25
$status = abs(intval($_GET["step"]));
26
$dist   = abs(intval($_GET["d"]));
26
$dist   = abs(intval($_GET["d"]));
27
$vers   = abs(intval($_GET["v"]));
27
$vers   = abs(intval($_GET["v"]));
28
28
29
$query =& $db->query("SELECT * FROM distribution");
29
$query =& $db->query("SELECT * FROM distribution");
30
while ($query->fetchInto($data, DB_FETCHMODE_ASSOC)) {
30
while ($query->fetchInto($data, DB_FETCHMODE_ASSOC)) {
31
        $linux .= "<p><input type='radio' name='d' value='".$data["dist_id"]."'><span class='".stripslashes($data["distua"])."'>".stripslashes($data["distname"])."</span></p>\n";
31
        $linux .= "<p><input type='radio' name='d' value='".$data["dist_id"]."'><span class='".stripslashes($data["distua"])."'>".stripslashes($data["distname"])."</span></p>\n";
32
}
32
}
33
33
34
if (!isset($status)) { $status = 0; };
34
if (!isset($status)) { $status = 0; };
35
35
36
if (isset($dist)) {
36
if (isset($dist)) {
37
        $query =& $db->query("SELECT * FROM version v JOIN distribution d ON d.dist_id=v.dist_id WHERE v.dist_id='$dist'");
37
        $query =& $db->query("SELECT * FROM version v JOIN distribution d ON d.dist_id=v.dist_id WHERE v.dist_id='$dist'");
38
        $distvers = "<p><input type='hidden' name='d' value='".$dist."'></p>\n";
38
        $distvers = "<p><input type='hidden' name='d' value='".$dist."'></p>\n";
39
        while ($query->fetchInto($version, DB_FETCHMODE_ASSOC)) {
39
        while ($query->fetchInto($version, DB_FETCHMODE_ASSOC)) {
40
                if ($version["vname"]!="") {
40
                if ($version["vname"]!="") {
41
                        $distname = "&#8220;".stripslashes($version["vname"])."&#8221;";
41
                        $distname = "&#8220;".stripslashes($version["vname"])."&#8221;";
42
                } else {
42
                } else {
43
                        $distname = "";
43
                        $distname = "";
44
                }
44
                }
45
                $distvers .= "<p><input type='radio' name='v' value='".$version["version_id"]."' /><span class='".stripslashes($version["distua"])."'>".stripslashes($version["distname"])." ".stripslashes($version["version"])." ".$distname."</span></p>\n";
45
                $distvers .= "<p><input type='radio' name='v' value='".$version["version_id"]."' /><span class='".stripslashes($version["distua"])."'>".stripslashes($version["distname"])." ".stripslashes($version["version"])." ".$distname."</span></p>\n";
46
        }
46
        }
47
}
47
}
48
48
49
if (isset($vers)) {
49
if (isset($vers)) {
50
        $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'");
50
        $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'");
51
        $query->fetchInto($infodist, DB_FETCHMODE_ASSOC);
51
        $query->fetchInto($infodist, DB_FETCHMODE_ASSOC);
52
        $distname = "";
52
        $distname = "";
53
        if ($infodist["vname"]!="") {
53
        if ($infodist["vname"]!="") {
54
                $distname = "&#8220;".stripslashes($infodist["vname"])."&#8221;";
54
                $distname = "&#8220;".stripslashes($infodist["vname"])."&#8221;";
55
        }
55
        }
56
        $info = "<h2>Доступные репозитории для <em class='".stripslashes($infodist["distua"])."-em'>".stripslashes($infodist["distname"])." ".stripslashes($infodist["version"])." ".$distname."</em></h2>";
56
        $info = "<h2>Доступные репозитории для <em class='".stripslashes($infodist["distua"])."-em'>".stripslashes($infodist["distname"])." ".stripslashes($infodist["version"])." ".$distname."</em></h2>";
57
        $result = "<p>Скопируйте эти строки в файл <span id='sourceslist'>/etc/apt/sources.list</span>:</p><pre>";
57
        $result = "<p>Скопируйте эти строки в файл <span id='sourceslist'>/etc/apt/sources.list</span>:</p><pre>";
58
        $result .= $core->getRepList($dist,$vers,$db);
58
        $result .= $core->getRepList($dist,$vers,$db);
59
        $result .= "</pre>";
59
        $result .= "</pre>";
60
        $result = $info.$result."<p><a href='./get.php?id=".$dist.",".$vers."'>Получить sources.list файлом</a></p>";
60
        $result = $info.$result."<p><a href='./get.php?id=".$dist.",".$vers."'>Получить sources.list файлом</a></p>";
61
}
61
}
62
62
63
$smarty->assign('feedaddr',$_SERVER["HTTP_HOST"].dirname($_SERVER["PHP_SELF"]));
63
$smarty->assign('feedaddr',$_SERVER["HTTP_HOST"].dirname($_SERVER["PHP_SELF"]));
64
$smarty->assign('status',$status);
64
$smarty->assign('status',$status);
65
$smarty->assign('linux',$linux);
65
$smarty->assign('linux',$linux);
66
$smarty->assign('version',$distvers);
66
$smarty->assign('version',$distvers);
67
$smarty->assign('result',$result);
67
$smarty->assign('result',$result);
68
$smarty->assign('antversion',$core->getSetting('version',$db));
68
$smarty->assign('antversion',$core->getSetting('version',$db));
69
$smarty->assign('title',$core->getSetting('codename',$db));
69
$smarty->assign('title',$core->getSetting('codename',$db));
70
$smarty->assign('interface'," &bull; <a href='./changelog.php'>Изменения</a> &bull; ".$core->getInterfacesList($_SERVER["REQUEST_URI"],$db));
70
$smarty->assign('interface'," &bull; <a href='./changelog.php'>Изменения</a> &bull; ".$core->getInterfacesList($_SERVER["REQUEST_URI"],$db));
71
$smarty->assign('style',$core->getCSSList($db));
71
$smarty->assign('style',$core->getCSSList($db));
72
72
73
$smarty->display('classic.tpl');
73
$smarty->display('classic.tpl');
74
74
75
?>
75
?>
76
 
76