00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00026 function i18n($thestring, $needles = "") {
00027 global $i18nstrings;
00028
00029 if ($i18nstrings[$thestring] != "") {
00030 $result = $i18nstrings[$thestring];
00031 } else {
00032 $result = $thestring;
00033 }
00034
00035 if (is_array($needles)) {
00036 foreach($needles as $key => $value) {
00037 $result = str_replace("##$key##", $value, $result);
00038 }
00039 }
00040
00041 return $result;
00042 }
00043
00044 function generate_pagehelp() {
00045 global $page_help;
00046
00047 $thetexts = array("txt1", "txt2", "txt3", "txt4", "txt5", "txt6", "txt7", "txt8");
00048 $thecolours = array("blue", "red", "green", "maroon", "purple", "fuchsia", "navy", "teal");
00049
00050 $temp_content = "
00051 <table>";
00052
00053 foreach($page_help as $key => $value) {
00054 foreach($thetexts as $key2 => $value2) {
00055 $key = str_replace($value2, "<span style=\"color: " . $thecolours[$key2] . ";\">$value2</span>", $key);
00056 $value = str_replace($value2, "<span style=\"color: " . $thecolours[$key2] . ";\">$value2</span>", $value);
00057 }
00058 $temp_content .= "
00059 <tr>
00060 <td class=\"page_help_term\"><div>$key</div></td>
00061 <td class=\"page_help_description\"><div>$value</div></td>
00062 </tr>";
00063 }
00064
00065 $temp_content .= "
00066 </table>";
00067 return $temp_content;
00068 }
00069
00070 function generate_pagehelplink() {
00071 return "
00072 <script language=\"JavaScript\">
00073 <!--
00074 var state = 'none';
00075
00076 function showhide(layer_ref) {
00077 if (state == 'block') {
00078 state = 'none';
00079 } else {
00080 state = 'block';
00081 }
00082 if (document.all) { //IS IE 4 or 5 (or 6 beta)
00083 //eval( \\\"document.all.\\\" + layer_ref + \\\".style.display = state\\\");
00084 }
00085 if (document.layers) { //IS NETSCAPE 4 or below
00086 document.layers[layer_ref].display = state;
00087 }
00088 if (document.getElementById && !document.all) {
00089 maxwell_smart = document.getElementById(layer_ref);
00090 maxwell_smart.style.display = state;
00091 }
00092 }
00093
00094 document.write('<a class=\\\"command\\\" name=\\\"page_help\\\" href=\\\"javascript://\\\" onClick=\\\"showhide(\'page_help\')\\\">[" . i18n("Show layout help") . "]</a>')
00095 document.write('<div id=\"page_help\" style=\"display: none;\">" . str_replace("'", "\'", str_replace("\n", "", str_replace("\"", "\\\"", generate_pagehelp()))) . "</div>')
00096 // --></script>
00097 <noscript><a class=\"command\" href=\"" . globalIDtoURL( "help" ) . "\" target=\"_blank\">[" . i18n("Show layout help") . "]</a></noscript>";
00098 }
00099 ?>