X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=planetlab%2Fincludes%2Fplc_functions.php;h=d40de74ab558556ecb4fd7c94aa3aedc3f2eb152;hb=9d5da0d9968a075070eb8c5b75d8267d082bec31;hp=a51bf592188085b0a68566e338b7c32a60e99d11;hpb=d143bfb2c9741d8f82c78ec97472c7648a750eed;p=plewww.git diff --git a/planetlab/includes/plc_functions.php b/planetlab/includes/plc_functions.php index a51bf59..d40de74 100644 --- a/planetlab/includes/plc_functions.php +++ b/planetlab/includes/plc_functions.php @@ -75,6 +75,7 @@ function l_actions_download () { return "/db/nodes/node_downloads.php"; } function l_register_node () { return "/registerwizard/index.php"; } function l_pcu_add () { return "/registerwizard/index.php/register/stage1_addpcu"; } function l_pcu ($pcu_id) { return "/db/sites/pcu.php?id=$pcu_id"; } +function l_pcu_href ($pcu_id, $text) { return href(l_pcu($pcu_id), $text); } function l_nodes () { return "/db/nodes/index.php"; } function l_nodes_peer ($peer_id) { return "/db/nodes/index.php?peerscope=$peer_id"; } @@ -509,6 +510,27 @@ function plc_redirect ($url) { exit (); } +//////////////////// the options for an nodetype - suitable for plekit/form +global $builtin_node_types; +$builtin_node_types = array ( "regular" => "Regular/Shared", + "reservable" => "Reservable (requires to get leases)"); +function node_type_display ($api, $node_type) { + global $builtin_node_types; + $val=$builtin_node_types[$node_type]; + if ( ! $val) $val="??undefined??"; + return $val; +} + +function node_type_selectors ($api,$node_type) { + global $builtin_node_types; + foreach ($builtin_node_types as $value=>$display) { + $selector=array('display'=>$display, 'value'=>$value); + if ($value == $node_type) $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']