X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=planetlab%2Ftags%2Ftags.php;h=75b89ddd5c427616f8a913108e860884e942649c;hb=621f5f2521d88af260fe7b4ed416826662929669;hp=6f394ea1f44747b99e84cf28bb3c4e9d9501a2a1;hpb=1808442881002384b18ea43434c56faad81b31f9;p=plewww.git
diff --git a/planetlab/tags/tags.php b/planetlab/tags/tags.php
index 6f394ea..75b89dd 100644
--- a/planetlab/tags/tags.php
+++ b/planetlab/tags/tags.php
@@ -1,7 +1,5 @@
GetTagTypes($tag_type_filter, $tag_type_columns);
$headers=array();
+$notes=array();
// delete button
$headers['Name']="string";
$headers['Description']="string";
$headers['Category']="string";
-$headers['Min role']="string";
+$headers['Roles']="string";
+
+// xxx ref count would be helpful but seem too expensive to compute at this stage
+// the individual tag page show those ref counts per type
+
$headers["Id"]="int";
if (plc_is_admin()) $headers[plc_delete_icon()]="none";
-$form=new PlcForm(l_actions(),NULL);
+$form=new PlekitForm(l_actions(),NULL);
$form->start();
-$table = new PlcTable("tags",$headers,0);
+$table = new PlekitTable("tags",$headers,0,array('notes'=>$notes));
$table->start();
-$roles_hash=plc_role_global_hash($api);
-
$description_width=40;
foreach( $tag_types as $tag_type ) {
- $role_name=$roles_hash[$tag_type['min_role_id']];
$table->row_start();
$tag_type_id=$tag_type['tag_type_id'];
$table->cell(href(l_tag($tag_type_id),$tag_type['tagname']));
$table->cell(wordwrap($tag_type['description'],$description_width,"
"));
$table->cell($tag_type['category']);
- $table->cell($role_name);
+ $table->cell(plc_vertical_table ($tag_type['roles']));
$table->cell($tag_type_id);
if (plc_is_admin())
$table->cell ($form->checkbox_html('tag_type_ids[]',$tag_type_id));
@@ -83,30 +82,24 @@ if (plc_is_admin()) {
$table->row_start();
$table->cell($form->submit_html ("delete-tag-types","Remove tags"),
- $table->columns(),"right");
+ array('hfill'=>true,'align'=>'right'));
$table->row_end();
// an inline area to add a tag type
$table->row_start();
- // build the role selector
- $relevant_roles = $api->GetRoles( array("~role_id"=>$role_ids));
- function selector_argument ($role) { return array('display'=>$role['name'],"value"=>$role['role_id']); }
- $selectors=array_map("selector_argument",$relevant_roles);
- $role_input=$form->select_html("min_role_id",$selectors,array('label'=>"Role"));
-
$table->cell($form->text_html('tagname',''));
$table->cell($form->textarea_html('description','',$description_width,2));
$table->cell($form->text_html('category',''));
- $table->cell($role_input);
- $table->cell($form->submit_html("add-tag-type","Add Type"),2);
+ $table->cell("add roles later");
+ $table->cell($form->submit_html("add-tag-type","Add"),2);
$table->row_end();
}
$table->end();
$form->end();
-plc_tabs ($tabs,"bottom");
+//plekit_linetabs ($tabs,"bottom");
// Print footer
include 'plc_footer.php';