4 require_once 'plc_login.php';
6 // Get session and API handles
7 require_once 'plc_session.php';
11 require_once 'plc_drupal.php';
12 include 'plc_header.php';
15 require_once 'plc_functions.php';
16 require_once 'linetabs.php';
17 require_once 'table.php';
18 require_once 'form.php';
20 // --------------------
21 // recognized URL arguments
22 $pattern=$_GET['pattern'];
28 $tabs []= tab_nodes_local();
29 $tabs []= tab_slices();
31 // --------------------
32 drupal_set_title($title);
33 plekit_linetabs($tabs);
35 $tag_type_columns = array( "tag_type_id", "tagname", "category", "description", "roles");
37 $tag_type_filter=NULL;
39 $tag_type_filter['category']=$pattern;
42 $tag_types= $api->GetTagTypes($tag_type_filter, $tag_type_columns);
47 $headers['Name']="string";
48 $headers['Description']="string";
49 $headers['Category']="string";
50 $headers['Roles']="string";
52 // xxx ref count would be helpful but seem too expensive to compute at this stage
53 // the individual tag page show those ref counts per type
56 if (plc_is_admin()) $headers[plc_delete_icon()]="none";
58 $form=new PlekitForm(l_actions(),NULL);
61 $table = new PlekitTable("tags",$headers,0,array('notes'=>$notes));
64 $description_width=40;
66 foreach( $tag_types as $tag_type ) {
69 $tag_type_id=$tag_type['tag_type_id'];
70 $table->cell(href(l_tag($tag_type_id),$tag_type['tagname']));
71 $table->cell(wordwrap($tag_type['description'],$description_width,"<br/>"));
72 $table->cell($tag_type['category']);
73 $table->cell(plc_vertical_table ($tag_type['roles']));
74 $table->cell($tag_type_id);
76 $table->cell ($form->checkbox_html('tag_type_ids[]',$tag_type_id));
81 $table->tfoot_start();
84 $table->cell($form->submit_html ("delete-tag-types","Remove tags"),
85 array('hfill'=>true,'align'=>'right'));
88 // an inline area to add a tag type
91 $table->cell($form->text_html('tagname',''));
92 $table->cell($form->textarea_html('description','',$description_width,2));
93 $table->cell($form->text_html('category',''));
94 $table->cell("<span class='note_roles'>add roles later</span>");
95 $table->cell($form->submit_html("add-tag-type","Add"),2);
102 //plekit_linetabs ($tabs,"bottom");
105 include 'plc_footer.php';