- $slice_label = plc_warning_html ($slice_label);
- $details->th_td("# Slices", href(l_slices_site($site_id),$slice_label));
- if ($slices) foreach ($slices as $slice)
- $details->th_td($slice['instantiation'],l_slice_obj($slice));
- $button=new PlekitFormButton (l_slice_add(),"slice_add","Add slice","POST");
- $details->tr($button->html(),"right");
- $details->end();
+ $slices_title = plc_warning_html($slices_title);
+ $slices_title .= href(l_slices_site($site_id)," (See as slices)");
+
+ $toggle=new PlekitToggle ('slices',$slices_title,
+ array('visible'=>get_arg('show_slices',false)));
+ $toggle->start();
+
+ $headers = array ();
+ $headers ['name']='string';
+ $headers ['I'] = 'string';
+ $headers ['N']='int';
+ $headers ['U']='int';
+ $notes=array('I = instantiation type',
+ 'N = number of nodes',
+ 'U = number of users');
+ $table=new PlekitTable ('slices',$headers,0,array('search_area'=>false,
+ 'pagesize_area'=>false,
+ 'notes'=>$notes));
+
+ $table->start();
+ if ($slices) foreach ($slices as $slice) {
+ $table->row_start();
+ $table->cell(l_slice_obj($slice));
+ $table->cell(instantiation_label($slice));
+ $table->cell (href(l_nodes_slice($slice['slice_id']),count($slice['node_ids'])));
+ $table->cell (count($slice['person_ids']));
+ $table->row_end();
+ }
+ if ($is_site_pi) {
+ $button=new PlekitFormButton (l_slice_add(),"slice_add","Add slice","post");
+ $table->tfoot_start();
+ $table->row_start();
+ $table->cell($button->html(),array('hfill'=>true,'align'=>'right'));
+ }
+
+ $table->end();