ckp
[plewww.git] / planetlab / sites / site.php
index b56e62e..12e8849 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-  // $Id: index.php 11750 2009-01-29 10:11:53Z thierry $
+  // $Id$
 
 // Require login
 require_once 'plc_login.php';
@@ -133,7 +133,7 @@ if ( $local_peer  && $privileges ) {
                              'bubble'=>'Review pending join requests');
  }
 
-plc_tabs($tabs);
+plekit_linetabs($tabs);
 
 // show gray background on foreign objects : start a <div> with proper class
 $peers->block_start ($peer_id);
@@ -144,14 +144,21 @@ if ( ! $enabled )
               " to review pending applications.");
 
 $can_update=(plc_is_admin ()  && $local_peer) || ( plc_in_site($site_id) && plc_is_pi());
-$details = new PlcDetails($can_update);
+
+
+$toggle = new PlekitToggle ('site',"Details",
+                           array('trigger-bubble'=>'Display and modify details for that site'));
+$toggle->start();
+
+$details = new PlekitDetails($can_update);
 
 if ( ! $site['is_public']) 
   plc_warning("This site is not public!");
 
+$details->form_start(l_actions(),array('action'=>'update-site','site_id'=>$site_id));
+
 $details->start();
 
-$details->form_start(l_actions(),array('action'=>'update-site','site_id'=>$site_id));
 $details->th_td("Full name",$sitename,'name',array('width'=>50));
 $details->th_td("Abbreviated name",$abbreviated_name,'abbreviated_name',array('width'=>15));
 $details->th_td("URL",$site_url,'url',array('width'=>40));
@@ -168,13 +175,14 @@ if (plc_is_admin())
 else
   $details->th_td("Max slices",$max_slices);
 $details->tr_submit("submit","Update Site");
-$details->form_end();
 
 if ( ! $local_peer) {
   $details->space();
   $details->th_td("Peer",$peers->peer_link($peer_id));
  }
 $details->end();
+$details->form_end();
+$toggle->end();
 
 //////////////////// mode details - for local object
 if ( $local_peer ) {
@@ -184,21 +192,21 @@ if ( $local_peer ) {
   $nb_boot = 0;
   if ($nodes) foreach ($nodes as $node) if ($node['boot_state'] == 'boot') $nb_boot ++;
 
-  $nodes_title = "Nodes : ";
+  $nodes_title = "Nodes : ";
   $nodes_title .= count($nodes) . " total";
   $nodes_title .= " / " . $nb_boot . " boot";
   if ($nb_boot < 2 ) 
     $nodes_title = plc_warning_html ($nodes_title);
   $nodes_title .= href(l_nodes_site($site_id)," (See as nodes)");
 
-  $toggle=new PlcToggle ('nodes',$nodes_title,array('trigger-tagname'=>'h2'));
+  $toggle=new PlekitToggle ('nodes',$nodes_title);
   $toggle->start();
 
   $headers=array();
   $headers['hostname']='string';
   $headers['state']='string';
 
-  $table = new PlcTable ('nodes',$headers,'0',array('search_area'=>false,
+  $table = new PlekitTable ('nodes',$headers,'0',array('search_area'=>false,
                                                    'notes_area'=>false,
                                                    'pagesize_area'=>false));
   $table->start();
@@ -210,24 +218,24 @@ if ( $local_peer ) {
   }
   $table->tfoot_start();
   $table->row_start();
-  $button=new PlcFormButton (l_node_add(),"node_add","Add node","POST");
+  $button=new PlekitFormButton (l_node_add(),"node_add","Add node","POST");
   $table->cell($button->html(),$table->columns(),"right");
   $table->row_end();
   $table->end();
   $toggle->end();
     
   //////////////////// Users
-  $persons_title = "Users : ";
+  $persons_title = "Users : ";
   $persons_title .= count($person_ids) . " total";
   $persons_title .= " / " . count ($pis) . " PIs";
   $persons_title .= " / " . count ($techs) . " Techs";
   if ($has_disabled_persons) 
-    $persons_title .= " / " . ($disabled_persons) . " Disabled";
+    $persons_title .= " / " . count($disabled_persons) . " Disabled";
   if ( (count ($pis) == 0) || (count ($techs) == 0) || (count($person_ids) >= 30) || count($disabled_persons) != 0 ) 
     $persons_title = plc_warning_html ($persons_title);
   $persons_title .= href(l_persons_site($site_id)," (See as users)");
 
-  $toggle=new PlcToggle ('persons',$persons_title,array('trigger-tagname'=>'h2'));
+  $toggle=new PlekitToggle ('persons',$persons_title);
   $toggle->start();
 
   $headers = array ();
@@ -236,7 +244,7 @@ if ( $local_peer ) {
   $headers['User']='string';
   $headers["Tech"]='string';
   if ($has_disabled_persons) $headers["Disabled"]='string';
-  $table=new PlcTable('persons',$headers,'1r-3r-0',array('search_area'=>false,
+  $table=new PlekitTable('persons',$headers,'1r-3r-0',array('search_area'=>false,
                                                         'notes_area'=>false,
                                                         'pagesize_area'=>false));
   $table->start();
@@ -254,9 +262,9 @@ if ( $local_peer ) {
 
   //////////////////// Slices
   // xxx to review after slices gets reworked
-  $toggle=new PlcToggle ('slices',"Slices",array('trigger-tagname'=>'h2'));
+  $toggle=new PlekitToggle ('slices',"Slices");
   $toggle->start();
-  $details=new PlcDetails (false);
+  $details=new PlekitDetails (false);
   $details->start();
   // summary on slices
   $slice_label = count($slice_ids) . " running / " . $max_slices . " max";
@@ -265,19 +273,18 @@ if ( $local_peer ) {
   $details->th_td("# Slices", href(l_slices_site($site_id),$slice_label));
   if ($slices) foreach ($slices as $slice)
      $details->th_td($slice['instantiation'],l_slice_obj($slice));
-  $button=new PlcFormButton (l_slice_add(),"slice_add","Add slice","POST");
+  $button=new PlekitFormButton (l_slice_add(),"slice_add","Add slice","POST");
   $details->tr($button->html(),"right");
   $details->end();
   $toggle->end();
 
   // Addresses
-  $toggle=new PlcToggle ('addresses',"Addresses",array('trigger-tagname'=>'h2',
-                                                      'start-visible'=>false));
+  $toggle=new PlekitToggle ('addresses',"Addresses",array('start-visible'=>false));
   $toggle->start();
   if ( ! $addresses) {
-    print "No known address for this site";
+    print "<p class='addresses'>No known address for this site</p>";
   } else {
-    $details=new PlcDetails (false);
+    $details=new PlekitDetails (false);
     $details->start();
     $details->th_td("Addresses","");
     foreach ($addresses as $address) {
@@ -299,7 +306,7 @@ if ( $local_peer ) {
 ////////////////////////////////////////
 $peers->block_end($peer_id);
 
-//plc_tabs ($tabs,"bottom");
+//plekit_linetabs ($tabs,"bottom");
 
 // Print footer
 include 'plc_footer.php';