4 require_once 'plc_login.php';
6 // Get session and API handles
7 require_once 'plc_session.php';
11 require_once 'plc_functions.php';
12 require_once 'plc_sorts.php';
15 $_person= $plc->person;
16 $_roles= $_person['role_ids'];
19 if( !empty( $_GET['id'] ) ) {
20 $slice_id= $_GET['id'];
21 // Fetch slice information
22 $slices= $api->GetSlices( array( intval( $slice_id ) ) );
23 if( !empty( $slices ) ) {
29 if( !isset( $slice ) ) {
30 plc_redirect( l_slices());
35 $description_error = "";
37 if( isset( $_POST['submitted'] ) ) {
38 if( !empty($_POST['url'] ) )
39 $slice['url']= $_POST['url'];
41 $url_error= "Provide a link to a project website.";
43 if( !empty($_POST['desc'] ) )
44 $slice['description'] = $_POST['desc'];
46 $description_error= "Provide a short description of the slice.";
48 if( empty( $url_error ) && empty( $description_error ) ) {
49 // Update the slice URL and description
50 $fields= array( "description"=>$slice['description'], "url"=>$slice['url'] );
51 $api->UpdateSlice( intval( $slice_id ), $fields );
52 plc_redirect(l_slice($slice_id));
57 require_once 'plc_drupal.php';
58 drupal_set_title('Slices');
59 include 'plc_header.php';
61 $slice_name= $slice['name'];
63 print "<h2>Update Slice ". $slice['name'] ."</h2>";
65 //echo "<pre>"; print_r( $slice ); echo "</pre>";
66 $url = $slice['url'] ;
67 $description = $slice['description'] ;
71 <p>You must provide a short description as well as a
72 link to a project website. Do <b>not</b> provide
73 bogus information; if a complaint is lodged against your slice and
74 PlanetLab Operations is unable to determine what the normal behavior
75 of your slice is, your slice may be deleted to resolve the
78 <form method="post" action="update_slice.php?id=$slice_id">
89 <td><input size="50" name="url" value="$url" /></td>
90 <td><font color="red"><strong>$url_error</strong></font></td>
94 <td><textarea name="desc" rows="5" cols="40">$description</textarea></td>
95 <td><font color="red"><strong>$description_error</strong></font></td>
100 <input type="submit" name="submitted" value="Update" />
107 include 'plc_footer.php';