Changeset 13566 for trunk/ippMonitor/generate
- Timestamp:
- May 30, 2007, 6:13:58 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippMonitor/generate (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippMonitor/generate
r13264 r13566 59 59 } 60 60 61 if ($key eq "FILE") { 62 $myFile = $value; 63 } 64 61 65 # list of the table fields 62 66 if ($key eq "HEAD") { … … 69 73 } 70 74 71 # the IMAGE commands sets up a reference name75 # the ARGS commands defines arguments to FIELDS commands 72 76 if ($key eq "ARGS") { 73 77 push @linkargs, $value; 78 } 79 80 # the TD_CLASS command sets up an alternate TD class 81 if ($key eq "TD_CLASS") { 82 $tdClass = $value; 83 # print STDERR "found TD_CLASS\n"; 74 84 } 75 85 … … 151 161 } 152 162 163 # fill in TD_CLASS test 164 if ($line =~ m|// \*\* TD CLASS \*\*|) { 165 &write_td_class; 166 } 167 153 168 # fill in table data 154 169 if ($line =~ m|// \*\* TABLE DATA \*\*|) { … … 164 179 if ($line =~ m|// \*\* TABLE RESTRICTIONS \*\*|) { 165 180 &write_table_restrict; 181 } 182 183 # fill in table restricts 184 if ($line =~ m|// \*\* BUTTON RESTRICTIONS \*\*|) { 185 &write_button_restrict; 166 186 } 167 187 … … 200 220 for ($i = 0; $i < @field; $i++) { 201 221 if ($show[$i] eq "none") { next; } 202 printf FILE "echo \"<th class=\\\"list\\\"> $name[$i] </th>\\n\";\n"; 203 } 222 # printf FILE "echo \"<th class=\\\"list\\\"> $name[$i] </th>\\n\";\n"; 223 printf FILE "write_table_header (\"list\", \"$name[$i]\", \"$field[$i]\", \$buttonLink, \$ID, '$myFile');\n"; 224 } 225 } 226 227 sub write_td_class { 228 my ($field, $testline); 229 230 if ($tdClass eq "") { return; } 231 # print STDERR "write TD CLASS: $tdClass...\n"; 232 233 # TD_CLASS class field expression 234 ($class, $field, $testline) = split (" ", $tdClass, 3); 235 236 $field = &parse_fieldname ($field); 237 238 printf FILE " if ($field $testline) {\n"; 239 printf FILE " \$class = \"$class\";\n"; 240 printf FILE " }\n"; 204 241 } 205 242 … … 208 245 209 246 if ($WHERE) { 210 printf FILE "\$WHERE = \" $WHERE\";\n";247 printf FILE "\$WHERE = \"WHERE $WHERE\";\n"; 211 248 } 212 249 for ($i = 0; $i < @field; $i++) { … … 215 252 printf FILE "\$WHERE = check_restrict ('$value', \$WHERE);\n"; 216 253 } 254 printf FILE "\$WHERE = check_ordering (\$WHERE);\n"; 255 } 256 257 # generate a button link entry for each field (field != *) 258 sub write_button_restrict { 259 260 for ($i = 0; $i < @field; $i++) { 261 $value = $field[$i]; 262 if ($value eq "*") { next; } 263 printf FILE "\$buttonLink = button_restrict ('$value', \$buttonLink);\n"; 264 } 217 265 } 218 266 … … 228 276 if ($label eq "none") { next; } 229 277 230 if (($label eq "value") && !$link[$i]) { 231 # print value without link or image 232 if (! $value && ($field[$i] ne "*")) { $value = "\$row[$Nrow]"; } 233 print FILE " echo \"<td class=\\\"list\\\"> $value </td>\\n\";\n"; 234 next; 235 } 236 237 if (($label eq "value") && $link[$i]) { 278 if ($label eq "value") { 238 279 # create the basic link variable 239 printf FILE " \$link = \"$link[$i]\" . \"?menu=$MENU&\" . \$ID['link'];\n"; 240 # add extra GET data to target 241 if ($extras[$i]) { &parse_extras ($linkarg{$extras[$i]}); } 280 if ($link[$i]) { 281 printf FILE " \$link = \"$link[$i]\" . \"?menu=$MENU&\" . \$ID['link'];\n"; 282 # add extra GET data to target 283 if ($extras[$i]) { &parse_extras ($linkarg{$extras[$i]}); } 284 $myLink = "\$link"; 285 } else { 286 $myLink = "\"\""; 287 } 242 288 # print the actual table cell line with the link... 243 289 if (! $value && ($field[$i] ne "*")) { $value = "\$row[$Nrow]"; } 244 printf FILE " echo \"<td class=\\\"list\\\"><a href=\\\"\$link\\\"> $value </a></td>\\n\";\n";290 printf FILE " write_table_cell (\$class, $myLink, $value);\n"; 245 291 next; 246 292 } … … 248 294 if (($label eq "image") && !$link[$i]) { 249 295 # print the actual table cell line with the image... 250 printf FILE " echo \"<td class=\\\" list\\\"><img src=\\\"$image{$value}\\\"></td>\\n\";\n";296 printf FILE " echo \"<td class=\\\"\$class\\\"><img src=\\\"$image{$value}\\\"></td>\\n\";\n"; 251 297 next; 252 298 } … … 258 304 if ($extras[$i]) { &parse_extras ($linkarg{$extras[$i]}); } 259 305 # print the actual table cell line with the link... 260 printf FILE " echo \"<td class=\\\" list\\\"><a href=\\\"\$link\\\"> <img src=\\\"$image{$value}\\\"> </a></td>\\n\";\n";306 printf FILE " echo \"<td class=\\\"\$class\\\"><a href=\\\"\$link\\\"> <img src=\\\"$image{$value}\\\"> </a></td>\\n\";\n"; 261 307 next; 262 308 } … … 401 447 my ($i); 402 448 449 # print STDERR "variable: $variable\n"; 450 403 451 unless ($variable =~ m|^\$|) { 404 452 return $variable; … … 407 455 $fieldname = substr ($variable, 1); 408 456 409 print STDERR "fieldname: $fieldname\n";410 411 for ($i = 0; $i < @field; $i++) { 412 print STDERR "$i: $field[$i] : $fieldname\n";457 # print STDERR "fieldname: $fieldname\n"; 458 459 for ($i = 0; $i < @field; $i++) { 460 # print STDERR "$i: $field[$i] : $fieldname\n"; 413 461 414 462 if ($field[$i] eq "*") { next; } … … 420 468 $value = "\$row[$Nrow]"; 421 469 422 print STDERR "found : $i : $count[$i] : $Nrow : $value\n";470 # print STDERR "found : $i : $count[$i] : $Nrow : $value\n"; 423 471 return $value; 424 472 }
Note:
See TracChangeset
for help on using the changeset viewer.
