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_section($label,false);
55 $form = new PlcForm (l_actions(),array());
57 // XXX make this updatable ?
58 $details = new PlcDetails(false);
60 $details->line("Name", $form->text_html("name",$tagname,20));
61 $details->line("Category", $form->text_html("category",$category,30));
62 $details->line("Description",$form->textarea_html("description",$description,40,5));
64 // select the option corresponding with min_role_id
65 $selector = "<select name='min_role_id'>".
66 "<option value='10'>Admin</option>".
67 "<option value='20'>PI</option>".
68 "<option value='30'>User</option>" .
69 "<option value='40'>Tech</option>" . "</select>\n";
70 $details->line("Min Role",$selector);
72 $submit=$form->hidden_html ('tag_type_id',$tag_type_id) .
73 $form->submit_html('update-tag-type',"Update tag type");
75 $submit=$form->submit_html('add-tag-type',"Add tag type");
77 $details->single ($submit,"right");
83 include 'plc_footer.php';