admins can change nodes to reservable/regular in the node page
[plewww.git] / planetlab / includes / plc_functions.php
index a05fdd9..d40de74 100644 (file)
@@ -510,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']