events page has new links to caller page
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 25 Nov 2008 08:16:05 +0000 (08:16 +0000)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 25 Nov 2008 08:16:05 +0000 (08:16 +0000)
planetlab/events/index.php
planetlab/includes/plc_functions.php

index 3f5c779..398530f 100644 (file)
@@ -263,8 +263,8 @@ function layout ($param){
   //  $param['<span title="object_id">oid</span>']=$param['object_id'] ; unset($param['object_id']);
   $param['<span title="object_types">otys</span>']=$param['object_types'] ; unset($param['object_types']);
   $param['<span title="object_ids">oids</span>']=$param['object_ids'] ; unset($param['object_ids']);
-  $param['<span title="node_id">nid</span>']=$param['node_id'] ; unset($param['node_id']);
-  $param['<span title="person_id">pid</span>']=$param['person_id'] ; unset($param['person_id']);
+  $param['<span title="node_id">nid</span>']=plc_node_link($param['node_id']) ; unset($param['node_id']);
+  $param['<span title="person_id">pid</span>']= plc_person_link($param['person_id']) ; unset($param['person_id']);
   if (array_key_exists('auth_type',$param)) {
     $param['<span title="auth_type">at</span>']=$param['auth_type'] ; unset($param['auth_type']);
   }
index 91b2ef3..3809c76 100644 (file)
@@ -1,5 +1,21 @@
 <?php
 
+function plc_person_link ($person_id) {
+  if ( empty ($person_id)) {
+    return "";
+  } else {
+    return '<a href="/db/persons/index.php?id=' . $person_id . '">' . $person_id . '</a>';
+  }
+  }
+
+function plc_node_link ($node_id) {
+  if ( empty ($node_id)) {
+    return "";
+  } else {
+    return '<a href="/db/nodes/index.php?id=' . $node_id . '">' . $node_id . '</a>';
+  }
+  }
+
 // pagination function
 function paginate( $fn_array, $table_id, $caption, $limit, $main_field, $other_func= NULL, $fid= NULL ) {
   // get vars from call adjust them