Хранилища Subversion ant

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

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

/branches/ant/0.9.x/manager.php
129,6 → 129,40
$tmpl->assign('body', $body);
$tmpl->display('manager.tpl');
break;
case 'sections':
// Управление секциями (deb)
$body = "<h3>Управление секциями репозиториев</h3>";
switch ($action) {
case 'view':
$body .= "<p><a href='".$manager."?mode=sections&action=new'>Добавить новую секцию репозитория</a></p>";
$body .= $core->showSectionsList("sections", $manager);
break;
case 'edit':
$body .= "<form action='".$process."' method='post'>\n";
$body .= "<input type='hidden' name='mode' value='section-edit'>\n";
$body .= "<input type='hidden' name='sectionID' value='".$uuid."'>\n";
$body .= $core->showSectionsForm($uuid, "Редактирование информации о секции");
$body .= "</form>";
break;
case 'delete':
$body .= "<form action='".$process."' method='post'>\n";
$body .= "<input type='hidden' name='mode' value='section-delete'>\n";
$body .= "<input type='hidden' name='sectionID' value='".$uuid."'>\n";
$body .= $core->showSectionsForm($uuid, "Удаление информации о секции");
$body .= "</form>";
break;
case 'new':
$body .= "<form action='".$process."' method='post'>\n";
$body .= "<input type='hidden' name='mode' value='section-add'>\n";
$body .= $core->showSectionsForm(0, "Добавление новой секции");
$body .= "</form>";
break;
}
$tmpl->assign('header', "CPanel");
$tmpl->assign('description', "Панель управления генератором");
$tmpl->assign('body', $body);
$tmpl->display('manager.tpl');
break;
case 'repositories':
// Управление репозиториями
$body = "Функционал еще не готов";
/branches/ant/0.9.x/lib/core.php
588,8 → 588,51
public function showSourcesList($distID,$versID,$sectIDs,$repIDs) {
//TODO Написать генератор sources.list
}
 
/**
* Показывает список секций
*
* @author Alexander Wolf
* @category Core
*
* @param string $name
* @param string $actor
* @return string
*/
public function showSectionsList($name, $actor) {
$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"]."'>править</a>][<a href='".$actor."?mode=".$name."&action=delete&uuid=".$element["sect_id"]."'>удалить</a>] ".$this->secure->checkStr($element["secname"],1)."</li>\n";
}
$show .= "</ul>";
 
return $show;
}
 
public function showSectionsForm($sectionID = 0, $info = '') {
$sSectID = $this->secure->checkInt($sectionID);
$sInfo = $this->secure->checkStr($info, 1);
if ($sInfo == "") {
$sInfo = "Секция";
}
if ($sSectID != 0) {
// Режим редактирования
$query = "SELECT * FROM ".$this->prefix."section WHERE sect_id='".$sSectID."'";
$rq =& $this->db->query($query);
$rq->fetchInto($element);
}
 
$show = "<fieldset><legend>".$sInfo."</legend>\n";
$show .= "<div class='inputbox'><label for='sname'>Название секции:</label> <input type='text' name='sname' id='sname' value='".$this->secure->checkStr($element["secname"],1)."'></div>\n";
$show .= "<div class='inputbox'><label for='sinfo'>Описание секции:</label> <input type='text' name='sinfo' id='sinfo' value='".$this->secure->checkStr($element["sectinfo"],1)."'></div>\n";
$show .= "<div class='inputbox'><input type='submit' value=' Отправить данные '></div>\n</fieldset>\n";
 
return $show;
}
 
/**
* Проверка пароля (из формы авторизации)
*
* @author Alexander Wolf