bugfix: the slice page was broken when nobody is in slice
[plewww.git] / planetlab / tags / nodegroup.php
index cb97270..fddba94 100644 (file)
@@ -22,7 +22,7 @@ require_once 'toggle.php';
 
 // -------------------- 
 // recognized URL arguments
-$nodegroup_id=intval($_GET['id']);
+$nodegroup_id=intval(get_array($_GET, 'id'));
 if ( ! $nodegroup_id ) { plc_error('Malformed URL - id not set'); return; }
 
 ////////////////////
@@ -52,14 +52,22 @@ $tabs []= tab_nodes_local();
 drupal_set_title("Details for node group " . $nodegroup['groupname']);
 plekit_linetabs($tabs);
 
-$details=new PlekitDetails(false);
+$toggle=new PlekitToggle('details','Details');
+$toggle->start();
+$details=new PlekitDetails(plc_is_admin());
 $details->start();
-$details->th_td ("Node group name",$nodegroup['groupname']);
+$details->form_start(l_actions(),array("action"=>"update-nodegroup", "nodegroup_id"=>$nodegroup_id));
+$details->th_td ("Node group name",$nodegroup['groupname'],'groupname');
+// can't change the target tag
 $details->th_td ("Based on tag",href(l_tag($nodegroup['tag_type_id']),$tagname));
-$details->th_td("Matching value",$nodegroup['value']);
+$details->th_td("Matching value",$nodegroup['value'],'value');
 $details->th_td("# nodes",count($nodegroup['node_ids']));
+$details->tr_submit("submit","Update Nodegroup");
+$details->form_end();
 $details->end();
 
+$toggle->end();
+
 // xxx : add & delete buttons would make sense here too
 $toggle=new PlekitToggle('nodes',"Nodes");
 $toggle->start();