Хранилища Subversion ant

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

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

/branches/ant/0.9.x/lib/core.php
921,6 → 921,154
}
 
/**
* Вывод списка схем репозиториев
*
* @author Alexander Wolf
* @category Core
*
* @param string $name
* @param string $actor
* @param string $format
* @return string
*/
public function showSchemeList($name, $actor, $format = 'list') {
switch($format) {
case 'list':
$query = "SELECT * FROM ".$this->prefix."repscheme";
$rq =& $this->db->query($query);
$show = "<ul>\n";
while ($rq->fetchInto($element)) {
$show .= "<li>[<a href='".$actor."?mode=".$name."&action=edit&uuid=".$element["scheme_id"]."' class='edit'>править</a>][<a href='".$actor."?mode=".$name."&action=delete&uuid=".$element["scheme_id"]."' class='delete'>удалить</a>] ".$this->secure->checkStr($element["scheme"],1)."</li>\n";
}
$show .= "</ul>";
break;
case 'innerhtml':
$repID = $this->secure->checkInt($actor);
$query = "SELECT * FROM ".$this->prefix."repscheme";
$rq =& $this->db->query($query);
$show = "<select name='".$name."' id='".$name."'>\n";
while ($rq->fetchInto($element)) {
if ($element["scheme_id"]==$repID) {
$show .= "<option value='".$this->secure->checkInt($element["scheme_id"])."' selected>".$this->secure->checkStr($element["scheme"],1)."</option>\n";
} else {
$show .= "<option value='".$this->secure->checkInt($element["scheme_id"])."'>".$this->secure->checkStr($element["scheme"],1)."</option>\n";
}
}
$show .= "</select>";
break;
}
return $show;
}
 
/**
* Добавление новой схемы репозитория
*
* @author Alexander Wolf
* @category Core
*
* @param string $scheme
* @return array
*/
public function addScheme($scheme) {
$result = array();
$sScheme = $this->secure->checkStr($scheme,1);
 
$query = "INSERT INTO ".$this->prefix."repscheme SET scheme='".$sScheme."'";
$rq =& $this->db->query($query);
if (PEAR::isError($this->db)) {
$result["ERR"] = 1;
$result["ERRINFO"] = $this->db->getMessage();
} else {
$result["ERR"] = 0;
}
 
return $result;
}
 
/**
* Удаление информации о схеме репозитория
*
* @author Alexander Wolf
* @category Core
*
* @param integer $schemeID
* @return array
*/
public function dropScheme($schemeID) {
$result = array();
$sSchemeID = $this->secure->checkInt($schemeID);
 
// Удаление схемы
$query = "DELETE FROM ".$this->prefix."repscheme WHERE scheme_id='".$sSchemeID."'";
$rq =& $this->db->query($query);
if (PEAR::isError($this->db)) {
$result["ERR"] = 1;
$result["ERRINFO"] = $this->db->getMessage();
} else {
$result["ERR"] = 0;
}
return $result;
}
 
/**
* Обновление информации о схеме репозитория
*
* @author Alexander Wolf
* @category Core
*
* @param integer $schemeID
* @param string $info
* @return array
*/
public function updateScheme($schemeID, $info) {
$result = array();
$sSchemeID = $this->secure->checkInt($schemeID);
$sScheme = $this->secure->checkStr($info,1);
 
$query = "UPDATE ".$this->prefix."repscheme SET scheme='".$sScheme."' WHERE scheme_id='".$sSchemeID."'";
$rq =& $this->db->query($query);
if (PEAR::isError($this->db)) {
$result["ERR"] = 1;
$result["ERRINFO"] = $this->db->getMessage();
} else {
$result["ERR"] = 0;
}
 
return $result;
}
 
/**
* Вывод формы редактирования/добавления схем репозиториев
*
* @author Alexander Wolf
* @category Core
*
* @param integer $schemeID
* @param string $info
* @return string
*/
public function showSchemeForm($schemeID = 0, $info = "") {
$sSchemeID = $this->secure->checkInt($schemeID);
$sInfo = $this->secure->checkStr($info, 1);
if ($sInfo == "") {
$sInfo = "Схема репозитория";
}
if ($sSchemeID != 0) {
// Режим редактирования
$query = "SELECT * FROM ".$this->prefix."repscheme WHERE scheme_id='".$sSchemeID."'";
$rq =& $this->db->query($query);
$rq->fetchInto($element);
}
 
$show = "<fieldset><legend>".$sInfo."</legend>\n";
$show .= "<div class='inputbox'><label for='scheme'>Схема репозитория:</label> <input type='text' name='scheme' id='scheme' value='".$this->showSchemeList("scheme", $element["scheme_id"],"innerhtml")."'></div>\n";
$show .= "<div class='inputbox'><input type='submit' value=' Отправить данные '></div>\n</fieldset>\n";
 
return $show;
}
 
/**
* Показывает список подписей
*
* @author Alexander Wolf
1379,6 → 1527,7
$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> <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'><input type='submit' value=' Отправить данные '></div></fieldset>\n";
 
return $show;