Хранилища Subversion ant

Редакция

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

<?php

/**
 * Project:     Ant: sources.list generator
 * File:        m-process.php
 *
 * This application 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 application 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
 *
 */



require_once dirname(__FILE__)."/lib/init.php";
$dist   = $secure->wrapInt($_GET["d"]);
$vers   = $secure->wrapInt($_GET["v"]);
$status = $secure->wrapInt($_GET["status"]);
$reps   = $_GET["r"];

header('Content-Type: text/html; charset=utf-8');
//if($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {

        // hacks for Konqueror's error on jQuery
        if (preg_match("/konqueror/i",$_SERVER["HTTP_USER_AGENT"])) {
                $dist_konq = $secure->wrapStr($_GET["d"]);
                $query =& $db->query("SELECT * FROM distribution WHERE distname LIKE '$dist_konq'");
                $query->fetchInto($distro, DB_FETCHMODE_ASSOC);
                $dist = $distro["dist_id"];
        };


        switch($status) {
                case '1':

                        $result = '[{value:"",text:"'._("Choose version of distro").'"}';
                        $query =& $db->query("SELECT * FROM version v JOIN distribution d ON d.dist_id=v.dist_id WHERE v.dist_id='$dist'");
                        while ($query->fetchInto($version, DB_FETCHMODE_ASSOC)) {
                                if ($version["vname"]!="") {
                                        $distname = $secure->stripStr($version["vname"]);
                                } else {
                                        $distname = "";
                                }
                                $result .= ',{value:"'.$version["version_id"].'",text:"'.$secure->stripStr($version["version"]).' '.$distname.'"}';
                        }
                        $result .= ']';
                        break;
                case '2':
                        $result="<form action='#' method='get'>";
                        $repodata=$core->getRepList($dist,$vers,$db);
                        for($i=0;$i<count($repodata[0]);$i++) {
                          if ($repodata[3][$i]==true){$ch="checked";} else{$ch="";}
                          $result.="<input type='checkbox' ".$ch." class='repbox' name='r[]' value='".$repodata[0][$i]."'>".$repodata[1][$i]." <em>(".$repodata[2][$i].")</em><br>";
                        }
                        $result.="</form>";
                        break;
                case '3':
                        $result = "# Ant: sources.list generator :: http://track.altlug.ru/projects/show/ant\n\n";
                        $result .= $core->getSourceList($dist,$vers,$reps,$db);
                        break;
                case '4':
                        $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;
//}
?>