Хранилища Subversion ant

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

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

/branches/ant/0.9.x/manager.php
377,8 → 377,7
$body = "<h3>Управление репозиториями</h3>";
switch ($action) {
case 'view':
$body .= "<ul><li><a href='".$manager."?mode=repositories&action=new-rpm'>Добавить новый rpm-репозиторий (мастер)</a></li>";
$body .= "<li><a href='".$manager."?mode=repositories&action=new-deb'>Добавить новый deb-репозиторий (мастер)</a></li>";
$body .= "<ul><li><a href='".$manager."?mode=repositories&action=new-master'>Добавить новый репозиторий (мастер)</a></li>";
$body .= "<li><a href='".$manager."?mode=repositories&action=new'>Добавить новый репозиторий (&#8220;хакерский&#8221; способ)</a></li></ul>";
$body .= $core->showRepositoriesList("repositories", $manager, "list");
break;
396,18 → 395,12
$body .= $core->showRepositoriesForm($uuid, "Удаление информации о репозитории");
$body .= "</form>";
break;
case 'new-rpm':
case 'new-master':
$body .= "<form action='".$process."' method='post'>\n";
$body .= "<input type='hidden' name='mode' value='repositories-add-rpm'>\n";
$body .= $core->showRepositoriesForm(0, "Добавление нового rpm-репозитория", "rpm");
$body .= $core->showRepositoriesForm(0, "Добавление нового rpm-репозитория");
$body .= "</form>";
break;
case 'new-deb':
$body .= "<form action='".$process."' method='post'>\n";
$body .= "<input type='hidden' name='mode' value='repositories-add-deb'>\n";
$body .= $core->showRepositoriesForm(0, "Добавление нового deb-репозитория", "deb");
$body .= "</form>";
break;
break;
case 'new':
$body .= "<form action='".$process."' method='post'>\n";
$body .= "<input type='hidden' name='mode' value='repositories-add'>\n";
/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;