Хранилища Subversion ant

Редакция

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

Редакция 593 Редакция 594
Строка 1520... Строка 1520...
1520
     *
1520
     *
1521
     * @param string $name
1521
     * @param string $name
1522
     * @param string $actor
1522
     * @param string $actor
1523
     * @return string
1523
     * @return string
1524
     */
1524
     */
1525
    public function showSignsList($name, $actor) {
1525
    public function showSignsList($name, $actor, $format = 'list') {
1526
        $query = "SELECT * FROM ".$this->prefix."signs";
1526
        $query = "SELECT * FROM ".$this->prefix."signs";
1527
        $rq =& $this->db->query($query);
1527
        $rq =& $this->db->query($query);
-
 
1528
        switch ($format) {
-
 
1529
            case 'list':
-
 
1530
                $show = "<ul>\n";
-
 
1531
                while ($rq->fetchInto($element)) {
1528
        $show = "<ul>\n";
1532
                    $show .= "<li>[<a href='".$actor."?mode=".$name."&action=edit&uuid=".$element["sign_id"]."' class='edit'>править</a>][<a href='".$actor."?mode=".$name."&action=delete&uuid=".$element["sign_id"]."' class='delete'>удалить</a>] ".$this->secure->checkStr($element["sname"],1)."</li>\n";
-
 
1533
                }
-
 
1534
                $show .= "</ul>";
-
 
1535
                break;
-
 
1536
            case 'innerhtml':
-
 
1537
                $signID = $this->secure->checkInt($actor);
-
 
1538
                $show  = "<select name='".$name."' id='".$name."'>\n";
-
 
1539
                $show .= "<option value='0'>Подписи нет</option>\n";
1529
        while ($rq->fetchInto($element)) {
1540
                while ($rq->fetchInto($element)) {
-
 
1541
                    if ($element["sign_id"]==$signID) {
-
 
1542
                        $show .= "<option value='".$this->secure->checkInt($element["sign_id"])."' selected>".$this->secure->checkStr($element["sname"],1)."</option>\n";
-
 
1543
                    } else {
-
 
1544
                        $show .= "<option value='".$this->secure->checkInt($element["sign_id"])."'>".$this->secure->checkStr($element["sname"],1)."</option>\n";
-
 
1545
                    }
-
 
1546
                }
-
 
1547
                $show .= "</select>\n";
1530
            $show .= "<li>[<a href='".$actor."?mode=".$name."&action=edit&uuid=".$element["sign_id"]."' class='edit'>править</a>][<a href='".$actor."?mode=".$name."&action=delete&uuid=".$element["sign_id"]."' class='delete'>удалить</a>] ".$this->secure->checkStr($element["sname"],1)."</li>\n";
1548
                break;
1531
        }
1549
        }
1532
        $show .= "</ul>";
-
 
1533
1550
1534
        return $show;
1551
        return $show;
1535
    }
1552
    }
1536
1553
1537
    /**
1554
    /**
Строка 1949... Строка 1966...
1949
     * @param integer $repID
1966
     * @param integer $repID
1950
     * @param string $info
1967
     * @param string $info
1951
     * @param string $reptype
1968
     * @param string $reptype
1952
     * @return string
1969
     * @return string
1953
     */
1970
     */
