ckp
[plewww.git] / planetlab / persons / person.php
index 4156076..3419150 100644 (file)
@@ -82,14 +82,14 @@ if ($privileges || $is_my_account)
 if ($local_peer && $privileges) 
   if ($enabled) 
     $tabs['Disable'] = array ('method'=>'POST',
-                             'url'=>l_person_actions(),
+                             'url'=>l_actions(),
                              'values'=> array ('person_id'=>$person_id,
                                                'action'=>'disable-person'),
                              'bubble'=>"Disable $first_name $last_name",
                              'confirm'=>"Are you sure you want to disable $first_name $last_name");
   else 
     $tabs['Enable'] = array ('method'=>'POST',
-                            'url'=>l_person_actions(),
+                            'url'=>l_actions(),
                             'values'=> array ('person_id'=>$person_id,
                                               'action'=>'enable-person'),
                             'bubble'=>"Enable $first_name $last_name",
@@ -97,7 +97,8 @@ if ($local_peer && $privileges)
 
 // become
 if (plc_is_admin() && ! $is_my_account) 
-  $tabs['Become'] = array('url'=>l_person_actions(),
+  $tabs['Become'] = array('method'=>'POST',
+                         'url'=>l_actions(),
                          'values'=>array('action'=>'become-person',
                                          'person_id'=>$person_id),
                          'bubble'=>"Become $first_name $last_name",
@@ -106,7 +107,7 @@ if (plc_is_admin() && ! $is_my_account)
 // delete
 if ($local_peer && $privileges) 
   $tabs['Delete'] = array ('method'=>'POST',
-                          'url'=>l_person_actions(),
+                          'url'=>l_actions(),
                           'values'=> array ('person_id'=>$person_id,
                                             'action'=>'delete-person'),
                           'bubble'=>"Delete $first_name $last_name",
@@ -143,8 +144,7 @@ plc_details_line("Bio",wordwrap($bio,50,"<br/>"));
 plc_details_end();
 
 //////////////////// slices
-echo "<hr />\n";
-plc_table_title('Slices');
+plc_section('Slices');
 
 if( ! $slices) {
   plc_warning ("User has no slice");
@@ -152,7 +152,7 @@ if( ! $slices) {
   $headers=array('Slice name'=>'string');
   $table_options=array('notes_area'=>false,
                       'pagesize'=>5);
-  plc_table_start("person_slices",$headers,1,$table_options);
+  plc_table_start("person-slices",$headers,1,$table_options);
 
   foreach( $slices as $slice ) {
     $slice_name= $slice['name'];
@@ -161,19 +161,18 @@ if( ! $slices) {
     plc_table_cell(l_slice_t($slice_id,$slice_name));
     plc_table_row_end();
   }
-  plc_table_end("person_slices");
+  plc_table_end("person-slices");
  }
 
 // we don't set 'action', but use the submit button name instead
-plc_form_start(l_person_actions(),
+plc_form_start(l_actions(),
               array("person_id"=>$person_id,
                     // uncomment this to run the 'debug' action 
                     //"action"=>"debug",
                     ));
 
 //////////////////// keys
-echo "<hr />\n";
-plc_table_title ("Keys");
+plc_section ("Keys");
                
 $can_manage_keys = ( $local_peer && ( plc_is_admin() || $is_my_account) );
 if ( empty( $key_ids ) ) {
@@ -186,7 +185,7 @@ $headers=array("Type"=>"string",
 if ($can_manage_keys) $headers['Remove']="none";
 // table overall options
 $table_options=array("search_area"=>false,"notes_area"=>false);
-plc_table_start("person_keys",$headers,"1",$table_options);
+plc_table_start("person-keys",$headers,"1",$table_options);
     
 if ($keys) foreach ($keys as $key) {
   $key_id=$key['key_id'];
@@ -212,11 +211,10 @@ if ($can_manage_keys) {
     "<td> $upload_key_right_area </td>";
 }
 
-plc_table_end("person_keys",array("footers"=>$footers));
+plc_table_end("person-keys",array("footers"=>$footers));
 
 //////////////////// sites
-echo "<hr />\n";
-plc_table_title('Sites');
+plc_section('Sites');
   
 // sites
 if (empty( $sites ) ) {
@@ -229,7 +227,7 @@ $headers['Name']="string";
 if ($can_manage_sites) 
   $headers['Remove']="string";
 $table_options = array('notes_area'=>false,'search_area'=>false);
-plc_table_start ("person_sites",$headers,0,$table_options);
+plc_table_start ("person-sites",$headers,0,$table_options);
 foreach( $sites as $site ) {
   $site_name= $site['name'];
   $site_id= $site['site_id'];
@@ -264,11 +262,10 @@ if ($can_manage_sites) {
   $footers []="<td style='text-align:right'> $add_site_left_area </td>".
     "<td colspan=2> $add_site_right_area </td>";
  }
-plc_table_end("person_sites",array("footers"=>$footers));
+plc_table_end("person-sites",array("footers"=>$footers));
 
 //////////////////// roles
-echo "<hr />\n";
-plc_table_title("Roles");
+plc_section("Roles");
 if (! $roles) plc_warning ("This user has no role !");
 
 $can_manage_roles= ($local_peer && plc_is_admin());
@@ -277,7 +274,7 @@ $table_options=array("search_area"=>false,"notes_area"=>false);
 $headers=array("Role"=>"none");
 if ($can_manage_roles) $headers ["Remove"]="none";
 
-plc_table_start("person_roles",$headers,0,$table_options);  
+plc_table_start("person-roles",$headers,0,$table_options);  
   
 // construct array of role objs
 $role_objs=array();
@@ -314,7 +311,7 @@ if ($can_manage_roles) {
   $footers []="<td style='text-align:right'> $add_role_left_area </td>".
     "<td colspan=2> $add_role_right_area </td>";
  }
-plc_table_end("person_roles",array("footers"=>$footers));
+plc_table_end("person-roles",array("footers"=>$footers));
 
 //////////////////////////////
 plc_form_end();