Хранилища Subversion ant

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

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

/branches/ant/0.9.x/lib/core.php
159,7 → 159,7
case 'list':
$show = "<ul>";
while ($rq->fetchInto($element)) {
$show .= "<li>[<a href='".$heads."?mode=distributions&action=edit&uuid=".$this->secure->checkInt($element["dist_id"])."'>править</a>][<a href='".$heads."?mode=distributions&action=delete&uuid=".$this->secure->checkInt($element["dist_id"])."'>удалить</a>] ".$this->secure->checkStr($element["distname"],1)."</li>\n";
$show .= "<li>[<a href='".$heads."?mode=".$name."&action=edit&uuid=".$this->secure->checkInt($element["dist_id"])."'>править</a>][<a href='".$heads."?mode=".$name."&action=delete&uuid=".$this->secure->checkInt($element["dist_id"])."'>удалить</a>] ".$this->secure->checkStr($element["distname"],1)."</li>\n";
}
$show .= "</ul>";
break;
217,9 → 217,13
* @param string $format
* @return string
*/
public function showDistVersionsList($name, $distID, $format = 'html') {
public function showDistVersionsList($name, $distID, $format = 'html', $actor = '') {
$distname = $this->getDistName($distID);
$query = "SELECT * FROM ".$this->prefix."version WHERE dist_id='".$this->secure->checkInt($distID)."' ORDER BY version ASC";
if ($distID == 0) {
$query = "SELECT * FROM ".$this->prefix."version v JOIN ".$this->prefix."distribution d ON v.dist_id=d.dist_id ORDER BY d.dist_id,v.version ASC";
} else {
$query = "SELECT * FROM ".$this->prefix."version WHERE dist_id='".$this->secure->checkInt($distID)."' ORDER BY version ASC";
}
$rq =& $this->db->query($query);
switch ($format) {
case 'html':
237,6 → 241,13
}
$show .= ']';
break;
case 'list':
$show = "<ul>\n";
while ($rq->fetchInto($element)) {
$show .= "<li>[<a href='".$actor."?mode=".$name."&action=edit&uuid=".$this->secure->checkInt($element["version_id"])."'>править</a>][<a href='".$actor."?mode=".$name."&action=delete&uuid=".$this->secure->checkInt($element["version_id"])."'>удалить</a>] ".$this->secure->checkStr($element["distname"],1)." ".$this->secure->checkStr($element["version"],1)." &#8220;<em>".$this->secure->checkStr($element["vname"],1)."</em>&#8221;</li>\n";
}
$show .= "</ul>";
break;
}
return $show;
}
537,7 → 548,7
}
 
