tables layout
[plewww.git] / planetlab / includes / plc_functions.php
index a25f747..c703b14 100644 (file)
@@ -104,6 +104,20 @@ function l_person_register()               { return "/db/persons/register.php"; }
 function l_site_register()             { return "/db/sites/register.php"; }
 function l_site_pending()              { return "/db/sites/join_request.php"; }
 
+// returns array ['url' => path, 'values' => hash (key=>value)* ]
+function split_url ($full_url) {
+  list($url,$args) = explode("?",$full_url);
+  $values=array();
+  if ($args) {
+    $pairs=explode("&",$args);
+    foreach ($pairs as $pair) {
+      list ($name,$value) = explode("=",$pair);
+      $values[$name]=$value;
+    }
+  }
+  return array("url"=>$url,"values"=>$values);
+}
+
 //////////////////////////////////////////////////////////// validation functions
 function topdomain ($hostname) {
   $exploded=array_reverse(explode(".",$hostname));
@@ -329,6 +343,11 @@ function plc_vertical_table ($messages, $class="") {
 function get_site_id ($site) { return $site['site_id'];}
 
 ////////////////////////////////////////////////////////////
+function plc_section ($text,$line=true) {
+  if ($line) { print "<hr/>";}
+  print "<h2 class=plc> $text </h2>\n";
+}
+
 function plc_error ($text) {
   // should use the same channel as the php errors..
   print "<div class='plc-error'> Error " . $text . "</div>";