# Copyright (c) 2003 DVL Software Limited
#
require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/common.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/freshports.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/databaselogin.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/../classes/user_tasks.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/../classes/categories.php';
$Title = 'Category maintenance';
$CategoryName = pg_escape_string($_REQUEST['category']);
$Category = new Category($db);
$CategoryID = $Category->FetchByName($CategoryName);
if (!$CategoryID) {
    die("I don't know that category: {$CategoryName}");
}
if ($Category->IsPrimary() == 't') {
    $IsPrimary = 1;
} else {
    $IsPrimary = 0;
}
if (isset($_REQUEST['update'])) {
    $Category->{description} = pg_escape_string($_REQUEST['description']);
    $Category->UpdateDescription();
}
freshports_Start($Title . ' - ' . $CategoryName, 'freshports - new ports, applications', 'FreeBSD, index, applications, ports');
?>
<TABLE WIDTH="<?php 
echo $TableWidth;
?>
" BORDER="0" ALIGN="center">
<TR><TD VALIGN="top" WIDTH="100%">