cvs: pearweb /public_html category-manager.php
| From: | Thomas V.V.Cox | Date: | Mon, 03 Sep 2001 23:24:02 +0000 |
| Subject: | cvs: pearweb /public_html category-manager.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-779@lists.php.net to get a copy of this message | ||
cox Mon Sep 3 19:24:02 2001 EDT
Added files:
/pearweb/public_html category-manager.php
Log:
first release of the category manager (full rustic interface yet)
Index: pearweb/public_html/category-manager.php
+++ pearweb/public_html/category-manager.php
<?php
// manage categories
auth_require(true);
response_header("PEAR :: Packages");
include_once 'pear-category.php';
include_once 'pear-database.php';
// expected url vars: catid (category id)
$catid = (isset($catid)) ? (int) $catid : null;
// ** expected
if (empty($catid)) {
$name = 'Top Level';
$parent = 0;
$category_title = "Package Browser: Top Level Categories";
} else {
if (isset($insert)) {
$data = array(
'name' => $catname,
'desc' => $catdesc,
'parent' => $catid);
add_category($data);
}
// XXXX TODO extract the full category path with visitations
$row = $dbh->getRow("SELECT name, parent FROM categories
WHERE id = $catid", DB_FETCHMODE_ASSOC);
extract($row);
}
?>
<table border="0" cellpadding="2" cellspacing="1"
width="100%">
<tr>
<td rowspan="3" width="30%"><?php print
cat_selector();?></td>
<td><h3>You are browsing category: <?php print $name;?></h3></td>
</tr>
</tr>
<td><b>Insert a new sub-category in: <?php print $name;
?></b><br/><br/>
<form action="<?php echo $GLOBALS['PHP_SELF'] .
"?catid=$catid&insert=1"; ?>" method="post">
Name: <input type="text" name="catname" size="20"><br>
Summary: <input type="text" name="catdesc" size="30">
<input type="submit" name="action" value="Insert">
</form>
<p>
</p>
</td>
</tr>
</tr>
<td><b>Delete</b></td>
</tr>
</table>
<?php
response_footer();
?>