From: Thierry Parmentelat Date: Thu, 16 Sep 2010 19:51:12 +0000 (+0200) Subject: showing reservable nodes in the slice page was buggy X-Git-Tag: plewww-4.3-51~3 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=14623fa47b3316b7b05f4a92e10bac9122423ec2;p=plewww.git showing reservable nodes in the slice page was buggy especially with tag-defined visible-column already named 'R' --- diff --git a/planetlab/includes/plc_functions.php b/planetlab/includes/plc_functions.php index 4db3dfa..4befb9c 100644 --- a/planetlab/includes/plc_functions.php +++ b/planetlab/includes/plc_functions.php @@ -562,8 +562,8 @@ function count_english_warning ($objs, $name) { } //////////////////// outlining reservable nodes -$reservable_mark="-R-"; -$reservable_legend="reservable nodes are marked with " . $reservable_mark; +function reservable_mark () { return "-R-";} +function reservable_legend () { return "reservable nodes are marked with " . reservable_mark (); } ?> diff --git a/planetlab/slices/slice.php b/planetlab/slices/slice.php index 74220e1..ab5796d 100644 --- a/planetlab/slices/slice.php +++ b/planetlab/slices/slice.php @@ -25,6 +25,7 @@ require_once 'toggle.php'; require_once 'form.php'; require_once 'raphael.php'; +plc_debug('legend',reservable_legend()); // keep css separate for now drupal_set_html_head(' @@ -448,9 +449,9 @@ $headers=array(); $notes=array(); $headers['peer']='string'; $headers['hostname']='string'; -$short="ST"; $long=Node::status_footnote(); $type='string'; +$short="-S-"; $long=Node::status_footnote(); $type='string'; $headers[$short]=array('type'=>$type,'title'=>$long); $notes []= "$short = $long"; -$short="R"; $long=$reservable_legend; $type='string'; +$short=reservable_mark(); $long=reservable_legend(); $type='string'; $headers[$short]=array('type'=>$type,'title'=>$long); $notes []= "$short = $long"; // the extra tags, configured for the UI $headers=array_merge($headers,$visibletags->headers()); @@ -473,7 +474,7 @@ if ($slice_nodes) foreach ($slice_nodes as $node) { $run_level=$node['run_level']; list($label,$class) = Node::status_label_class_($node); $table->cell ($label,array('class'=>$class)); - $table->cell( ($node['node_type']=='reservable')?$reservable_mark:"" ); + $table->cell( ($node['node_type']=='reservable')?reservable_mark():"" ); foreach ($visiblecolumns as $tagname) $table->cell($node[$tagname]); if ($privileges) $table->cell ($form->checkbox_html('node_ids[]',$node['node_id'])); @@ -515,9 +516,9 @@ if ($privileges) { $notes=array(); $headers['peer']='string'; $headers['hostname']='string'; - $short="ST"; $long=Node::status_footnote(); $type='string'; + $short="-S-"; $long=Node::status_footnote(); $type='string'; $headers[$short]=array('type'=>$type,'title'=>$long); $notes []= "$short = $long"; - $short="R"; $long=$reservable_legend; $type='string'; + $short=reservable_mark(); $long=reservable_legend(); $type='string'; $headers[$short]=array('type'=>$type,'title'=>$long); $notes []= "$short = $long"; // the extra tags, configured for the UI $headers=array_merge($headers,$visibletags->headers()); @@ -535,7 +536,7 @@ if ($privileges) { $table->cell(l_node_obj($node)); list($label,$class) = Node::status_label_class_($node); $table->cell ($label,array('class'=>$class)); - $table->cell( ($node['node_type']=='reservable')?$reservable_mark:"" ); + $table->cell( ($node['node_type']=='reservable')?reservable_mark():"" ); foreach ($visiblecolumns as $tagname) $table->cell($node[$tagname]); $table->cell ($form->checkbox_html('node_ids[]',$node['node_id'])); $table->row_end();