/**
* Показ формы редактирования версии дистрибутива или его списка
* Отображение формы создания и редактирования версии apt-дистрибутива
*
* @author Alexander Wolf
* @category Core
547,70 → 558,24
* @param integer $versionID
* @return string
*/
public function showDistVersionsEditor($name, $actor, $versionID = 0) {
if ($versionID == 0) {
$query = "SELECT * FROM ".$this->prefix."version v JOIN ".$this->prefix."distribution d ON v.dist_id=d.dist_id ORDER BY d.dist_id,v.version ASC";
$rq =& $this->db->query($query);
$show = "<ul>\n";
while ($rq->fetchInto($element)) {
$show .= "<li>[<a href='".$actor."?mode=versions&action=edit&uuid=".$this->secure->checkInt($element["version_id"])."'>править</a>][<a href='".$actor."?mode=versions&action=delete&uuid=".$this->secure->checkInt($element["version_id"])."'>удалить</a>] ".$this->secure->checkStr($element["distname"],1)." ".$this->secure->checkStr($element["version"],1)." &#8220;<em>".$this->secure->checkStr($element["vname"],1)."</em>&#8221;</li>\n";
}
$show .= "</ul>";
} else {
public function showDistVersionsForm($versionID = 0) {
$sVersionID = $this->secure->checkInt($versionID);
if ($sVersionID != 0) {
// Режим редактирования
$query = "SELECT * FROM ".$this->prefix."version v JOIN ".$this->prefix."distribution d ON v.dist_id=d.dist_id WHERE v.version_id='".$versionID."'";
$rq =& $this->db->query($query);
$rq->fetchInto($element);
$show = "<form action='".$actor."' method='post'>\n";
$show .= "<fieldset><legend>Редактирование описания версии дистрибутива</legend>\n";
$show .= "<input type='hidden' name='mode' value='".$name."-edit'>\n";
$show .= "<input type='hidden' name='".$name."ID' value='".$versionID."'>\n";
$show .= "<div class='inputbox'><label for='distname'>Дистрибутив:</label> <input type='text' name='distname' value='".$this->secure->checkStr($element["distname"],1)."' readonly='readonly'></div>\n";
$show .= "<div class='inputbox'><label for='vname'>Название версии:</label> <input type='text' name='vname' value='".$this->secure->checkStr($element["vname"],1)."'></div>\n";
$show .= "<div class='inputbox'><label for='version'>Номер версии:</label> <input type='text' name='version' value='".$this->secure->checkStr($element["version"],1)."'></div>\n";
$show .= "<div class='inputbox'><label for='vcodename'>Кодовое имя версии:</label> <input type='text' name='vcodename' value='".$this->secure->checkStr($element["vcodename"],1)."'></div>\n";
$show .= "<div class='inputbox'><input type='submit' value=' Править '></div></fieldset></form>\n";
}
return $show;
}
}
$show = "<fieldset><legend>Версия дистрибутива</legend>\n";
$show .= "<div class='inputbox'><label for='distname'>Дистрибутив:</label> <input type='text' name='distname' value='".$this->secure->checkStr($element["distname"],1)."' readonly='readonly'></div>\n";
$show .= "<div class='inputbox'><label for='vname'>Название версии:</label> <input type='text' name='vname' value='".$this->secure->checkStr($element["vname"],1)."'></div>\n";
$show .= "<div class='inputbox'><label for='version'>Номер версии:</label> <input type='text' name='version' value='".$this->secure->checkStr($element["version"],1)."'></div>\n";
$show .= "<div class='inputbox'><label for='vcodename'>Кодовое имя версии:</label> <input type='text' name='vcodename' value='".$this->secure->checkStr($element["vcodename"],1)."'></div>\n";
$show .= "<div class='inputbox'><input type='submit' value=' Отправить данные '></div></fieldset>\n";
 
/**
* Вывод формы добавления и удаления версии дистрибутива
*
* @author Alexander Wolf
* @category Core
*
* @param string $name
* @param string $actor
* @param integer $versionID
* @return string
*/
public function showDistVersionsForm($name, $actor, $versionID = 0) {
$show = "<form action='".$actor."' method='post'>";
if ($versionID == 0) {
$show .= "<fieldset><legend>Добавить описание новой версии дистрибутива</legend>\n";
$show .= "<input type='hidden' name='mode' value='".$name."-add'>\n";
$show .= "<div class='inputbox'><label for='distname'>Дистрибутив:</label> ".$this->showDistributionList("distname", "", "", "innerhtml") ."</div>\n";
$show .= "<div class='inputbox'><label for='vname'>Название версии:</label> <input type='text' name='vname' value=''></div>\n";
$show .= "<div class='inputbox'><label for='version'>Номер версии:</label> <input type='text' name='version' value=''></div>\n";
$show .= "<div class='inputbox'><label for='vcodename'>Кодовое имя версии:</label> <input type='text' name='vcodename' value=''></div>\n";
$show .= "<div class='inputbox'><input type='submit' value=' Добавить '></div></fieldset>\n";
} else {
$query = "SELECT * FROM ".$this->prefix."version v JOIN ".$this->prefix."distribution d ON v.dist_id=d.dist_id WHERE v.version_id='".$versionID."'";
$rq =& $this->db->query($query);
$rq->fetchInto($element);
$show .= "<fieldset><legend>Удалить описание существующей версии дистрибутива</legend>\n";
$show .= "<input type='hidden' name='mode' value='".$name."-delete'>\n";
$show .= "<input type='hidden' name='".$name."ID' value='".$versionID."'>\n";
$show .= "<div class='inputbox'><label for='distname'>Дистрибутив:</label> <input type='text' name='distname' value='".$this->secure->checkStr($element["distname"],1)."' readonly='readonly'></div>\n";
$show .= "<div class='inputbox'><label for='vname'>Название версии:</label> <input type='text' name='vname' value='".$this->secure->checkStr($element["vname"],1)."' readonly='readonly'></div>\n";
$show .= "<div class='inputbox'><label for='version'>Номер версии:</label> <input type='text' name='version' value='".$this->secure->checkStr($element["version"],1)."' readonly='readonly'></div>\n";
$show .= "<div class='inputbox'><label for='vcodename'>Кодовое имя версии:</label> <input type='text' name='vcodename' value='".$this->secure->checkStr($element["vcodename"],1)."' readonly='readonly'></div>\n";
$show .= "<div class='inputbox'><input type='submit' value=' Удалить '></div></fieldset>\n";
}
$show .= "</form>";
 
return $show;
}
}
 
}