function show($id, $text = "") { if (!session::get("tooltips")) { // display text from database if ($id) { $helpArray = fetch_to_array(database::query("SELECT * FROM system WHERE name='{$id}'"), ""); if ($helpArray) { $entry = current($helpArray); } $right = right::get_field($id); $user = right::get("rights"); $temp = $entry[text]; // admin informations if (right::superuser()) { $temp .= "<hr><table>"; $temp .= "<tr><td>fieldname</td><td>{$id}</td></tr>"; // fieldname $temp .= "<tr><td>edit</td><td>" . right::int2string($right[edit]) . "</td></tr>"; // edit rights $temp .= "<tr><td>view</td><td>" . right::int2string($right[view]) . "</td></tr>"; // view rights $temp .= "</table>"; $clickEvent = " onmousedown = edit("{$id}")"; } if ($text) { $temp .= "<hr>{$text}"; } return "onmouseover='return overlib("" . $temp . "");' onmouseout='return nd()' {$clickEvent}"; } // display special text } }
function int2string($right, $su = false) { $text = ""; if ($right & 1) { $text .= "R"; } if ($right & 2) { $text .= "W"; } if ($right & 4) { $text .= "L"; } if (right::superuser() and $su) { $text .= " su"; } return $text; }