From 2726975955eab4c1424f244daf0fb173b1eed8ca Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Fri, 16 Jan 2009 16:45:00 +0000 Subject: [PATCH] cleanup --- planetlab/includes/plc_functions.php | 31 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/planetlab/includes/plc_functions.php b/planetlab/includes/plc_functions.php index b973971..a0f3e59 100644 --- a/planetlab/includes/plc_functions.php +++ b/planetlab/includes/plc_functions.php @@ -140,6 +140,7 @@ function l_interface ($interface_id) { return href (l_interface_u($interface_id) function l_interface2 ($interface_id,$text) { return href (l_interface_u($interface_id),$text); } function l_event ($type,$param,$id) { return '/db/events/index.php?type=' . $type . '&' . $param . '=' . $id; } +function l_comon($id_name,$id_value) { return '/db/nodes/comon.php?' . $id_name . "=" . $id_value; } //////////////////////////////////////////////////////////// titles function t_site($site) { return " on site " . $site['name'] . " (" . $site['login_base'] .")"; } @@ -152,19 +153,6 @@ function tabs_slice($slice) { return array('Slice ' . $slice['name']=>l_slice_u( //////////////////////////////////////////////////////////// presentation // builds a table from an array of strings, with the given class -function plc_make_table ($class, $messages) { - // pretty print the cell - $formatted = ""; - if (! empty ($messages)) { - $formatted=""; - foreach ($messages as $message) { - $formatted .= ""; - } - $formatted .= "
" . $message . "
"; - } - return $formatted; -} - // attempt to normalize the delete buttons and confirmations function plc_delete_button($width=15) { return 'Delete this entry'; @@ -186,16 +174,29 @@ function plc_event_button($type,$param,$id) { return ' '; } -function plc_comon_button ($field, $value,$target="") { +function plc_comon_button ($id_name, $id_value,$target="") { $result=''; + $result.='href="' . l_comon($id_name,$id_value) . '">'; $result.=' '; return $result; } +function plc_make_table ($class, $messages) { + // pretty print the cell + $formatted = ""; + if (! empty ($messages)) { + $formatted=""; + foreach ($messages as $message) { + $formatted .= ""; + } + $formatted .= "
" . $message . "
"; + } + return $formatted; +} + //////////////////////////////////////////////////////////// function plc_error ($text) { // should use the same channel as the php errors.. -- 2.43.0