Commit a6995876fb07bca749b353f6c1523689c4a428e6

Authored by Michael Joseph
1 parent e08ac75b

reformatted and moved generateLink function to control.inc


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@920 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 33 additions and 38 deletions
presentation/Html.inc
... ... @@ -16,7 +16,7 @@ function startTable($border, $width) {
16 16 }
17 17  
18 18 function tableCaption($sCaption) {
19   - return "<caption><b>$sCaption</b></caption>\n";
  19 + return "<caption><b>$sCaption</b></caption>\n";
20 20 }
21 21  
22 22 function stopTable() {
... ... @@ -30,8 +30,8 @@ function tableRow($align, $bgcolor, $html) {
30 30  
31 31 function tableHeading($cssClassName, $colspan, $text) {
32 32 return "<th class=\"$cssClassName\" colspan=\"$colspan\">\n
33   - $text\n
34   - </th>\n";
  33 + $text\n
  34 + </th>\n";
35 35 }
36 36  
37 37 function tableData($html, $iColspan = 1) {
... ... @@ -47,52 +47,47 @@ function startTableRowCell() {
47 47 }
48 48  
49 49 function textInput($sId, $sValue) {
50   - return "<input type=text id=\"$sId\" value=\"$sValue\" />\n";
  50 + return "<input type=text id=\"$sId\" value=\"$sValue\" />\n";
51 51 }
52 52  
53 53 function endTableRowCell() {
54 54 return "</td></tr>\n";
55 55 }
56 56  
57   -function generateLink($sTargetPage, $sQueryString, $sLinkText) {
58   - $sQueryStringDelimiter = (strstr($sTargetPage, "?") ? "&" : "?");
59   - return "<a href=\"$sTargetPage$sQueryStringDelimiter$sQueryString\">$sLinkText</a>\n";
60   -}
61   -
62 57 function generateImage($sImageSource) {
63 58 return "<img border=\"0\" src=\"$sImageSource\">";
64 59 }
65 60  
66 61 function getNumberStringValidationJavaScript() {
67   - return "<script language=\"JavaScript\">\n".
68   - "<!--\n" .
69   - "function validateString(field, msg, min, max) {\n" .
70   - "\tif (!min) { min = 1 }\n" .
71   - "\tif (!max) { max = 65535 }\n\n" .
72   -
73   - "\tif (!field.value || field.value.length < min || field.value.max > max) {\n" .
74   - "\t\talert(msg);\n" .
75   - "\t\tfield.focus();\n" .
76   - "\t\tfield.select();\n" .
77   - "\t\treturn false;\n" .
78   - "\t}\n" .
79   - "\treturn true;\n" .
80   - "}\n\n" .
81   -
82   - "function validateNumber(field, msg, min, max) {\n" .
83   - "\tif (!min) { min = 0 }\n" .
84   - "\tif (!max) { max = 255 }\n" .
85   -
86   - "\tif ( (parseInt(field.value) != field.value) || field.value.length < min || field.value.length > max) {\n" .
87   - "\t\talert(msg);\n" .
88   - "\t\tfield.focus();\n" .
89   - "\t\tfield.select();\n" .
90   - "\t\treturn false;\n" .
91   - "\t}\n" .
92   - "\treturn true;\n" .
93   - "}\n" .
94   - "//-->\n" .
95   - "</script>\n";
  62 + return "<script language=\"JavaScript\">\n".
  63 + "<!--\n" .
  64 + "function validateString(field, msg, min, max) {\n" .
  65 + "\tif (!min) { min = 1 }\n" .
  66 + "\tif (!max) { max = 65535 }\n\n" .
  67 +
  68 + "\tif (!field.value || field.value.length < min || field.value.max > max) {\n" .
  69 + "\t\talert(msg);\n" .
  70 + "\t\tfield.focus();\n" .
  71 + "\t\tfield.select();\n" .
  72 + "\t\treturn false;\n" .
  73 + "\t}\n" .
  74 + "\treturn true;\n" .
  75 + "}\n\n" .
  76 +
  77 + "function validateNumber(field, msg, min, max) {\n" .
  78 + "\tif (!min) { min = 0 }\n" .
  79 + "\tif (!max) { max = 255 }\n" .
  80 +
  81 + "\tif ( (parseInt(field.value) != field.value) || field.value.length < min || field.value.length > max) {\n" .
  82 + "\t\talert(msg);\n" .
  83 + "\t\tfield.focus();\n" .
  84 + "\t\tfield.select();\n" .
  85 + "\t\treturn false;\n" .
  86 + "\t}\n" .
  87 + "\treturn true;\n" .
  88 + "}\n" .
  89 + "//-->\n" .
  90 + "</script>\n";
96 91 }
97 92  
98 93 ?>
... ...