Хранилища Subversion ant

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

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

/branches/ant/0.9.x/lib/core.php
600,13 → 600,14
*
* @param string $name
* @param string $actor
* @param string $format
* @return string
*/
public function showSectionsList($name, $actor, $format = 'html') {
$query = "SELECT * FROM ".$this->prefix."section";
$rq =& $this->db->query($query);
switch($format) {
case 'html':
$query = "SELECT * FROM ".$this->prefix."section";
$rq =& $this->db->query($query);
$show = "<ul>\n";
while ($rq->fetchInto($element)) {
$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";
615,9 → 616,25
break;
case 'innerhtml':
$show = "";
while ($rq->fetchInto($element)) {
$show .= "<input type='checkbox' name='".$name."[]' value='".$element["sect_id"]."'> ".$this->secure->checkStr($element["secname"],1)." ";
}
$repID = $this->secure->checkInt($actor);
if ($repID==0) {
$query = "SELECT * FROM ".$this->prefix."section";
$rq =& $this->db->query($query);
while ($rq->fetchInto($element)) {
$show .= "<input type='checkbox' name='".$name."[]' value='".$element["sect_id"]."'> ".$this->secure->checkStr($element["secname"],1)." ";
}
} else {
$query = "SELECT * FROM ".$this->prefix."section s JOIN ".$this->prefix."sect2rep r ON s.sect_id=r.sect_id WHERE r.rep_id='$repID'";
$rq =& $this->db->query($query);
while ($rq->fetchInto($element)) {
$show .= "<input type='checkbox' name='".$name."[]' value='".$element["sect_id"]."' checked> ".$this->secure->checkStr($element["secname"],1)." ";
}
$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')";
while ($rq->fetchInto($element)) {
$show .= "<input type='checkbox' name='".$name."[]' value='".$element["sect_id"]."'> ".$this->secure->checkStr($element["secname"],1)." ";
}
}
 
break;
}
 
624,6 → 641,7
return $show;
}
 
 
/**
* Вывод формы редактирования/добавления секций
*
1194,7 → 1212,7
$show .= "<div class='inputbox'><label for='rhost'>Хост репозитория:</label> <input type='text' name='rhost' value='".$this->secure->checkStr($element["rhost"],1)."'></div>\n";
$show .= "<div class='inputbox'><label for='rfolder'>Корневая папка:</label> <input type='text' name='rfolder' value='".$this->secure->checkStr($element["rfolder"],1)."'></div>\n";
$show .= "<div class='inputbox'><label for='rtype'>Тип репозитория:</label> ".$this->showRepType($this->secure->checkInt($element["rtype_id"]), "rtype")."</div>\n";
$show .= "<div class='inputbox'><label for='rsects'>Секции репозитория:</label> ".$this->showSectionsList("rsects","","innerhtml")."</div>\n";
$show .= "<div class='inputbox'><label for='rsects'>Секции репозитория:</label> ".$this->showSectionsList("rsects",0,"innerhtml")."</div>\n";
$show .= "<div class='inputbox'><input type='submit' value=' Отправить данные '></div></fieldset>\n";
 
return $show;