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';
21 // get slice id from GET
22 $slice_id= intval( $_GET['add'] );
25 $tag_types= $api->GetTagTypes( $tag_type_filter , array( "tag_type_id", "tagname" ) );
27 foreach( $tag_types as $tag_type ) {
28 $all_tags[$tag_type['tag_type_id']]= $tag_type['tagname'];
31 // get slice's tag types
32 $slice_info= $api->GetSlices( array( $slice_id ), array( "slice_tag_ids" ) );
33 $tag_info= $api->GetSliceTags( $slice_info[0]['slice_tag_ids'], array( "tag_type_id", "tagname" ) );
35 foreach( $tag_info as $info ) {
36 $slice_tag_types[$info['tag_type_id']]= $info['tagname'];
40 $tag_types= $all_tags;
43 echo "<form action='tag_action.php' method='post'>\n";
44 echo "<h2>Edit ". $slice_info[0]['name'] ." tag: ". $tag_type[0]['tagname'] ."</h2>\n";
46 echo "<select name='tag_type_id'><option value=''>Choose a type to add</option>\n";
48 foreach( $tag_types as $key => $val ) {
49 echo "<option value='". $key ."'>". $val ."</option>\n";
54 echo "<p><strong>Value: </strong><input type=text name='value'>\n";
56 echo "<p><input type=submit name='add_tag' value='Add Tag'>\n";
57 echo "<input type=hidden name='slice_id' value='$slice_id'>\n";
62 $tag_id= intval( $_GET['id'] );
65 $slice_tag= $api->GetSliceTags( array( $tag_id ), array( "slice_id", "slice_tag_id", "tag_type_id", "value", "description", "min_role_id" ) );
68 $tag_type= $api->GetTagTypes( array( $slice_tag[0]['tag_type_id'] ), array( "tag_type_id", "tagname", "description" ) );
71 $slice_info= $api->GetSlices( array( $slice_tag[0]['slice_id'] ), array( "name" ) );
73 // start form and put values in to be edited.
74 echo "<form action='tag_action.php' method='post'>\n";
75 echo "<h2>Edit ". $slice_info[0]['name'] ." tag: ". $tag_type[0]['tagname'] ."</h2>\n";
77 echo $slice_tag[0]['description'] ."<br />\n";
78 echo "<strong>Value:</strong> <input type=text name=value value='". $slice_tag[0]['value'] ."'><br /><br />\n";
80 echo "<input type=submit value='Edit Tag' name='edit_tag'>\n";
81 echo "<input type=hidden name='slice_id' value='". $slice_tag[0]['slice_id'] ."'>\n";
82 echo "<input type=hidden name='tag_id' value='". $tag_id ."'>\n";
88 include 'plc_footer.php';