From: Thierry Parmentelat Date: Fri, 29 Apr 2022 13:19:08 +0000 (+0200) Subject: only white spaces X-Git-Tag: plewww-5.3-0~11 X-Git-Url: http://git.onelab.eu/?p=plewww.git;a=commitdiff_plain;h=6348bd961b5e5644edf9009ac992827eece9a233 only white spaces --- diff --git a/planetlab/common/adminsearch.php b/planetlab/common/adminsearch.php index 354b179..cf57e9e 100644 --- a/planetlab/common/adminsearch.php +++ b/planetlab/common/adminsearch.php @@ -11,9 +11,9 @@ global $plc, $api; // Print header require_once 'plc_drupal.php'; -// set default +// set default drupal_set_title('DB Search'); -include 'plc_header.php'; +include 'plc_header.php'; // Common functions require_once 'plc_functions.php'; @@ -40,7 +40,7 @@ $tokens=array_filter($tokens, "token_filter"); //////////////////// -// from a single search form, extract all tokens entered +// from a single search form, extract all tokens entered // and then show all entities that match one of that tokens among // persons - sites - slices - nodes //////////////////// @@ -56,11 +56,11 @@ function display_form ($pattern) { $toggle->start(); print <<< EOF

-This form searches for any entry in the database -(among persons, slices, -sites and nodes) +This form searches for any entry in the database +(among persons, slices, +sites and nodes) matching a name fragment, or token.
-You can specify a space-separated list of tokens, all entries matching +You can specify a space-separated list of tokens, all entries matching any token would then get listed.

