3 // $Id: nodes.php 11750 2009-01-29 10:11:53Z thierry $
6 require_once 'plc_login.php';
8 // Get session and API handles
9 require_once 'plc_session.php';
13 require_once 'plc_drupal.php';
14 include 'plc_header.php';
17 require_once 'plc_functions.php';
18 require_once 'plc_minitabs.php';
19 require_once 'plc_tables.php';
20 require_once 'plc_details.php';
21 require_once 'plc_forms.php';
23 // to create a new (action=='add-tag-type')
24 // or to update an existing (action='update-tag-type','tag_type_id'=<id>)
26 // --------------------
27 // recognized URL arguments
28 $pattern=$_GET['pattern'];
33 $tabs['All Types']=array('url'=>l_tags(),'bubble'=>"All Tag Types");
35 // --------------------
36 drupal_set_title($title);
39 // if its edit get the tag info
40 $update_mode = ( $_GET['action'] == 'update-tag-type' ) ;
43 $tag_type_id= intval( $_GET['id'] );
44 $type_info= $api->GetTagTypes( array( $tag_type_id ) );
46 $tagname=$type_info[0]['tagname'];
47 $min_role_id= $type_info[0]['min_role_id'];
48 $description= $type_info[0]['description'];
49 $category=$type_info[0]['category'];
52 // display form for tag types
53 plc_table_title($label);
55 plc_form_start (l_actions(),array());
57 plc_details_line("Name", plc_form_text_text("name",$tagname,20));
58 plc_details_line("Category", plc_form_text_text("category",$category,30));
59 plc_details_line("Description",plc_form_textarea_text("description",$description,40,5));
61 // select the option corresponding with min_role_id
62 $selector = "<select name='min_role_id'>".
63 "<option value='10'>Admin</option>".
64 "<option value='20'>PI</option>".
65 "<option value='30'>User</option>" .
66 "<option value='40'>Tech</option>" . "</select>\n";
67 plc_details_line("Min Role",$selector);
69 $submit=plc_form_hidden_text ('tag_type_id',$tag_type_id) .
70 plc_form_submit_text('update-tag-type',"Update tag type");
72 $submit=plc_form_submit_text('add-tag-type',"Add tag type");
74 plc_details_line1 ($submit,"right");
80 include 'plc_footer.php';