- echo "</select></td><td></td></tr>\n";
-
-}
-
-echo "<tr><th$name_error>Name: </th><td><input type=text id='textbox' name='name' size=40 value='";
-if( $name )
- echo $name;
-else
- echo $base;
-echo "'></td><td>". $error['name'] ."</td></tr>\n";
-echo "<tr><th$url_error>URL: </th><td> <input type=text name='url' size=50 value='$url'></td><td>". $error['url'] ."</td></tr>\n";
-echo "<tr><th$desc_error>Description: </th><td> <textarea name='description' rows=5 cols=45>$description</textarea></td><td>". $error['description'] ."</td></tr>\n";
-echo "<tr><th>Instantiation: </th><td> <select name='instantiation'>\n";
-echo "<option value='plc-instantiated'"; if( $instantiation == 'plc-instantiated' ) echo " selected"; echo ">PLC</option>\n";
-echo "<option value='delegated'"; if( $instantiation == 'delegated' ) echo " selected"; echo ">Delegated</option>\n";
-echo "<option value='not-instantiated'"; if( $instantiation == 'not-instantiated' ) echo " selected"; echo ">None</option>\n";
-echo "</select></td><td></td></tr>\n";
-
-echo "</tbody></table>\n";
-
-echo "<p><input type=submit name='add' value='Add Slice'>\n";
-
-echo "</form>\n";
-
+ $site_form = new PleKitForm (l_slice_add(),array(),'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,
+ 'id'=>'add_slice_choose_site'));
+ $site_form->end();
+ print "</div>";
+ }
+
+print <<< EOF
+<div class='slice_add'>
+<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
+<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.
+<br/>Site administrators often use this list to post announcements about service outages.
+New software releases and available services are announced here as well.
+</p>
+</div>
+EOF;
+
+$details = new PlekitDetails(TRUE);
+
+$form_variables = array('site_id'=>plc_my_site_id());
+$form = $details -> form_start("/db/slices/slice_add.php",$form_variables);
+print $form->hidden_html("site_id",$site_id);
+
+$details->start();
+
+$running=count($site['slice_ids']);
+$max=$site['max_slices'];
+$allocated = " $running running / $max max";
+if ($running >= $max) $allocated = plc_warning_html($allocated);
+$details->th_td("Allocated slices",$allocated);
+$details->th_td("Name",$name ? $name : $base, "name");
+$details->th_td("URL",$url,"url");
+$details->th_td("Description",$description,"description",
+ array('input_type'=>'textarea',
+ 'width'=>50,'height'=>5));
+$selectors=array(array('display'=>"PLC",'value'=>'plc-instantiated'),
+ array('display'=>"Delegated",'value'=>'delegated'),
+ array('display'=>"None",'value'=>'not-instantiated'));
+
+$instanciation_select = $form->select_html ("instantiation", $selectors);
+$details->th_td("Instanciation",$instanciation_select,"instantiation",
+ array('input_type'=>'select', 'value'=>$instantiation));
+
+
+$details->end();
+
+print <<< EOF
+<div class='slice_add'>
+<p>There are three 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>None</strong> allows you to reserve a slice name; you may instantiate the slice later.</li>
+</ul>
+</div>
+EOF;
+
+if ($persons) {
+ $title = count($persons) . " people can be added in slice";
+ $toggle=new PlekitToggle ('persons',$title,
+ array('visible'=>get_arg('show_persons',true)));
+ $toggle->start();
+
+ $headers = array();
+ $headers['email']='string';
+ $headers['first']='string';
+ $headers['last']='string';
+ $headers['+']='none';
+ $table = new PlekitTable ('persons_in_slice',$headers,0);
+ $table->start();
+ foreach ($persons as $person) {
+ $table->row_start();
+ $table->cell($person['email']);
+ $table->cell($person['first_name']);
+ $table->cell($person['last_name']);
+ $table->cell ($form->checkbox_html('person_ids[]',$person['person_id']));
+ $table->row_end();
+ }
+ $table->end();
+ $toggle->end();
+ }