set omf_control is checkbox checked - tweak creation/renewal message
[plewww.git] / planetlab / slices / slice_add.php
index 4558e84..704e0fe 100644 (file)
@@ -89,6 +89,14 @@ if ( $_POST['add-slice'] ) {
 
     if ($slice_id > 0) {
       drupal_set_message ("Slice $slice_id created");
+      if (isset($_POST['omf-control'])) {
+       if ($api->SetSliceOmfControl($slice_id,'yes') != 'yes') {
+         drupal_set_error("Could not set the 'omf_control' tag on newly created slice...");
+       } else {
+         drupal_set_message("Successfully set the 'omf_control' tag on slice");
+       }
+      }
+
       if ($person_ids) {
         // Add people
        $success=true;
@@ -172,7 +180,7 @@ if ($multiple_sites) {
     $selectors []= $selector;
   }
 
-  $site_form = new  PleKitForm (l_slice_add(),array(),'get');
+  $site_form = new  PleKitForm (l_slice_add(),array(),array('method'=>'get'));
   $site_form->start();
   print $site_form->label_html('site_id','Or choose some other site');
   print $site_form->select_html('site_id',$selectors,array('autosubmit'=>true,
@@ -183,16 +191,17 @@ if ($multiple_sites) {
                  
 print <<< EOF
 <div class='create-slice-instantiations'>
-<p>You must provide a short description of the new slice 
-as well as a link to a project website before creating it. 
-<br/>
-Do <strong>not</strong> provide bogus information; if a complaint 
-is lodged against your slice and your PlanetLab Operations Center
-is unable to determine what the normal behavior of your slice is, 
-your slice may be deleted to resolve the complaint.
-</p>
-<p><strong>NOTE</strong>: 
-All PlanetLab users are <strong>strongly</strong> encouraged to join the PlanetLab 
+<p>You <span class='bold'>must</span> provide a short description, 
+as well as a link to a project website, before creating it.
+
+<br/> Please make sure to provide reasonable details on <span class='bold'>
+the kind of traffic</span>, and <span class='bold'>copyrights</span> if relevant. 
+Do <span class='bold'>not</span> provide bogus information; if a complaint is lodged against 
+your slice  and your PlanetLab Operations Center is unable to determine what the normal behavior 
+of your slice is, your slice may be deleted to resolve the complaint.</p>
+
+<p><span class='bold'>NOTE</span>: All PlanetLab users are <span class='bold'>strongly</span>
+ encouraged to join the PlanetLab 
 <a href='https://lists.planet-lab.org/mailman/listinfo/users'>Users</a> 
 mailing list. Most questions about running software on PlanetLab can be answered by 
 posting to this list. 
@@ -228,20 +237,32 @@ $selectors=array(array('display'=>"PLC",'value'=>'plc-instantiated'),
                 array('display'=>"Controller",'value'=>'nm-controller'),
                 array('display'=>"None",'value'=>'not-instantiated'));
 
-$instanciation_select = $form->select_html ("instantiation", $selectors);
-$details->th_td("Instanciation",$instanciation_select,"instantiation",
+$instantiation_select = $form->select_html ("instantiation", $selectors);
+$details->th_td("Instantiation",$instantiation_select,"instantiation",
                array('input_type'=>'select', 'value'=>$instantiation));
 
+// display the current settings if any (like, we've screwed up the first time)
+if (isset($_POST['omf-control'])) {
+  $omf_options=array('checked'=>'checked');
+} else {
+  $omf_options=array();
+}
+$details->th_td("OMF friendly",
+               $form->checkbox_html('omf-control','yes',$omf_options));
 
 $instantiation_text = <<< EOF
 <div class='create-slice-instantiations'>
 <p>There are four possible "instantiation" states for a slice.</p>
 <ul>
-<li> <strong>PLC</strong> creates a slice with default settings. </li>
-<li><strong>Delegated</strong> creates a ticket to use on each node. </li>
-<li><strong>Controller</strong> creates a slice on all nodes to manipulate Delegated slices. </li>
-<li><strong>None</strong> allows you to reserve a slice name; you may instantiate the slice later.</li>
+<li> <span class='bold'>PLC</span> creates a slice with default settings. </li>
+<li><span class='bold'>Delegated</span> creates a ticket to use on each node. </li>
+<li><span class='bold'>Controller</span> creates a slice on all nodes to manipulate Delegated slices. </li>
+<li><span class='bold'>None</span> allows you to reserve a slice name; you may instantiate the slice later.</li>
 </ul>
+<p>PLC instantiated slices can be defined as <span class='bold'>OMF friendly</span>, 
+in which case slivers come with the OMF <span class='bold'>Resource Controller</span> pre-installed and pre-configured. 
+Such slivers can then be easily managed through a centralized tool, the OMF Experiment Controller.
+</p>
 </div>
 EOF;