X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=planetlab%2Fincludes%2Fplc_functions.php;h=8de54c5b9fd516d9a26eb1f4529eb2b99c287b44;hb=c0e69680677e153e96e0302633e97e31b1e2c7a6;hp=4db3dfa7bf59c6d7e05045a554d8b34d73e0242f;hpb=9aea0150617516100c4413ce8d5c604ce208c4b8;p=plewww.git diff --git a/planetlab/includes/plc_functions.php b/planetlab/includes/plc_functions.php index 4db3dfa..8de54c5 100644 --- a/planetlab/includes/plc_functions.php +++ b/planetlab/includes/plc_functions.php @@ -1,6 +1,7 @@ "; } +function plc_debug_txt ($message,$txt) { + print "
" . $message . "
";
+  $txt=str_replace(" ","<SPC>",$txt);
+  $txt=str_replace("\t","<TAB>",$txt);
+  $txt=str_replace("\n","<LF>",$txt);
+  $txt=str_replace("\r","<CR>",$txt);
+  print $txt . "<EOF>";
+  print "
"; +} + $plc_prof_start=0.; $plc_prof_time=0.; $plc_prof_counter=0; @@ -497,6 +510,18 @@ function plc_redirect ($url) { exit (); } +//////////////////// the options for an nodetype - suitable for plekit/form +function node_type_selectors ($api,$nodetype) { + $builtin_types = array ( "regular" => "Regular/Shared", + "reservable" => "Reservable (requires to get leases)"); + foreach ($builtin_types as $value=>$display) { + $selector=array('display'=>$display, 'value'=>$value); + if ($value == $nodetype) $selector['selected']=true; + $selectors []= $selector; + } + return $selectors; +} + //////////////////// the options for an interface - suitable for plekit/form //>>> GetNetworkMethods() //[u'static', u'dhcp', u'proxy', u'tap', u'ipmi', u'unknown'] @@ -562,8 +587,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 (); } ?>