1954
    public function showRepositoriesForm($repID = 0, $info = "", $reptype = "") {
1971
    public function showRepositoriesForm($repID = 0, $info = "") {
1955
        $sRepID = $this->secure->checkInt($repID);
1972
        $sRepID = $this->secure->checkInt($repID);
1956
        $sInfo  = $this->secure->checkStr($info, 1);
1973
        $sInfo  = $this->secure->checkStr($info, 1);        
1957
        $sRType = $this->secure->checkStr($reptype, 1);
-
 
1958
        if ($sInfo == "") {
1974
        if ($sInfo == "") {
1959
            $sInfo = "Репозиторий";
1975
            $sInfo = "Репозиторий";
1960
        }
1976
        }
1961
        if ($sRType == "") {
-
 
1962
            $sRType = "deb";
-
 
1963
        }
-
 
1964
        if ($sRepID != 0) {
1977
        if ($sRepID != 0) {
1965
            // Режим редактирования
1978
            // Режим редактирования
1966
            $query  = "SELECT r.*,v.*,d.dist_id,dt.type FROM ".$this->prefix."repository r ";
1979
            $query  = "SELECT r.*,v.*,d.dist_id,dt.type FROM ".$this->prefix."repository r ";
1967
            $query .= "JOIN ".$this->prefix."version v ON r.version=v.version_id ";
1980
            $query .= "JOIN ".$this->prefix."version v ON r.version=v.version_id ";
1968
            $query .= "JOIN ".$this->prefix."distribution d ON v.dist_id=d.dist_id ";
1981
            $query .= "JOIN ".$this->prefix."distribution d ON v.dist_id=d.dist_id ";
1969
            $query .= "JOIN ".$this->prefix."dtype dt ON d.disttype=dt.type_id ";
1982
            $query .= "JOIN ".$this->prefix."dtype dt ON d.disttype=dt.type_id ";
1970
            $query .= "WHERE r.rep_id='".$sRepID."'";
1983
            $query .= "WHERE r.rep_id='".$sRepID."'";
1971
            $rq =& $this->db->query($query);
1984
            $rq =& $this->db->query($query);
1972
            $rq->fetchInto($element);
1985
            $rq->fetchInto($element);            
1973
            $sRType = $this->secure->checkStr($element["type"],1);
-
 
1974
        }
1986
        }
1975
1987
1976
        $show  = "<fieldset><legend>".$sInfo."</legend>\n";
1988
        $show  = "<fieldset><legend>".$sInfo."</legend>\n";        
1977
        $show .= "<input type='hidden' name='rtype' value='".$sRType."'>";
-
 
1978
        $show .= "<div class='inputbox'><label for='rdist'>Дистрибутив:</label> ".$this->showVDList("rdist",$this->secure->checkInt($element["dist_id"]),"innerhtml")."</div>\n";
1989
        $show .= "<div class='inputbox'><label for='rdist'>Дистрибутив:</label> ".$this->showVDList("rdist",$this->secure->checkInt($element["dist_id"]),"innerhtml")."</div>\n";
1979
        $show .= "<div class='inputbox'><label for='rname'>Название репозитория:</label> <input type='text' name='rname' value='".$this->secure->checkStr($element["repname"],1)."'></div>\n";
1990
        $show .= "<div class='inputbox'><label for='rname'>Название репозитория:</label> <input type='text' name='rname' value='".$this->secure->checkStr($element["repname"],1)."'></div>\n";
1980
        $show .= "<div class='inputbox'><label for='rinfo'>Описание репозитория:</label> <input type='text' name='rinfo' value='".$this->secure->checkStr($element["repinfo"],1)."'></div>\n";
1991
        $show .= "<div class='inputbox'><label for='rinfo'>Описание репозитория:</label> <input type='text' name='rinfo' value='".$this->secure->checkStr($element["repinfo"],1)."'></div>\n";
1981
        $show .= "<div class='inputbox'><label for='rkey'>Ключ подписи репозитория:</label> <input type='text' name='rkey' value='".$this->secure->checkStr($element["repkey"],1)."'></div>\n";
1992
        $show .= "<div class='inputbox'><label for='rkey'>Ключ подписи репозитория:</label> <input type='text' name='rkey' value='".$this->secure->checkStr($element["repkey"],1)."'></div>\n";
1982
        $show .= "<div class='inputbox'><label for='rproto'>Протокол доступа:</label> ".$this->showProtoList("rproto",$this->secure->checkInt($element["proto_id"]),"innerhtml")."</div>\n";
1993
        $show .= "<div class='inputbox'><label for='rproto'>Протокол доступа:</label> ".$this->showProtoList("rproto",$this->secure->checkInt($element["proto_id"]),"innerhtml")."</div>\n";
Строка 1984... Строка 1995...
1984
        $show .= "<div class='inputbox'><label for='rfolder'>Корневая папка:</label> ".$this->showFoldersList("rhost",$this->secure->checkInt($element["rfolder_id"]),"innerhtml")."</div>\n";
1995
        $show .= "<div class='inputbox'><label for='rfolder'>Корневая папка:</label> ".$this->showFoldersList("rhost",$this->secure->checkInt($element["rfolder_id"]),"innerhtml")."</div>\n";
1985
        $show .= "<div class='inputbox'><label for='rtype'>Тип репозитория:</label> ".$this->showRepType($this->secure->checkInt($element["rtype_id"]), "rtype")."</div>\n";
1996
        $show .= "<div class='inputbox'><label for='rtype'>Тип репозитория:</label> ".$this->showRepType($this->secure->checkInt($element["rtype_id"]), "rtype")."</div>\n";
1986
        $show .= "<div class='inputbox'><label for='rsects'>Секции репозитория:</label> <div class='formwrapper'>".$this->showSectionsList("rsects",$sRepID,"innerhtml")."</div></div>\n";
1997
        $show .= "<div class='inputbox'><label for='rsects'>Секции репозитория:</label> <div class='formwrapper'>".$this->showSectionsList("rsects",$sRepID,"innerhtml")."</div></div>\n";
1987
        $show .= "<div class='inputbox'><label for='rarchs'>Архитектуры:</label> <div class='formwrapper'>".$this->showArchList("rarchs",$sRepID,"innerhtml")."</div></div>\n";
1998
        $show .= "<div class='inputbox'><label for='rarchs'>Архитектуры:</label> <div class='formwrapper'>".$this->showArchList("rarchs",$sRepID,"innerhtml")."</div></div>\n";
1988
        $show .= "<div class='inputbox'><label for='rscheme'>Схема репозитория:</label> ".$this->showSchemeList("rscheme",$sRepID,"innerhtml")."</div>\n";
1999
        $show .= "<div class='inputbox'><label for='rscheme'>Схема репозитория:</label> ".$this->showSchemeList("rscheme",$sRepID,"innerhtml")."</div>\n";
-
 
2000
        $show .= "<div class='inputbox'><label for='rsign'>Подпись репозитория:</label> ".$this->showSignsList("rsign",$sRepID,"innerhtml")."</div>\n";
1989
        $show .= "<div class='inputbox'><input type='submit' value=' Отправить данные '></div></fieldset>\n";
2001
        $show .= "<div class='inputbox'><input type='submit' value=' Отправить данные '></div></fieldset>\n";
1990
       
2002
       
1991
        return $show;
2003
        return $show;
1992
    }
2004
    }
1993
   
2005