Хранилища Subversion ant

Редакция

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

Редакция 560 Редакция 561
Строка 598... Строка 598...
598
     * @author Alexander Wolf
598
     * @author Alexander Wolf
599
     * @category Core
599
     * @category Core
600
     *
600
     *
601
     * @param string $name
601
     * @param string $name
602
     * @param string $actor
602
     * @param string $actor
-
 
603
     * @param string $format
603
     * @return string
604
     * @return string
604
     */
605
     */
605
    public function showSectionsList($name, $actor, $format = 'html') {
606
    public function showSectionsList($name, $actor, $format = 'html') {
606
        $query = "SELECT * FROM ".$this->prefix."section";
-
 
607
        $rq =& $this->db->query($query);
-
 
608
        switch($format) {
607
        switch($format) {
609
            case 'html':
608
            case 'html':
-
 
609
                $query = "SELECT * FROM ".$this->prefix."section";
-
 
610
                $rq =& $this->db->query($query);
610
                $show = "<ul>\n";
611
                $show = "<ul>\n";
611
                while ($rq->fetchInto($element)) {
612
                while ($rq->fetchInto($element)) {
612
                    $show .= "<li>[<a href='".$actor."?mode=".$name."&action=edit&uuid=".$element["sect_id"]."' class='edit'>править</a>][<a href='".$actor."?mode=".$name."&action=delete&uuid=".$element["sect_id"]."' class='delete'>удалить</a>] ".$this->secure->checkStr($element["secname"],1)."</li>\n";
613
                    $show .= "<li>[<a href='".$actor."?mode=".$name."&action=edit&uuid=".$element["sect_id"]."' class='edit'>править</a>][<a href='".$actor."?mode=".$name."&action=delete&uuid=".$element["sect_id"]."' class='delete'>удалить</a>] ".$this->secure->checkStr($element["secname"],1)."</li>\n";
613
                }
614
                }
614
                $show .= "</ul>";
615
                $show .= "</ul>";
615
                break;
616
                break;
616
            case 'innerhtml':
617
            case 'innerhtml':
617
                $show = "";
618
                $show = "";
-
 
619
                $repID = $this->secure->checkInt($actor);
-
 
620
                if ($repID==0) {
-
 
621
                    $query = "SELECT * FROM ".$this->prefix."section";
-
 
622
                    $rq =& $this->db->query($query);
618
                while ($rq->fetchInto($element)) {
623
                    while ($rq->fetchInto($element)) {
-
 
624
                        $show .= "<input type='checkbox' name='".$name."[]' value='".$element["sect_id"]."'> ".$this->secure->checkStr($element["secname"],1)." ";
-
 
625
                    }
-
 
626
                } else {
-
 
627
                    $query = "SELECT * FROM ".$this->prefix."section s JOIN ".$this->prefix."sect2rep r ON s.sect_id=r.sect_id WHERE r.rep_id='$repID'";
-
 
628
                    $rq =& $this->db->query($query);
-
 
629
                    while ($rq->fetchInto($element)) {
-
 
630
                        $show .= "<input type='checkbox' name='".$name."[]' value='".$element["sect_id"]."' checked> ".$this->secure->checkStr($element["secname"],1)." ";
-
 
631
                    }
-
 
632
                    $query = "SELECT s.* FROM ".$this->prefix."section s WHERE s.sect_id NOT IN (SELECT sect_id FROM ".$this->prefix."sect2rep WHERE rep_id='$repID')";
-
 
633
                    while ($rq->fetchInto($element)) {
619
                    $show .= "<input type='checkbox' name='".$name."[]' value='".$element["sect_id"]."'> ".$this->secure->checkStr($element["secname"],1)." ";
634
                        $show .= "<input type='checkbox' name='".$name."[]' value='".$element["sect_id"]."'> ".$this->secure->checkStr($element["secname"],1)." ";
-
 
635
                    }
620
                }                
636
                }
-
 
637
621
                break;
638
                break;
622
        }
639
        }
623
640
624
        return $show;
641
        return $show;
625
    }
642
    }
626
643
-
 
644
627
    /**
645
    /**
628
     * Вывод формы редактирования/добавления секций
646
     * Вывод формы редактирования/добавления секций
629
     *
647
     *
630
     * @author Alexander Wolf
648
     * @author Alexander Wolf
631
     * @category Core
649
     * @category Core
Строка 1192... Строка 1210...
1192
        $show .= "<div class='inputbox'><label for='rkey'>Ключ подписи репозитория:</label> <input type='text' name='rkey' value='".$this->secure->checkStr($element["repkey"],1)."'></div>\n";
1210
        $show .= "<div class='inputbox'><label for='rkey'>Ключ подписи репозитория:</label> <input type='text' name='rkey' value='".$this->secure->checkStr($element["repkey"],1)."'></div>\n";
1193
        $show .= "<div class='inputbox'><label for='rproto'>Протокол доступа:</label> <input type='text' name='rproto' value='".$this->secure->checkStr($element["proto"],1)."'></div>\n";
1211
        $show .= "<div class='inputbox'><label for='rproto'>Протокол доступа:</label> <input type='text' name='rproto' value='".$this->secure->checkStr($element["proto"],1)."'></div>\n";
1194
        $show .= "<div class='inputbox'><label for='rhost'>Хост репозитория:</label> <input type='text' name='rhost' value='".$this->secure->checkStr($element["rhost"],1)."'></div>\n";
1212
        $show .= "<div class='inputbox'><label for='rhost'>Хост репозитория:</label> <input type='text' name='rhost' value='".$this->secure->checkStr($element["rhost"],1)."'></div>\n";
1195
        $show .= "<div class='inputbox'><label for='rfolder'>Корневая папка:</label> <input type='text' name='rfolder' value='".$this->secure->checkStr($element["rfolder"],1)."'></div>\n";
1213
        $show .= "<div class='inputbox'><label for='rfolder'>Корневая папка:</label> <input type='text' name='rfolder' value='".$this->secure->checkStr($element["rfolder"],1)."'></div>\n";
1196
        $show .= "<div class='inputbox'><label for='rtype'>Тип репозитория:</label> ".$this->showRepType($this->secure->checkInt($element["rtype_id"]), "rtype")."</div>\n";
1214
        $show .= "<div class='inputbox'><label for='rtype'>Тип репозитория:</label> ".$this->showRepType($this->secure->checkInt($element["rtype_id"]), "rtype")."</div>\n";
1197
        $show .= "<div class='inputbox'><label for='rsects'>Секции репозитория:</label> ".$this->showSectionsList("rsects","","innerhtml")."</div>\n";
1215
        $show .= "<div class='inputbox'><label for='rsects'>Секции репозитория:</label> ".$this->showSectionsList("rsects",0,"innerhtml")."</div>\n";
1198
        $show .= "<div class='inputbox'><input type='submit' value=' Отправить данные '></div></fieldset>\n";
1216
        $show .= "<div class='inputbox'><input type='submit' value=' Отправить данные '></div></fieldset>\n";
1199
1217
1200
        return $show;
1218
        return $show;
1201
        return $show;
1219
        return $show;
1202
    }
1220
    }