// Common functions
require_once 'plc_functions.php';
+require_once 'plc_peers.php';
require_once 'plc_minitabs.php';
require_once 'plc_tables.php';
if ($nb_pis == 0) $messages [] = "No PI";
if ($nb_techs == 0) $messages [] = "No Tech";
+ if (! $site['is_public']) $messages []= "Not public";
+
// check number of slices
if ( $site['max_slices'] == 0) {
$messages [] = "No slice allowed";
}
// server-side selection on peerscope
-list ( $peer_filter, $peer_label) = plc_peer_info($api,$_GET['peerscope']);
-$site_filter=array_merge($site_filter,$peer_filter);
+$peerscope = new PeerScope ($api,$peerscope);
+$site_filter=array_merge($site_filter,$peerscope->filter());
+$title .= ' - ' . $peerscope->label();
if (! plc_is_admin()) {
$site_columns = array("site_id", "name", "abbreviated_name", "login_base" , "peer_id" );
}
$tabs['My site'] = array('url'=>l_site(plc_my_site_id()));
-$tabs['Local sites'] = array('url'=>l_sites_local());
+$tabs['Local sites'] = array('url'=>l_sites_peer('local'));
if (plc_is_admin())
$tabs['Pending'] = array ('url'=>l_sites_pending(),
'bubble'=>'Review pending join requests');
// go
$sites= $api->GetSites( $site_filter , $site_columns);
-$peer_hash = plc_peer_global_hash ($api);
+$peers=new Peers($api);
$headers['Peer']="string";
-$headers['Name']="string";
-$headers['Login_base']="string";
-$headers['Abbreviated']="string";
+$headers['Full Name']="string";
+$headers['Login']="string";
+$headers['Abbrev.']="string";
if (plc_is_admin()) {
$headers['N']="int";
$headers['U']="int";
$headers['?']="string";
}
-plc_table_start("sites",$headers,3);
+$table=new PlcTable("sites",$headers,2);
+$table->start();
+
if ($sites) foreach ($sites as $site) {
- $shortname = plc_peer_shortname ($peer_hash,$site['peer_id']);
- plc_table_row_start($site['login_base']);
- plc_table_cell($shortname);
- plc_table_cell (l_site_t($site['site_id'],$site['name']));
- plc_table_cell ($site['login_base']);
- plc_table_cell ($site['abbreviated_name']);
+ $shortname = $peers->shortname($site['peer_id']);
+ $table->row_start();
+ $table->cell($shortname);
+ $table->cell (l_site_t($site['site_id'],htmlentities($site['name'])));
+ $table->cell ($site['login_base']);
+ $table->cell (htmlentities($site['abbreviated_name']));
if (plc_is_admin()) {
- plc_table_cell(count($site['node_ids']));
- plc_table_cell(count($site['person_ids']));
- plc_table_cell(count($site['slice_ids']));
- plc_table_cell(site_status($site));
+ $table->cell(count($site['node_ids']));
+ $table->cell(count($site['person_ids']));
+ $table->cell(count($site['slice_ids']));
+ $table->cell(site_status($site));
}
- plc_table_row_end();
+ $table->row_end();
}
-plc_table_end("sites");
+$notes=array("N = number of sites / U = number of users / S = number of slices");
+
+$table->end(array('notes'=>$notes));
// Print footer
include 'plc_footer.php';