4 * Site Admin: Trove Admin: add new leaf category
6 * SourceForge: Breaking Down the Barriers to Open Source Development
7 * Copyright 1999-2001 (c) VA Linux Systems
8 * http://sourceforge.net
10 * @version $Id: trove_cat_add.php,v 1.17 2001/04/10 16:10:30 pfalcon Exp $
14 require_once('pre.php');
15 require_once('www/include/trove.php');
16 require_once('www/admin/admin_utils.php');
18 session_require(array('group'=>'1','admin_flags'=>'A'));
20 // ########################################################
22 if ($GLOBALS['submit']) {
23 $newroot = trove_getrootcat($GLOBALS['form_parent']);
25 if ($GLOBALS[form_shortname]) {
28 (shortname,fullname,description,parent,version,root_parent)
30 '".htmlspecialchars($form_shortname)."',
31 '".htmlspecialchars($form_fullname)."',
32 '".htmlspecialchars($form_description)."',
34 '".date("Ymd",time())."01',
39 if (!$res || db_affected_rows($res)<1) {
41 $Language->getText('admin_trove_cat_add','error_in_trove_openration'),
47 // update full paths now
48 trove_genfullpaths($newroot,trove_getfullname($newroot),$newroot);
50 session_redirect("/admin/trove/trove_cat_list.php");
53 site_admin_header(array('title'=>$Language->getText('admin_trove_cat_add','title')));
56 <h3><?php echo $Language->getText('admin_trove_cat_add','add_new_trove_category'); ?></h3>
58 <form action="trove_cat_add.php" method="post">
59 <p><?php echo $Language->getText('admin_trove_cat_add','parent_category'); ?>:<?php echo utils_requiredField(); ?>
60 <br /><select name="form_parent">
64 // generate list of possible parents
65 // <paul@zootweb.com> 4/2/2003 - If we were given a parent trove use it
66 // in the "Parent Category" box otherwise give them the complete list.
67 if (isset($parent_trove_cat_id)) {
68 if ($parent_trove_cat_id == 0) {
69 print ('<option value="0">root</option>\n');
71 $res_cat = db_query("SELECT shortname,fullname,trove_cat_id FROM trove_cat WHERE trove_cat_id=$parent_trove_cat_id");
72 while ($row_cat = db_fetch_array($res_cat)) {
73 print ('<option value="'.$row_cat["trove_cat_id"].'">'.$row_cat["fullname"]."</option>\n");
77 print ('<option value="0">root</option>\n');
78 $res_cat = db_query("SELECT shortname,fullname,trove_cat_id FROM trove_cat");
79 while ($row_cat = db_fetch_array($res_cat)) {
80 print ('<option value="'.$row_cat["trove_cat_id"].'">'.$row_cat["fullname"]."</option>\n");
87 <p><?php echo $Language->getText('admin_trove_cat_add','new_category_short_name'); ?>:<?php echo utils_requiredField(); ?>
88 <br /><input type="text" name="form_shortname" /></p>
89 <p><?php echo $Language->getText('admin_trove_cat_add','new_category_full_name'); ?>:<?php echo utils_requiredField(); ?>
90 <br /><input type="text" name="form_fullname" /></p>
91 <p><?php echo $Language->getText('admin_trove_cat_add','new_category_description'); ?>:<?php echo utils_requiredField(); ?>
92 <br /><input type="text" size="80" name="form_description" />
93 <br /><input type="submit" name="submit" value="<?php echo $Language->getText('admin_trove_cat_add','add'); ?>" /></p>
98 site_admin_footer(array());