Хранилища Subversion ant

Сравнить редакции

Не учитывать пробелы Редакция 593 → Редакция 594

/branches/ant/0.9.x/lib/core.php
1522,14 → 1522,31
* @param string $actor
* @return string
*/
public function showSignsList($name, $actor) {
public function showSignsList($name, $actor, $format = 'list') {
$query = "SELECT * FROM ".$this->prefix."signs";
$rq =& $this->db->query($query);
$show = "<ul>\n";
while ($rq->fetchInto($element)) {
$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";
switch ($format) {
case 'list':
$show = "<ul>\n";
while ($rq->fetchInto($element)) {
$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";
}
$show .= "</ul>";
break;
case 'innerhtml':
$signID = $this->secure->checkInt($actor);
$show = "<select name='".$name."' id='".$name."'>\n";
$show .= "<option value='0'>Подписи нет</option>\n";
while ($rq->fetchInto($element)) {
if ($element["sign_id"]==$signID) {
$show .= "<option value='".$this->secure->checkInt($element["sign_id"])."' selected>".$this->secure->checkStr($element["sname"],1)."</option>\n";
} else {
$show .= "<option value='".$this->secure->checkInt($element["sign_id"])."'>".$this->secure->checkStr($element["sname"],1)."</option>\n";
}
}
$show .= "</select>\n";
break;
}
$show .= "</ul>";
 
return $show;
}
1951,16 → 1968,12
* @param string $reptype
* @return string
*/
public function showRepositoriesForm($repID = 0, $info = "", $reptype = "") {
public function showRepositoriesForm($repID = 0, $info = "") {
$sRepID = $this->secure->checkInt($repID);
$sInfo = $this->secure->checkStr($info, 1);
$sRType = $this->secure->checkStr($reptype, 1);
$sInfo = $this->secure->checkStr($info, 1);
if ($sInfo == "") {
$sInfo = "Репозиторий";
}
if ($sRType == "") {
$sRType = "deb";
}
if ($sRepID != 0) {
// Режим редактирования
$query = "SELECT r.*,v.*,d.dist_id,dt.type FROM ".$this->prefix."repository r ";
1969,12 → 1982,10
$query .= "JOIN ".$this->prefix."dtype dt ON d.disttype=dt.type_id ";
$query .= "WHERE r.rep_id='".$sRepID."'";
$rq =& $this->db->query($query);
$rq->fetchInto($element);
$sRType = $this->secure->checkStr($element["type"],1);
$rq->fetchInto($element);
}
 
$show = "<fieldset><legend>".$sInfo."</legend>\n";
$show .= "<input type='hidden' name='rtype' value='".$sRType."'>";
$show = "<fieldset><legend>".$sInfo."</legend>\n";
$show .= "<div class='inputbox'><label for='rdist'>Дистрибутив:</label> ".$this->showVDList("rdist",$this->secure->checkInt($element["dist_id"]),"innerhtml")."</div>\n";
$show .= "<div class='inputbox'><label for='rname'>Название репозитория:</label> <input type='text' name='rname' value='".$this->secure->checkStr($element["repname"],1)."'></div>\n";
$show .= "<div class='inputbox'><label for='rinfo'>Описание репозитория:</label> <input type='text' name='rinfo' value='".$this->secure->checkStr($element["repinfo"],1)."'></div>\n";
1986,6 → 1997,7
$show .= "<div class='inputbox'><label for='rsects'>Секции репозитория:</label> <div class='formwrapper'>".$this->showSectionsList("rsects",$sRepID,"innerhtml")."</div></div>\n";
$show .= "<div class='inputbox'><label for='rarchs'>Архитектуры:</label> <div class='formwrapper'>".$this->showArchList("rarchs",$sRepID,"innerhtml")."</div></div>\n";
$show .= "<div class='inputbox'><label for='rscheme'>Схема репозитория:</label> ".$this->showSchemeList("rscheme",$sRepID,"innerhtml")."</div>\n";
$show .= "<div class='inputbox'><label for='rsign'>Подпись репозитория:</label> ".$this->showSignsList("rsign",$sRepID,"innerhtml")."</div>\n";
$show .= "<div class='inputbox'><input type='submit' value=' Отправить данные '></div></fieldset>\n";
return $show;