From f78d6b6e081ccb8a68e63e885db93873e60e0a1c Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Thu, 28 Apr 2022 10:11:59 +0200 Subject: [PATCH] trailing spaces --- planetlab/includes/plc_peers.php | 14 ++++----- planetlab/includes/plc_session.php | 16 +++++------ planetlab/includes/plc_visibletags2.php | 18 ++++++------ plekit/php/columns.php | 32 ++++++++++----------- plekit/php/datepicker.php | 2 +- plekit/php/details.php | 18 ++++++------ plekit/php/form.php | 24 ++++++++-------- plekit/php/table.php | 38 ++++++++++++------------- plekit/php/table2.php | 38 ++++++++++++------------- plekit/php/toggle.php | 20 ++++++------- plekit/php/tophat_api.php | 24 ++++++++-------- 11 files changed, 122 insertions(+), 122 deletions(-) diff --git a/planetlab/includes/plc_peers.php b/planetlab/includes/plc_peers.php index a4a4dda..b64a391 100644 --- a/planetlab/includes/plc_peers.php +++ b/planetlab/includes/plc_peers.php @@ -1,5 +1,5 @@ hash[$peer_id]; @@ -55,7 +55,7 @@ class Peers { $result = "[local] " . $result; return $result; } - + public function link ($peer_id,$text) { if (! $peer_id) return href("/",$text); @@ -74,7 +74,7 @@ class Peers { $shortname=strtolower($this->shortname($peer_id)); return "peer-$shortname"; } - + function block_start ($peer_id) { // start a
element with 2 classes: // (1) generic: is either peer-local or peer-foreign @@ -82,7 +82,7 @@ class Peers { // e.g. at PLE we'd get
// or
// see plc_styles.css for how to have the more specific ones override the generic one - if ( ! $peer_id ) + if ( ! $peer_id ) $generic='peer-local'; else $generic='peer-foreign'; @@ -95,14 +95,14 @@ class Peers { print "
\n"; } - // writes a cell in the table with the peer's shortname, link to the peer page, + // writes a cell in the table with the peer's shortname, link to the peer page, // and classname set for proper color function cell ($table, $peer_id) { $shortname=$this->shortname($peer_id); $table->cell ($this->link($peer_id,$shortname), array('class'=>$this->classname($peer_id))); } - + } //////////////////////////////////////////////////////////// diff --git a/planetlab/includes/plc_session.php b/planetlab/includes/plc_session.php index 7850d86..ebdc050 100644 --- a/planetlab/includes/plc_session.php +++ b/planetlab/includes/plc_session.php @@ -79,7 +79,7 @@ class PLCSession $_SESSION['plc'] = array('auth' => $api->auth, 'person' => $person, 'expires' => $expires); - } + } } function BecomePerson($person_id) @@ -87,12 +87,12 @@ class PLCSession list($person) = $this->api->GetPersons(array($person_id)); if ($person) { - //Get this users session if one exists, create + //Get this users session if one exists, create //one otherwise list($session) = $this->api->GetSessions(array('person_id' => $person['person_id'])); if (!$session) { - $session = $this->api->AddSession($person['person_id']); + $session = $this->api->AddSession($person['person_id']); } else { @@ -112,12 +112,12 @@ class PLCSession $_SESSION['plc']['person'] = $this->person; $_SESSION['plc']['alt_person'] = $this->alt_person; $_SESSION['plc']['alt_auth'] = $this->alt_auth; - - } + + } } function BecomeSelf() - { + { if($this->alt_auth && $this->alt_person ) { $this->person = $this->alt_person; @@ -129,9 +129,9 @@ class PLCSession $_SESSION['plc']['person'] = $_SESSION['plc']['alt_person']; unset($_SESSION['plc']['alt_auth']); unset($_SESSION['plc']['alt_person']); - } + } } - + function logout() { diff --git a/planetlab/includes/plc_visibletags2.php b/planetlab/includes/plc_visibletags2.php index 8bcdb81..8cdc1d9 100644 --- a/planetlab/includes/plc_visibletags2.php +++ b/planetlab/includes/plc_visibletags2.php @@ -3,7 +3,7 @@ // $Id: plc_functions.php 15734 2009-11-13 10:52:31Z thierry $ // utility function for displaying extra columns based on tags and categories - // expected type is e.g. 'node' + // expected type is e.g. 'node' class VisibleTags { var $api; @@ -14,16 +14,16 @@ class VisibleTags { $this->type=$type; $this->columns=NULL; } - + // returns an ordered set of columns - compute only once function columns () { # if cached - if ($this->columns != NULL) + if ($this->columns != NULL) return $this->columns; // scan tag types to find relevant additional columns $tag_types = $this->api->GetTagTypes(array('category'=>"$type*/ui*")); - + $columns = array(); foreach ($tag_types as $tag_type) { $tagname=$tag_type['tagname']; @@ -38,12 +38,12 @@ class VisibleTags { $category_tokens=explode('/',$tag_type['category']); foreach ($category_tokens as $token) { $assign=explode('=',$token); - if (count($assign)==2) + if (count($assign)==2) $column[$assign[0]]=$assign[1]; } $columns []= $column; } - + // sort upon 'rank' usort ($columns, create_function('$col1,$col2','return strcmp($col1["header"],$col2["header"]);')); @@ -58,7 +58,7 @@ class VisibleTags { function column_names () { return array_map(create_function('$tt','return $tt["tagname"];'),$this->columns()); } - + // to add with array_merge to the headers part of the Plekit Table function headers () { $headers=array(); @@ -76,7 +76,7 @@ class VisibleTags { $headers[$headerId]=array('header'=>$column['header'],'headerId'=>$headerId, 'type'=>$column['type'],'tagname'=>$column['tagname'],'title'=>$column['description']); } /* - if ($column['header'] == $column['tagname']) + if ($column['header'] == $column['tagname']) $headers[$column['header']]=$column['type']; else $headers[$column['header']]=array('type'=>$column['type'],'title'=>$column['description']); @@ -89,7 +89,7 @@ class VisibleTags { $notes=array(); $columns=$this->columns(); foreach ($columns as $column) - if ($column['header'] != $column['tagname']) + if ($column['header'] != $column['tagname']) $notes []= strtoupper($column['header']) . ' = ' . $column['description']; return $notes; } diff --git a/plekit/php/columns.php b/plekit/php/columns.php index e75e4b4..736d09c 100644 --- a/plekit/php/columns.php +++ b/plekit/php/columns.php @@ -80,7 +80,7 @@ $tmp_headers[$headerId]=array('header'=>$headerId,'type'=>$column['type'],'tagna usort ($tmp_headers, create_function('$col1,$col2','return strcmp($col1["label"],$col2["label"]);')); -foreach ($tmp_headers as $t) +foreach ($tmp_headers as $t) $this->all_headers[$t['header']] = $t; //$this->all_headers = array_merge($this->all_headers, $tmp_headers); @@ -108,13 +108,13 @@ else if ($this->all_headers[$label."y"]['visible']) return "y"; else if ($this->all_headers[$label]['visible']) return ""; - + return ""; } function node_tags() { - $fetched_tags = array('node_id','hostname'); + $fetched_tags = array('node_id','hostname'); foreach ($this->all_headers as $h) { @@ -127,7 +127,7 @@ function node_tags() { function print_headers() { - $headers = ""; + $headers = ""; foreach ($this->all_headers as $l => $h) { @@ -138,7 +138,7 @@ function print_headers() { function get_visible() { - $visibleHeaders = array(); + $visibleHeaders = array(); foreach ($this->all_headers as $h) { @@ -197,7 +197,7 @@ function parse_configuration($column_configuration) { } - + /* @@ -216,15 +216,15 @@ function convert_data($value, $data_type) { if ($data_type == "string") return $value; - if ($data_type == "date") + if ($data_type == "date") return date("Y-m-d", $value); - if ($data_type == "uptime") + if ($data_type == "uptime") return (int)((int) $value / 86400); if (is_numeric($value)) return ((int) ($value * 10))/10; - + return $value; } @@ -286,7 +286,7 @@ function getTopHatData($data, $planetlab_nodes) { $requested_data = explode(",", $data); $r = array ('hostname'); - + foreach ($requested_data as $rd) if ($rd) $r[] = $rd; @@ -362,7 +362,7 @@ function fetch_live_data($all_nodes) { //comon data if ($this->comon_live_data != "") { - + //print ("live data to be fetched =".$this->comon_live_data); $this->ComonData= $this->comon_query_nodes($this->comon_live_data); //print_r($this->ComonData); @@ -392,7 +392,7 @@ function cells($table, $node) { foreach ($this->all_headers as $h) { -if (!$h['fixed']) { +if (!$h['fixed']) { if ($h['visible'] != "") { @@ -425,7 +425,7 @@ else //$node_string.= "\"".$value."\","; } } -else +else if ($node[$h['tagname']]) { $value = $this->convert_data($node[$h['tagname']], $h['type']); @@ -552,7 +552,7 @@ print ("");
- + @@ -596,9 +596,9 @@ EOF; function column_html ($colHeader, $colName, $colId, $fulldesc, $visible) { - if ($visible) + if ($visible) $display = 'display:table-cell'; - else + else $display = 'color:red;display:none'; return " diff --git a/plekit/php/datepicker.php b/plekit/php/datepicker.php index 9460e8b..b6b6c8e 100644 --- a/plekit/php/datepicker.php +++ b/plekit/php/datepicker.php @@ -27,7 +27,7 @@ class PlekitDatepicker { $this->id=$id; $this->display=$display; $this->options=array_merge($datepicker_default_options,$options); - + } function html () { diff --git a/plekit/php/details.php b/plekit/php/details.php index 72d1f6a..a3705a6 100644 --- a/plekit/php/details.php +++ b/plekit/php/details.php @@ -12,7 +12,7 @@ drupal_set_html_head(' // fieldname=>value // and we add in-line editing capabilities -// $editable : if not set, no edition will be allowed in the table +// $editable : if not set, no edition will be allowed in the table // this is typically set to false when user does not have write access // then each individual th_td provides its form_varname if and only iff edition is desired @@ -23,11 +23,11 @@ drupal_set_html_head(' // xxx todo : accept optional arguments as an options hash, rather than using the set_ methods which are ugly class PlekitDetails { - + var $editable; var $form; // various options for the editing area - // set manually + // set manually var $width; var $height; var $input_type; @@ -101,7 +101,7 @@ class PlekitDetails { return $old; } - // give a form_varname if the field can be edited + // give a form_varname if the field can be edited function th_td ($title,$value,$form_varname="",$options=NULL) { print $this->th_td_html ($title,$value,$form_varname,$options); } @@ -109,11 +109,11 @@ class PlekitDetails { if (!$options) $options = array(); if ( ! ($this->editable && $form_varname) ) { // xxx hack: if input_type is select, look for the 'value' option to display current value - if ($options['input_type'] == "select") + if ($options['input_type'] == "select") $value=$options['value']; return ""; } else { - // use options if provided, otherwise the latest set_ function + // use options if provided, otherwise the latest set_ function if (array_key_exists('input_type',$options)) $input_type=$options['input_type']; else $input_type=$this->input_type; if (array_key_exists('width',$options)) $width=$options['width']; @@ -133,7 +133,7 @@ class PlekitDetails { if ($height) $html .= " rows=$height"; $html .= ">$value"; } else { - // set id too + // set id too $html .= "th_td_html($title,plc_vertical_table($list,"foo")); } - // only for special cases, not editable + // only for special cases, not editable function th_th ($th1,$th2) { print $this->th_th_html ($th1, $th2);} function th_th_html ($th1, $th2) { return ""; @@ -165,7 +165,7 @@ class PlekitDetails { $result .=">$title"; return $result; } - + // a dummy line for getting some air function space () { print $this->space_html(); } function space_html () { return "\n"; } diff --git a/plekit/php/form.php b/plekit/php/form.php index 6436172..b5aa2de 100644 --- a/plekit/php/form.php +++ b/plekit/php/form.php @@ -18,13 +18,13 @@ class PlekitForm { function __construct ($full_url, $values, $options=NULL) { // so we can use the various l_* functions: - // we parse the url to extract var-values pairs, + // we parse the url to extract var-values pairs, // and add them to the 'values' argument if any // extract var=value settings from url if any $split=plekit_split_url($full_url); $this->url=$split['url']; - + $url_values=$split['values']; if ( ! $values ) $values = array(); if ( $url_values ) $values=array_merge($values,$url_values); @@ -42,8 +42,8 @@ class PlekitForm { if ($this->onSubmit) $html .= " onSubmit='$this->onSubmit'"; if ($this->onReset) $html .= " onReset='$this->onReset'"; $html .= ">"; - if ($this->values) - foreach ($this->values as $key=>$value) + if ($this->values) + foreach ($this->values as $key=>$value) $html .= $this->hidden_html($key,$value); return $html; } @@ -54,12 +54,12 @@ class PlekitForm { static function attributes ($options) { $html=""; $names=array('id','size','selected', 'checked', - 'onfocus','onselect', 'onchange', + 'onfocus','onselect', 'onchange', 'onkeyup', 'onmouseup', 'onclick', 'onsubmit'); if ($options['selected']) $options['selected']='selected'; if ($options['checked']) $options['checked']='checked'; if ($options) foreach ($options as $key=>$value) { - if (in_array(strtolower($key),$names)) + if (in_array(strtolower($key),$names)) $html .= " $key='$value'"; } return $html; @@ -91,9 +91,9 @@ class PlekitForm { static function textarea_html ($name,$value,$cols,$rows) { return ""; } - + // selectors is an array of hashes with the following keys - // (*) display + // (*) display // (*) value : the value that the 'name' variable will be assigned // (*) optional 'selected': the entry selected initially // (*) optional 'disabled': the entry is displayed but not selectable @@ -144,7 +144,7 @@ class PlekitForm { } else { foreach ($roles as $role) { $selector=role_selector($role); - if ($role['role_id'] == $current_id) + if ($role['role_id'] == $current_id) $selector['selected']=true; $selectors []= $selector; } @@ -156,7 +156,7 @@ class PlekitForm { // a form with a single button class PlekitFormButton extends PlekitForm { - + var $button_id; var $button_text; @@ -167,8 +167,8 @@ class PlekitFormButton extends PlekitForm { } function html () { - return - $this->start_html() . + return + $this->start_html() . $this->submit_html($this->button_id,$this->button_text). $this->end_html(); } diff --git a/plekit/php/table.php b/plekit/php/table.php index 2e75dac..0a21c40 100644 --- a/plekit/php/table.php +++ b/plekit/php/table.php @@ -16,7 +16,7 @@ drupal_set_html_head(' //////////////////////////////////////// // table_id:
".$h['label']."".$h['label']."  ".$h['title']."    
$title$value
$th1$th2
 
's id tag - WARNING : do not use '-' in table ids as it's used for generating javascript code // headers: an associative array; the values can take several forms -// simple/legacy form is "label"=>"type" +// simple/legacy form is "label"=>"type" // more advanced form is "label"=>options, it self a dict with the following known keys // (*) 'type': the type for sorting; this is passed to the javascript layer for custom sorting // default is to use 'text', custom sort functions can be specified with e.g. 'type'=>'sortAlphaNumericBottom' @@ -24,7 +24,7 @@ drupal_set_html_head(' // setting type to 'none' gives an non-sortable column // (*) 'title': if set, this is used in the "Sort on ``''" bubble // sort_column: the column to sort on at load-time - set to negative number for no onload- sorting -// options : an associative array to override options +// options : an associative array to override options // - bullets1 : set to true if you want decorative bullets in column 1 (need white background) // - stripes : use diferent colors for odd and even rows // - caption : a caption for the table -- never used I'm afraid @@ -117,7 +117,7 @@ class PlekitTable { // instantiate paginator callback print "<script type='text/javascript'> function $paginator (opts) { plekit_table_paginator (opts,'$this->table_id'); } </script>\n"; - + // instantiate debug hooks if needed if ($this->debug) { $cb_init = $this->table_id."_init"; @@ -132,10 +132,10 @@ class PlekitTable { if ($this->pagesize_area) print $this->pagesize_area_html (); - if ($this->search_area) + if ($this->search_area) print $this->search_area_html (); - - if ($this->caption) + + if ($this->caption) print "<caption> $this->caption </caption>"; print "<tr>"; foreach ($this->headers as $label => $colspec) { @@ -149,7 +149,7 @@ class PlekitTable { $title=NULL; } switch ($type) { - case "none" : + case "none" : $class=""; break; case "string": case "int": case "float": $class="sortable"; break; @@ -167,15 +167,15 @@ class PlekitTable { //////////////////// // for convenience, the options that apply to the bottom area can be passed here - // typically notes will add up to the ones provided so far, and to the default ones + // typically notes will add up to the ones provided so far, and to the default ones // xxx default should be used only if applicable function end ($options=NULL) { $this->set_options($options); print $this->bottom_html(); - if ($this->notes_area) + if ($this->notes_area) print $this->notes_area_html(); } - + //////////////////// function pagesize_area_html () { $width=count($this->headers); @@ -184,9 +184,9 @@ class PlekitTable { <tr class='pagesize_area'><td class='pagesize_area' colspan='$width'> <form class='pagesize' action='satisfy_xhtml_validator'><fieldset> <input class='pagesize_input' type='text' id="$pagesize_text_id" value='$this->pagesize' - onkeyup='plekit_pagesize_set("$this->table_id","$pagesize_text_id", $this->pagesize);' - size='3' maxlength='4' /> - <label class='pagesize_label'> items/page </label> + onkeyup='plekit_pagesize_set("$this->table_id","$pagesize_text_id", $this->pagesize);' + size='3' maxlength='4' /> + <label class='pagesize_label'> items/page </label> <img class='reset' src="/planetlab/icons/clear.png" alt="reset visible size" onmousedown='plekit_pagesize_reset("$this->table_id","$pagesize_text_id",$this->pagesize_def);' /> </fieldset></form></td></tr> @@ -203,13 +203,13 @@ EOF; $result = <<< EOF <tr class='search_area'><td class='search_area' colspan='$width'> <div class='search'><fieldset> - <label class='search_label'> Search </label> + <label class='search_label'> Search </label> <input class='search_input' type='text' id='$search_text_id' onkeyup='plekit_table_filter("$this->table_id","$search_text_id","$search_and_id");' size='$this->search_width' maxlength='256' /> <label>and</label> - <input id='$search_and_id' class='search_and' - type='checkbox' checked='checked' + <input id='$search_and_id' class='search_and' + type='checkbox' checked='checked' onchange='plekit_table_filter("$this->table_id","$search_text_id","$search_and_id");' /> <img class='reset' src="/planetlab/icons/clear.png" alt="reset search" onmousedown='plekit_table_filter_reset("$this->table_id","$search_text_id","$search_and_id");' /> @@ -238,9 +238,9 @@ EOF; //////////////////////////////////////// function notes_area_html () { - $search_notes = + $search_notes = array("Enter & or | in the search area to switch between <span class='bold'>AND</span> and <span class='bold'>OR</span> search modes"); - $sort_notes = + $sort_notes = array ("Hold down the shift key to select multiple columns to sort"); if ($this->notes) @@ -254,7 +254,7 @@ EOF; return ""; $result = ""; $result .= "<p class='table_note'> <span class='table_note_title'>Notes</span>\n"; - foreach ($notes as $note) + foreach ($notes as $note) $result .= "<br/>$note\n"; $result .= "</p>"; return $result; diff --git a/plekit/php/table2.php b/plekit/php/table2.php index d3b6849..a8a69de 100644 --- a/plekit/php/table2.php +++ b/plekit/php/table2.php @@ -16,7 +16,7 @@ drupal_set_html_head(' //////////////////////////////////////// // table_id: <table>'s id tag - WARNING : do not use '-' in table ids as it's used for generating javascript code // headers: an associative array; the values can take several forms -// simple/legacy form is "label"=>"type" +// simple/legacy form is "label"=>"type" // more advanced form is "label"=>options, it self a dict with the following known keys // (*) 'type': the type for sorting; this is passed to the javascript layer for custom sorting // default is to use 'text', custom sort functions can be specified with e.g. 'type'=>'sortAlphaNumericBottom' @@ -24,7 +24,7 @@ drupal_set_html_head(' // setting type to 'none' gives an non-sortable column // (*) 'title': if set, this is used in the "Sort on ``<title>''" bubble // sort_column: the column to sort on at load-time - set to negative number for no onload- sorting -// options : an associative array to override options +// options : an associative array to override options // - bullets1 : set to true if you want decorative bullets in column 1 (need white background) // - stripes : use diferent colors for odd and even rows // - caption : a caption for the table -- never used I'm afraid @@ -120,7 +120,7 @@ class PlekitTable { // instantiate paginator callback print "<script type='text/javascript'> function $paginator (opts) { plekit_table_paginator (opts,'$this->table_id'); } </script>\n"; - + // instantiate debug hooks if needed if ($this->debug) { $cb_init = $this->table_id."_init"; @@ -135,10 +135,10 @@ class PlekitTable { if ($this->pagesize_area) print $this->pagesize_area_html (); - if ($this->search_area) + if ($this->search_area) print $this->search_area_html (); - - if ($this->caption) + + if ($this->caption) print "<caption> $this->caption </caption>"; print "<tr>"; @@ -168,7 +168,7 @@ if ($this->configurable) } } switch ($type) { - case "none" : + case "none" : $class=""; break; case "string": case "int": case "float": $class="sortable"; break; @@ -193,15 +193,15 @@ if ($this->configurable) //////////////////// // for convenience, the options that apply to the bottom area can be passed here - // typically notes will add up to the ones provided so far, and to the default ones + // typically notes will add up to the ones provided so far, and to the default ones // xxx default should be used only if applicable function end ($options=NULL) { $this->set_options($options); print $this->bottom_html(); - if ($this->notes_area) + if ($this->notes_area) print $this->notes_area_html(); } - + //////////////////// function pagesize_area_html () { $width=count($this->headers); @@ -210,9 +210,9 @@ if ($this->configurable) <tr class='pagesize_area'><td class='pagesize_area' colspan='$width'> <form class='pagesize' action='satisfy_xhtml_validator'><fieldset> <input class='pagesize_input' type='text' id="$pagesize_text_id" value='$this->pagesize' - onkeyup='plekit_pagesize_set("$this->table_id","$pagesize_text_id", $this->pagesize);' - size='3' maxlength='4' /> - <label class='pagesize_label'> items/page </label> + onkeyup='plekit_pagesize_set("$this->table_id","$pagesize_text_id", $this->pagesize);' + size='3' maxlength='4' /> + <label class='pagesize_label'> items/page </label> <img class='reset' src="/planetlab/icons/clear.png" alt="reset visible size" onmousedown='plekit_pagesize_reset("$this->table_id","$pagesize_text_id",$this->pagesize_def);' /> </fieldset></form></td></tr> @@ -229,13 +229,13 @@ EOF; $result = <<< EOF <tr class='search_area'><td class='search_area' colspan='$width'> <div class='search'><fieldset> - <label class='search_label'> Search </label> + <label class='search_label'> Search </label> <input class='search_input' type='text' id='$search_text_id' onkeyup='plekit_table_filter("$this->table_id","$search_text_id","$search_and_id");' size='$this->search_width' maxlength='256' /> <label>and</label> - <input id='$search_and_id' class='search_and' - type='checkbox' checked='checked' + <input id='$search_and_id' class='search_and' + type='checkbox' checked='checked' onchange='plekit_table_filter("$this->table_id","$search_text_id","$search_and_id");' /> <img class='reset' src="/planetlab/icons/clear.png" alt="reset search" onmousedown='plekit_table_filter_reset("$this->table_id","$search_text_id","$search_and_id");' /> @@ -264,9 +264,9 @@ EOF; //////////////////////////////////////// function notes_area_html () { - $search_notes = + $search_notes = array("Enter & or | in the search area to switch between <span class='bold'>AND</span> and <span class='bold'>OR</span> search modes"); - $sort_notes = + $sort_notes = array ("Hold down the shift key to select multiple columns to sort"); if ($this->notes) @@ -280,7 +280,7 @@ EOF; return ""; $result = ""; $result .= "<p class='table_note'> <span class='table_note_title'>Notes</span>\n"; - foreach ($notes as $note) + foreach ($notes as $note) $result .= "<br/>$note\n"; $result .= "</p>"; return $result; diff --git a/plekit/php/toggle.php b/plekit/php/toggle.php index 014be9e..fbe8ff9 100644 --- a/plekit/php/toggle.php +++ b/plekit/php/toggle.php @@ -14,8 +14,8 @@ drupal_set_html_head(' // (*) area is what gets hidden and shown // (*) trigger is the area that can be clicked for toggling // (*) image contains a visual indication of the current status -// -// constructor needs +// +// constructor needs // (*) id: an 'id', used for naming the three parts // (*) trigger: the html text for the trigger // (*) options: a hash that can define @@ -24,11 +24,11 @@ drupal_set_html_head(' // - visible : if set to false, start hidden rather than visible // - info-text : the text for help on the tab // - info-visible : whether info needs to be visible at startup -// +// // methods are as follows // (*) trigger_html (): return the html code for the trigger // (*) image_html (): returns the html code for the image -// (*) area_start (): because we have too many places where php 'prints' code: instead +// (*) area_start (): because we have too many places where php 'prints' code: instead // (*) area_end(): of returning it, we do not expect the code for the area to be passed // so these methods can be used to delimit the area in question @@ -43,7 +43,7 @@ class PlekitToggle { if ( ! $options ) $options = array(); // 'visible' may be set or not; if set to NULL it's considered as undefined // so using NULL as the default means 'select from local storage i.e. last status' - if (array_key_exists ('visible',$options) && $options['visible']==NULL) + if (array_key_exists ('visible',$options) && $options['visible']==NULL) unset ($options['visible']); // start-hidden is internal and is always set if (array_key_exists ('visible',$options)) { @@ -111,7 +111,7 @@ class PlekitToggle { if (empty($tagname)) $tagname="span"; $bubble=""; if (array_key_exists ('bubble',$this->options)) $bubble=$this->options['bubble']; - + $html="<$tagname"; $html .= " id='$trigger_id'"; $html .= " class='plc-toggle-trigger'"; @@ -136,7 +136,7 @@ class PlekitToggle { // xxx in fact the default should be fetched in the browser storage xxx $info_visible=TRUE; // if info-visible is set, use this value - if (array_key_exists ('info-visible',$this->options)) + if (array_key_exists ('info-visible',$this->options)) $info_visible=$this->options['info-visible']; $id=$this->id; @@ -153,7 +153,7 @@ class PlekitToggle { $html .= "</td></tr></table></div>"; return $html; } - + function area_start () { print $this->area_start_html(); } function area_start_html () { @@ -174,7 +174,7 @@ class PlekitToggle { /* if desired, you can embed the whole (trigger+area) in another div for visual effects */ function container_start () { print $this->container_start_html(); } - function container_start_html () { + function container_start_html () { $id=$this->id_name('container'); $this->nifty=new PlekitNifty ($id,'plc-toggle-container','medium'); return $this->nifty->start_html(); @@ -188,4 +188,4 @@ class PlekitToggle { } -?> +?> diff --git a/plekit/php/tophat_api.php b/plekit/php/tophat_api.php index 4e690c5..82ee932 100644 --- a/plekit/php/tophat_api.php +++ b/plekit/php/tophat_api.php @@ -165,12 +165,12 @@ class TopHatAPI $this->error_log('Fault Code ' . $result['faultCode'] . ': ' . $result['faultString'], 1, true); $ret[] = NULL; - // Thierry - march 30 2007 - // using $adm->error() is broken with begin/commit style + // Thierry - march 30 2007 + // using $adm->error() is broken with begin/commit style // this is because error() uses last item in trace and checks for ['errors'] - // when using begin/commit we do run internal_call BUT internal_call checks for + // when using begin/commit we do run internal_call BUT internal_call checks for // multicall's result globally, not individual results, so ['errors'] comes empty - // I considered hacking internal_call + // I considered hacking internal_call // to *NOT* maintain this->trace at all when invoked with multicall // but it is too complex to get all values right // so let's go for the hacky way, and just record individual errors at the right place @@ -240,36 +240,36 @@ class TopHatAPI // Returns a new session key if a user or node authenticated // successfully, faults otherwise. - + function GetSession () { $args[] = $this->auth; return $this->call('GetSession', $args); } - + // Returns an array of structs containing details about users sessions. If // session_filter is specified and is an array of user identifiers or // session_keys, or a struct of session attributes, only sessions matching the // filter will be returned. If return_fields is specified, only the // specified details will be returned. - + function GetSessions ($session_filter = NULL) { $args[] = $this->auth; if (func_num_args() > 0) $args[] = $session_filter; return $this->call('GetSessions', $args); } - + // Returns an array of structs containing details about users. If // person_filter is specified and is an array of user identifiers or // usernames, or a struct of user attributes, only users matching the // filter will be returned. If return_fields is specified, only the // specified details will be returned. - // + // // Users and techs may only retrieve details about themselves. PIs // may retrieve details about themselves and others at their // sites. Admins and nodes may retrieve details about all accounts. - + function GetPersons ($person_filter = NULL, $return_fields = NULL) { $args[] = $this->auth; @@ -277,10 +277,10 @@ class TopHatAPI if (func_num_args() > 1) $args[] = $return_fields; return $this->call('GetPersons', $args); } - + // Returns 1 if the user or node authenticated successfully, faults // otherwise. - + function AuthCheck () { $args[] = $this->auth; -- 2.43.0