EOF; @@ -108,7 +108,7 @@ function generic_search ($type,$field,$tokens) { // then, e.g. on slice, $key='site_id' & $plural=false // or, e.g. on person, $key='site_ids' & $plural=true function generic_gather_related ($objects, $key, $plural) { - if ( empty ($objects)) + if ( empty ($objects)) return array(); // else, look for either 'site_id' or 'site_ids' in the first object $sample=$objects[0]; @@ -128,7 +128,7 @@ function generic_gather_related ($objects, $key, $plural) { } } -////////// +////////// // create link from an id, using the various global hashes function plc_person_link ($person_id) {global $persons_hash; return l_person_obj($persons_hash[$person_id]);} function plc_slice_link ($slice_id) {global $slices_hash; return l_slice_obj($slices_hash[$slice_id]);} @@ -143,7 +143,7 @@ $peers = new Peers ($api); function display_persons ($persons,$visible) { if ( ! $persons) return; - + $toggle=new PlekitToggle('persons-area',"Persons",array('visible'=>$visible)); $toggle->start(); @@ -158,7 +158,7 @@ function display_persons ($persons,$visible) { $table=new PlekitTable('persons',$headers,1,$table_options); $table->start(); foreach ($persons as $person) { - $table->row_start(); + $table->row_start(); $table->cell($person['person_id']); $peers->cell($table,$person['peer_id']); $table->cell(l_person_obj($person)); @@ -173,7 +173,7 @@ function display_persons ($persons,$visible) { function display_slices ($slices,$visible) { if ( ! $slices) return; - + $toggle=new PlekitToggle('slices-area',"Slices",array('visible'=>$visible)); $toggle->start(); @@ -188,7 +188,7 @@ function display_slices ($slices,$visible) { $table=new PlekitTable('slices',$headers,1,$table_options); $table->start(); foreach ($slices as $slice) { - $table->row_start(); + $table->row_start(); $table->cell($slice['slice_id']); $peers->cell($table,$slice['peer_id']); $table->cell(l_slice_obj($slice)); @@ -207,7 +207,7 @@ function display_slices ($slices,$visible) { function display_sites ($sites,$visible) { if ( ! $sites) return; - + $toggle=new PlekitToggle('sites-area',"Sites",array('visible'=>$visible)); $toggle->start(); @@ -223,7 +223,7 @@ function display_sites ($sites,$visible) { $table=new PlekitTable('sites',$headers,1,$table_options); $table->start(); foreach ($sites as $site) { - $table->row_start(); + $table->row_start(); $table->cell($site['site_id']); $peers->cell($table,$site['peer_id']); $table->cell(l_site_obj($site)); @@ -239,7 +239,7 @@ function display_sites ($sites,$visible) { function display_nodes ($nodes,$visible) { if ( ! $nodes) return; - + $toggle=new PlekitToggle('nodes-area',"Nodes",array('visible'=>$visible)); $toggle->start(); @@ -253,7 +253,7 @@ function display_nodes ($nodes,$visible) { $table=new PlekitTable('nodes',$headers,1,$table_options); $table->start(); foreach ($nodes as $node) { - $table->row_start(); + $table->row_start(); $table->cell($node['node_id']); $peers->cell($table,$node['peer_id']); $table->cell(l_node_obj($node)); @@ -313,9 +313,9 @@ if ($pattern) { } else { $visible=false; } - - ////////// collect all related objects + + ////////// collect all related objects $rel_person_ids = array(); $rel_person_ids = array_merge($rel_person_ids, generic_gather_related ($sites,'person_ids',true)); $rel_person_ids = array_merge($rel_person_ids, generic_gather_related ($slices,'person_ids',true)); diff --git a/planetlab/events/events.php b/planetlab/events/events.php index 5156d2b..5ca8182 100644 --- a/planetlab/events/events.php +++ b/planetlab/events/events.php @@ -17,7 +17,7 @@ require_once 'plc_functions.php'; require_once 'table.php'; require_once 'linetabs.php'; require_once 'datepicker.php'; - + // needs much memory ini_set("memory_limit","256M"); @@ -25,9 +25,9 @@ ini_set("memory_limit","256M"); drupal_set_title('Events'); // as per index.php, we get here if _GET['type'] is set -$type=$_GET['type']; -$from_date=$_GET['from_date']; -$until_date=$_GET['until_date']; +$type = $_GET['type']; +$from_date = $_GET['from_date']; +$until_date = $_GET['until_date']; $messages=array(); @@ -50,7 +50,7 @@ function parse_date ($user_date,$until_if_true=false,$DAY,$EPOCH) { } else { $date="now"; $time=strtotime($date); } - + } else { // user-provided string list ($year,$month,$day) = preg_split ('/[\/\.\-]/',$user_date); @@ -110,7 +110,7 @@ function e_issuer ($param) { } function e_auth ($event) { - if (array_key_exists('auth_type',$event)) + if (array_key_exists('auth_type',$event)) return $event['auth_type']; else return ""; @@ -145,23 +145,23 @@ $filter['[time']=$until_time; //////////////////////////////////////// Events if ($type == 'Event') { - + // and the filter applied for fetching events using GetEvent $user_desc=$_GET['event']; if ( ! empty($user_desc)) { // should parse stuff like 45-90,230-3000 - some other day $filter['event_id']=intval($user_desc); } - - $events = $api->GetEvents($filter); + + $events = $api->GetEvents($filter); $title="Events [ $from_string - $until_string] matching " . ($user_desc ? $user_desc : "everything"); - + // see actual display of $title and $events below - + } else { - + switch ($type) { - case 'Person': + case 'Person': $primary_key='person_id'; $string_key='email'; $user_input=$_GET['person']; @@ -169,15 +169,15 @@ if ($type == 'Event') { $object_type='Person'; break; - case 'Node': + case 'Node': $primary_key='node_id'; $string_key='hostname'; $user_input=$_GET['node']; $method="GetNodes"; $object_type='Node'; break; - - case 'Site': + + case 'Site': $primary_key='site_id'; $string_key='login_base'; $user_input=$_GET['site']; @@ -185,7 +185,7 @@ if ($type == 'Event') { $object_type='Site'; break; - case 'Slice': + case 'Slice': $primary_key='slice_id'; $string_key='name'; $user_input=$_GET['slice']; @@ -199,7 +199,7 @@ if ($type == 'Event') { $title .= " type=$object_type"; $title .= " id(s)="; foreach ( explode(",",$user_input) as $user_desc) { -# numeric +# numeric if (my_is_int($user_desc)) { $obj_check = call_user_func(array($api,$method),array(intval($user_desc)),array($primary_key)); if (empty ($obj_check)) { @@ -234,8 +234,8 @@ if ($type == 'Event') { drupal_set_title ($title); // Show messages -if (!empty($messages)) - foreach ($messages as $line) +if (!empty($messages)) + foreach ($messages as $line) drupal_set_message($line); $headers=array("Id"=>"int", @@ -253,20 +253,20 @@ $table = new PlekitTable ("events",$headers,"0r"); $table->set_options (array ('max_pages'=>20)); $table->start (); foreach ($events as $event) { - + // the call button $message = htmlentities($event['message'], ENT_QUOTES); $call = htmlentities($event['call'], ENT_QUOTES); $text = sprintf("message=<<%s>>\\n\\ncall=<<%s>>\\n\\nruntime=<<%f>>\\n",$message,$call,$event['runtime']); $method = "%s',$call,$method); - + // the message button $trunc_mess=htmlentities(truncate($event['message'],40),ENT_QUOTES); $message="%s',$message,$message); - + $message=truncate($event['message'],40); $table->row_start(); $table->cell(e_event($event['event_id'])); @@ -283,7 +283,7 @@ foreach ($events as $event) { $table->set_options(array('notes'=>array("The R column shows the call result value, a.k.a. fault_code", "Click the button in the D(etails) column to get more details"))); $table->end(); - + //plekit_linetabs ($tabs,"bottom"); // Print footer diff --git a/planetlab/includes/plc_functions.php b/planetlab/includes/plc_functions.php index 87a8810..97b0bbb 100644 --- a/planetlab/includes/plc_functions.php +++ b/planetlab/includes/plc_functions.php @@ -60,7 +60,7 @@ function plc_my_person_id () { return $plc->person['person_id']; } -//////////////////////////////////////////////////////////// links +//////////////////////////////////////////////////////////// links function href ($url,$text) { return "" . $text . ""; } // naming scheme is @@ -93,7 +93,7 @@ function l_nodes_slice ($slice_id) { return "/db/nodes/index.php?slice_id=$slice function l_interface ($interface_id) { return "/db/nodes/interface.php?id=$interface_id"; } function l_interface_tags($interface_id){ return "/db/nodes/interface.php?id=$interface_id&show_tags=1"; } -function l_interface_t ($interface_id,$text) { +function l_interface_t ($interface_id,$text) { return href (l_interface($interface_id),$text); } function l_interface_add($node_id) { return "/db/nodes/interface.php?node_id=$node_id"; } @@ -118,7 +118,7 @@ function l_slices_local() { return "/db/slices/index.php?peerscope=local"; } function l_slice_obj ($slice) { return l_slice_t ($slice['slice_id'],$slice['name']); } function l_sliver ($node_id,$slice_id) { return "/db/nodes/slivers.php?node_id=$node_id&slice_id=$slice_id"; } -function l_sliver_t ($node_id,$slice_id,$text) { +function l_sliver_t ($node_id,$slice_id,$text) { return href (l_sliver($node_id,$slice_id),$text) ; } function l_persons () { return "/db/persons/index.php&active_line_tab=All Accounts"; } @@ -138,9 +138,9 @@ function l_tag_roles ($tag_type_id) { return "/db/tags/index.php?id=$tag_type_id function l_nodegroups () { return "/db/tags/nodegroups.php"; } function l_nodegroup ($nodegroup_id) { return "/db/tags/nodegroup.php?id=$nodegroup_id"; } -function l_nodegroup_t ($nodegroup_id,$text) { +function l_nodegroup_t ($nodegroup_id,$text) { return href(l_nodegroup($nodegroup_id),$text); } -function l_nodegroup_obj ($nodegroup) { +function l_nodegroup_obj ($nodegroup) { return href(l_nodegroup($nodegroup['nodegroup_id']),$nodegroup['groupname']); } function l_events () { return "/db/events/index.php"; } @@ -168,15 +168,15 @@ function l_site_review_pending($site_id){ return "/db/sites/join_request.php?rev //////////////////////////////////////////////////////////// nav tabs -function tab_nodes () { return array ('label'=>'All nodes','url'=>l_nodes(), +function tab_nodes () { return array ('label'=>'All nodes','url'=>l_nodes(), 'bubble'=>'Display nodes from all peers'); } -function tab_nodes_local () { return array ('label'=>'Local nodes', 'url'=>l_nodes_peer('local'), +function tab_nodes_local () { return array ('label'=>'Local nodes', 'url'=>l_nodes_peer('local'), 'bubble'=>'Display all nodes local to this peer'); } -function tab_nodes_site($site_id){ return array ('label'=>'Site nodes', 'url'=>l_nodes_site($site_id), +function tab_nodes_site($site_id){ return array ('label'=>'Site nodes', 'url'=>l_nodes_site($site_id), 'bubble'=>'Display nodes on that site'); } -function tab_nodes_slice($slice_id){ return array ('label'=>'Slice nodes', 'url'=>l_nodes_slice($slice_id), +function tab_nodes_slice($slice_id){ return array ('label'=>'Slice nodes', 'url'=>l_nodes_slice($slice_id), 'bubble'=>'Display nodes for that slice'); } -function tab_nodes_mysite () { return array ('label'=>'My site nodes', 'url'=>l_nodes_my_site(), +function tab_nodes_mysite () { return array ('label'=>'My site nodes', 'url'=>l_nodes_my_site(), 'bubble'=>'Display nodes on my site'); } function tab_nodes_all_mysite (){ return array ('label'=>'All My site nodes', 'url'=>l_nodes_all_my_site(), 'bubble'=>'Display nodes on all my sites'); } @@ -188,16 +188,16 @@ function tab_site($site) { return array ('label'=>'Site '.$site['login_base'], ' function tab_mysite() { return array ('label'=>'My site', 'url'=>l_site(plc_my_site_id()), 'bubble'=>'Details for site ' . plc_my_site_id()); } function tab_sites () { return array ('label'=>'All sites' , 'url'=>l_sites(), 'bubble'=> 'Display all sites'); } -function tab_sites_local () { return array ('label'=>'Local sites' , 'url'=>l_sites_peer('local'), +function tab_sites_local () { return array ('label'=>'Local sites' , 'url'=>l_sites_peer('local'), 'bubble'=> 'Display all siteslocal to this peer'); } ////////// function tab_slices() { return array ('label'=>'All slices', 'url'=>l_slices(), 'bubble' => 'Display all slices'); } function tab_slices_person() { return array ('label'=>'My slices', 'url'=>l_slices_person(plc_my_person_id()), 'bubble' => 'Display my all slices'); } -function tab_slices_mysite () { return array ('label'=>'My site slices', 'url'=>l_slices_my_site(), +function tab_slices_mysite () { return array ('label'=>'My site slices', 'url'=>l_slices_my_site(), 'bubble'=>'Display all slices on my site'); } -function tab_slices_local () { return array ('label'=>'Local slices', 'url'=>l_slices_local(), +function tab_slices_local () { return array ('label'=>'Local slices', 'url'=>l_slices_local(), 'bubble'=>'Display all slices local to this peer'); } function tab_slice($slice) { return array ('label'=>'Slice '.$slice['name'], 'url'=>l_slice($slice['slice_id']), 'bubble' => 'Details for ' . $slice['name']); } @@ -298,7 +298,7 @@ function is_reserved_network_addr($network_addr) { foreach ($reserved_ips as $r) { $min = ip2long($r[0]); $max = ip2long($r[1]); - + if (($lNetwork >= $min) && ($lNetwork <= $max)) return true; } @@ -322,7 +322,7 @@ function roles_except ($roles, $exception_ids) { if ($roles) foreach ($roles as $role) { if ( ! in_array ($role['role_id'],$exception_ids) ) { - $result[]=$role; + $result[]=$role; } } @@ -347,7 +347,7 @@ function plc_nodegroup_global_hash ($api,$tagnames=NULL) { } return $hash; } - + //////////////////////////////////////////////////////////// titles function t_site($site) { return " on site " . $site['name'] . " (" . $site['login_base'] .")"; } function t_slice ($slice) { return " running slice " . $slice['name'] . " (" . $slice['slice_id'] . ")"; } @@ -390,7 +390,7 @@ function truncate_and_popup ($text,$numb,$etc = "...") { $display=substr($text, 0, $numb).$etc; return sprintf("%s",$text,$display); } - + // generates <(atom) class=(class)> (text) function html_atom ($atom,$text,$class="") { $html="<$atom"; @@ -419,7 +419,7 @@ function errors_display ($errors) { print( "
" ); print( "

The following errors occured:

" ); print("
\n" ); } @@ -545,8 +545,8 @@ function interface_method_selectors ($api, $method, $primary) { "dhcp"=>"DHCP"); } else { $builtin_methods=array("static"=>"Static", - "dhcp"=>"DHCP", - "proxy"=>"Proxy", + "dhcp"=>"DHCP", + "proxy"=>"Proxy", "tap"=>"TUN/TAP", "ipmi"=>"IPMI"); } @@ -567,7 +567,7 @@ function pretty_bandwidth ($bw) { else return strval($bw/1000000000) . " Gbps"; } -//////////////////// +//////////////////// function instantiation_label ($slice) { $instantiation_labels = array ('not-instantiated'=>'NOT', 'plc-instantiated'=>'PLC', @@ -578,7 +578,7 @@ function instantiation_label ($slice) { if (!$result) $result = '??'; return $result; } - + //////////////////// toggle areas // get_arg ('show_persons',false) returns $_GET['show_persons'] if set and false otherwise function get_arg ($name,$default=NULL,$method='get') { diff --git a/planetlab/includes/plc_objects.php b/planetlab/includes/plc_objects.php index de085e9..0fd9a1f 100644 --- a/planetlab/includes/plc_objects.php +++ b/planetlab/includes/plc_objects.php @@ -27,21 +27,21 @@ function timeDiff ($timestamp,$detailed=false,$n = 0) { $time = ""; # The string we will hold our times in while($i > $n) { # if the difference is greater than the length we are checking... continue - if ($diff > $lengths[$i-1]) { + if ($diff > $lengths[$i-1]) { # 65 / 60 = 1. That means one minute. 130 / 60 = 2. Two minutes.. etc - $val = floor($diff / $lengths[$i-1]); + $val = floor($diff / $lengths[$i-1]); # The value, then the name associated, then add 's' if plural - $time .= $val ." ". $periods[$i-1].($val > 1 ? 's ' : ' '); -# subtract the values we just used from the overall diff so we can + $time .= $val ." ". $periods[$i-1].($val > 1 ? 's ' : ' '); +# subtract the values we just used from the overall diff so we can # find the rest of the information - $diff -= ($val * $lengths[$i-1]); -# if detailed is turn off (default) only show the first set found, + $diff -= ($val * $lengths[$i-1]); +# if detailed is turn off (default) only show the first set found, # else show all information - if(!$detailed) { $i = 0; } + if(!$detailed) { $i = 0; } } $i--; } - + # Basic error checking. if ($time == "") { return "error: bad time"; @@ -64,7 +64,7 @@ class PlcObject { class Person { var $roles; var $person_id; - var $first_name; + var $first_name; var $last_name; var $email; var $enabled; @@ -141,14 +141,14 @@ class PCU { } function deletePCUlink($node) { - return " Remove from PCU"; } function pcu_name() { if ( $this->data['hostname'] != NULL and $this->data['hostname'] != "" ): return $this->data['hostname']; - else: + else: if ( $this->data['ip'] != NULL and $this->data['ip'] != "" ): return $this->data['ip']; else: @@ -176,7 +176,7 @@ class Address { function link($str) { return "" . $str . ""; } - + function label() { $label = ""; $comma= sizeof( $this->data['address_types'] ); @@ -221,18 +221,18 @@ class Node extends PlcObject { $this->nn = $api->GetInterfaces($node['interface_ids']); foreach ($this->nn as $nnet) { - if ( $nnet['is_primary'] == true ) - { - $this->ip = $nnet['ip']; - $this->netmask = $nnet['netmask']; - $this->network = $nnet['network']; - $this->gateway= $nnet['gateway']; - $this->broadcast = $nnet['broadcast']; - $this->dns1 = $nnet['dns1']; - $this->dns2 = $nnet['dns2']; - $this->method = $nnet['method']; - $this->interface_id = $nnet['interface_id']; - } + if ( $nnet['is_primary'] == true ) + { + $this->ip = $nnet['ip']; + $this->netmask = $nnet['netmask']; + $this->network = $nnet['network']; + $this->gateway= $nnet['gateway']; + $this->broadcast = $nnet['broadcast']; + $this->dns1 = $nnet['dns1']; + $this->dns2 = $nnet['dns2']; + $this->method = $nnet['method']; + $this->interface_id = $nnet['interface_id']; + } } } @@ -284,7 +284,7 @@ class Node extends PlcObject { return $ret; } - // code needs to be accessible from outside an object too + // code needs to be accessible from outside an object too // b/c of the performance overhead of creating as many objects as nodes static function status_label_class__ ($boot_state, $run_level, $last_contact, $peer_id) { $label= $run_level ? $run_level : ( $boot_state . '*' ) ; @@ -301,7 +301,7 @@ class Node extends PlcObject { static function status_footnote () { return "state; * if node doesn't have an observed state; ... if status is stale (" . Node::stale_text() . ")"; } - + // ditto static function stale_ ($last_contact, $peer_id) { // remote nodes don't have a last_contact @@ -372,7 +372,7 @@ class Site extends PlcObject { $adm->GetPCUs( $this->pcu_ids ); $adm->GetNodes( $this->node_ids, array( "node_id", "hostname", "boot_state", "date_created", "last_updated", "last_contact", "site_id", "pcu_ids" ) ); - $adm->GetPersons( $this->person_ids, array( "role_ids", "person_id", "first_name", + $adm->GetPersons( $this->person_ids, array( "role_ids", "person_id", "first_name", "last_name", "email", "enabled" ) ); $adm->GetSlices( $this->slice_ids, array( "name", "slice_id", "instantiation", "created", "expires" ) ); return $adm->commit(); diff --git a/planetlab/sites/site.php b/planetlab/sites/site.php index 1a0ffba..3212291 100644 --- a/planetlab/sites/site.php +++ b/planetlab/sites/site.php @@ -22,9 +22,9 @@ require_once 'details.php'; require_once 'form.php'; require_once 'toggle.php'; -// -------------------- +// -------------------- // recognized URL arguments -$site_id=intval($_GET['id']); +$site_id = intval($_GET['id']); if ( ! $site_id ) { plc_error('Malformed URL - id not set'); return; } //////////////////// @@ -53,7 +53,7 @@ $max_slices= $site['max_slices']; $enabled = $site['enabled']; $ext_consortium_id = $site ['ext_consortium_id']; -// get peer +// get peer $peer_id= $site['peer_id']; $peers = new Peers ($api); $local_peer = ! $peer_id; @@ -62,7 +62,7 @@ $local_peer = ! $peer_id; $is_site_pi = ( $local_peer && plc_is_pi() && plc_in_site($site_id) ); $is_site_tech = ( $local_peer && plc_is_pi() && plc_in_site($site_id) ); $is_site_admin = ($local_peer && plc_is_admin()); - + $address_ids= $site['address_ids']; $pcu_ids= $site['pcu_ids']; $node_ids= $site['node_ids']; @@ -116,7 +116,7 @@ if ($persons) foreach( $persons as $person ) { if ( in_array( '20', $role_ids )) $pis[] = $person; if ( in_array( '40', $role_ids )) $techs[] = $person; if ( ! $person['enabled'] ) $disabled_persons[] = $person; - + } $has_disabled_persons = count ($disabled_persons) !=0; @@ -127,7 +127,7 @@ if ($slices) foreach ($slices as $slice) $slivers_count += count ($slice['node_i //////////////////////////////////////// drupal_set_title("Details for site " . $sitename); - + $tabs=array(); $tabs []= tab_mysite(); @@ -148,7 +148,7 @@ if ( $is_site_admin) 'bubble'=>"Delete site $sitename", 'confirm'=>"Are you sure you want to delete site $login_base"); -if ( $is_site_pi ) +if ( $is_site_pi ) $tabs ['Add slice'] = array ('url'=>l_slice_add(), 'method'=>'post', 'bubble'=>'Create new slice in site'); @@ -173,14 +173,14 @@ if ( $local_peer ) { // pending site global $PENDING_CONSORTIUM_ID; if ( $ext_consortium_id === $PENDING_CONSORTIUM_ID) { - if ( ! $enabled ) - plc_warning ("This site is under pending registration - Please visit " . - href (l_sites_pending(),"this page") . + if ( ! $enabled ) + plc_warning ("This site is under pending registration - Please visit " . + href (l_sites_pending(),"this page") . " to review pending applications."); - else + else plc_warning ("This site is pending but is also enabled - something is wrong. You should fix the issue with plcsh"); } else { - if ( ! $enabled) + if ( ! $enabled) plc_warning ("This site is disabled."); } } @@ -199,7 +199,7 @@ $f = $details->form_start(l_actions(),array('action'=>'update-site','site_id'=>$ $details->start(); -if ( ! $site['is_public']) +if ( ! $site['is_public']) $details->tr(plc_warning_html("This site is not public!")); $details->th_td("Full name",$sitename,'name',array('width'=>50)); @@ -209,7 +209,7 @@ $details->th_td("Latitude",$site_lat,'latitude'); $details->th_td("Longitude",$site_long,'longitude'); // modifiable by admins only -if (plc_is_admin()) +if (plc_is_admin()) $details->th_td("Login base",$login_base,'login_base',array('width'=>12)); else $details->th_td("Login base",$login_base); @@ -219,7 +219,7 @@ else $details->th_td("Max slices",$max_slices); if (plc_is_admin()) { - $selectors=array(array('display'=>"False",'value'=>'0'), + $selectors=array(array('display'=>"False",'value'=>'0'), array('display'=>"True",'value'=>'1')); $selectors[intval($enabled)]['selected'] = 'selected'; @@ -249,7 +249,7 @@ if ( $local_peer ) { $nodes_title = "Nodes : "; $nodes_title .= count($nodes) . " total"; $nodes_title .= " / " . $nb_boot . " boot"; - if ($nb_boot < 2 ) + if ($nb_boot < 2 ) $nodes_title = plc_warning_html ($nodes_title); $nodes_title .= href(l_nodes_site($site_id)," (See as nodes)"); @@ -260,7 +260,7 @@ if ( $local_peer ) { $headers=array(); $sort_column = '0'; if ($display_pcus) { $headers['PCU']='string'; $sort_column = '1' ; } - $headers['hostname']='string'; + $headers['hostname']='string'; $headers['state']='string'; $table = new PlekitTable ('nodes',$headers,$sort_column,array('search_area'=>false, @@ -298,7 +298,7 @@ if ( $local_peer ) { $table->row_end(); } // show undisplayed PCU's if any - if ($display_pcus) + if ($display_pcus) if ($pcu_hash) foreach ($pcu_hash as $id=>$pcu) { if (!$pcu['displayed']) { $table->row_start(); @@ -306,7 +306,7 @@ if ( $local_peer ) { $table->row_end(); } } - + $table->tfoot_start(); $table->row_start(); $button=new PlekitFormButton (l_node_add(),"node_add","Add node","POST"); @@ -314,15 +314,15 @@ if ( $local_peer ) { $table->row_end(); $table->end(); $toggle->end(); - + //////////////////// Users $persons_title = "Users : "; $persons_title .= count($person_ids) . " total"; $persons_title .= " / " . count ($pis) . " PIs"; $persons_title .= " / " . count ($techs) . " Techs"; - if ($has_disabled_persons) + if ($has_disabled_persons) $persons_title .= " / " . count($disabled_persons) . " Disabled"; - if ( (count ($pis) == 0) || (count ($techs) == 0) || (count($person_ids) >= 30) || count($disabled_persons) != 0 ) + 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)"); @@ -360,10 +360,10 @@ if ( $local_peer ) { $slices_title .= $max_slices . " max"; $slices_title .= " / " . count($slice_ids) . " running"; $slices_title .= " / $slivers_count slivers"; - if (count($slice_ids) >= $max_slices) + if (count($slice_ids) >= $max_slices) $slices_title = plc_warning_html($slices_title); $slices_title .= href(l_slices_site($site_id)," (See as slices)"); - + $toggle=new PlekitToggle ('slices',$slices_title, array('visible'=>get_arg('show_slices'))); $toggle->start(); @@ -395,7 +395,7 @@ if ( $local_peer ) { $table->row_start(); $table->cell($button->html(),array('hfill'=>true,'align'=>'right')); } - + $table->end(); $toggle->end(); @@ -404,13 +404,13 @@ if ( $local_peer ) { //////////////////////////////////////////////////////////// Tags // tags section // already inside a if ( $local_peer )... - + $tags=$api->GetSiteTags (array('site_id'=>$site_id)); function get_tagname ($tag) { return $tag['tagname'];} - // xxx looks like tech-only see an error here, + // xxx looks like tech-only see an error here, // might be that GetSiteTags is not accessible or something $tagnames = array_map ("get_tagname",$tags); - + $toggle = new PlekitToggle ('tags',count_english($tags,'tag'), array('bubble'=>'Inspect and set tags on that site', 'visible'=>get_arg('show_tags'))); @@ -420,7 +420,7 @@ if ( $local_peer ) { "Value"=>"string", ); if (plc_is_admin()) $headers[plc_delete_icon()]="none"; - + $table_options=array("notes_area"=>false,"pagesize_area"=>false,"search_width"=>10); $table=new PlekitTable("site_tags",$headers,0,$table_options); $table->start(); @@ -432,11 +432,11 @@ if ( $local_peer ) { if (plc_is_admin()) $table->cell ($form->checkbox_html('site_tag_ids[]',$tag['site_tag_id'])); $table->row_end(); } - + if ($is_site_pi || $is_site_admin) { $table->tfoot_start(); - // remove tag + // remove tag $table->row_start(); $table->cell($form->submit_html("delete-site-tags","Remove Tags"), // use the whole columns and right adjust @@ -445,9 +445,9 @@ if ( $local_peer ) { // set tag area $table->row_start(); - // get list of tag names in the site/* category + // get list of tag names in the site/* category $all_tags= $api->GetTagTypes( array ("category"=>"site*","-SORT"=>"tagname"), array("tagname","tag_type_id")); - // xxx cannot use onchange=submit() - would need to somehow pass action name + // xxx cannot use onchange=submit() - would need to somehow pass action name function tag_selector ($tag) { return array("display"=>$tag['tagname'],"value"=>$tag['tag_type_id']); } $selector=array_map("tag_selector",$all_tags); $table->cell($form->select_html("tag_type_id",$selector,array('label'=>"Choose"))); @@ -455,7 +455,7 @@ if ( $local_peer ) { $table->cell($form->submit_html("set-tag-on-site","Set Tag"),array('columns'=>2,'align'=>'left')); $table->row_end(); } - + $table->end(); $toggle->end(); $form->end(); diff --git a/plekit/php/logSorting.php b/plekit/php/logSorting.php index 084099a..55d30e5 100644 --- a/plekit/php/logSorting.php +++ b/plekit/php/logSorting.php @@ -23,4 +23,4 @@ $stringData = date('Ymd-H:i')."|".$person_id.":".$slice_id.":".$value."\n"; fwrite($fh, $stringData); fclose($fh); -?> +?> diff --git a/plekit/php/nifty.php b/plekit/php/nifty.php index aecbcbd..6820065 100644 --- a/plekit/php/nifty.php +++ b/plekit/php/nifty.php @@ -17,8 +17,8 @@ class PlekitNifty { function __construct ($id, $class, $size='medium') { $this->id = $id; - $this->class=$class; - $this->size=$size; + $this->class = $class; + $this->size = $size; } function start () { print $this->start_html(); } @@ -34,7 +34,7 @@ class PlekitNifty { return $html; } - function end () { print $this->end_html();} + function end () { print $this->end_html();} function end_html () { return ""; }