helper fun to inspect strings
[plewww.git] / planetlab / includes / plc_functions.php
index 4befb9c..a51bf59 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
-// $Id$
+// install the default timezone as defined in php.ini
+date_default_timezone_set(ini_get('date.timezone'));
 
 # note: this needs to be consistent with the value in Monitor/monitor/wrapper/plc.py
 global $PENDING_CONSORTIUM_ID;
@@ -130,6 +131,7 @@ function l_person_obj ($person)             { return l_person_t($person['person_id'],$perso
 function l_tags ()                     { return "/db/tags/index.php"; }
 function l_tag ($tag_type_id)          { return "/db/tags/index.php?id=$tag_type_id"; }
 function l_tag_obj ($tag)              { return href(l_tag($tag['tag_type_id']),$tag['tagname']); }
+function l_tag_roles ($tag_type_id)    { return "/db/tags/index.php?id=$tag_type_id&show_details=0&show_roles=1"; }
 
 function l_nodegroups ()               { return "/db/tags/nodegroups.php"; }
 function l_nodegroup ($nodegroup_id)   { return "/db/tags/nodegroup.php?id=$nodegroup_id"; }
@@ -429,6 +431,16 @@ function plc_debug ($message,$object) {
   print "</pre>";
 }
 
+function plc_debug_txt ($message,$txt) {
+  print "<br />" . $message . "<pre>";
+  $txt=str_replace(" ","&lt;SPC&gt;",$txt);
+  $txt=str_replace("\t","&lt;TAB&gt;",$txt);
+  $txt=str_replace("\n","&lt;LF&gt;",$txt);
+  $txt=str_replace("\r","&lt;CR&gt;",$txt);
+  print $txt . "&lt;EOF&gt;";
+  print "</pre>";
+}
+
 $plc_prof_start=0.;
 $plc_prof_time=0.;
 $plc_prof_counter=0;