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 Header( "Location: index.php" );
36 $description_error = "";
38 if( isset( $_POST['submitted'] ) ) {
39 if( !empty($_POST['url'] ) )
40 $slice['url']= $_POST['url'];
42 $url_error= "Provide a link to a project website.";
44 if( !empty($_POST['desc'] ) )
45 $slice['description'] = $_POST['desc'];
47 $description_error= "Provide a short description of the slice.";
49 if( empty( $url_error ) && empty( $description_error ) ) {
50 // Update the slice URL and description
51 $fields= array( "description"=>$slice['description'], "url"=>$slice['url'] );
52 $api->UpdateSlice( intval( $slice_id ), $fields );
53 Header( "Location: index.php?id=$slice_id" );
59 require_once 'plc_drupal.php';
60 drupal_set_title('Slices');
61 include 'plc_header.php';
63 $slice_name= $slice['name'];
65 print "<h2>Update Slice ". $slice['name'] ."</h2>";
67 //echo "<pre>"; print_r( $slice ); echo "</pre>";
68 $url = $slice['url'] ;
69 $description = $slice['description'] ;
73 <p>You must provide a short description as well as a
74 link to a project website. Do <b>not</b> provide
75 bogus information; if a complaint is lodged against your slice and
76 PlanetLab Operations is unable to determine what the normal behavior
77 of your slice is, your slice may be deleted to resolve the
80 <form method="post" action="update_slice.php?id=$slice_id">
91 <td><input size="50" name="url" value="$url" /></td>
92 <td><font color="red"><strong>$url_error</strong></font></td>
96 <td><textarea name="desc" rows="5" cols="40">$description</textarea></td>
97 <td><font color="red"><strong>$description_error</strong></font></td>
102 <input type="submit" name="submitted" value="Update" />
109 include 'plc_footer.php';