IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 3, 2007, 10:24:09 AM (19 years ago)
Author:
eugene
Message:

better links

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippMonitor/generate

    r13566 r13595  
    7373        }
    7474
    75         # the ARGS commands defines arguments to FIELDS commands
     75        # the ARGS commands define arguments to FIELDS commands
    7676        if ($key eq "ARGS") {
    7777            push @linkargs, $value;
     78        }
     79
     80        # the OP commands define field operations
     81        if ($key eq "OP") {
     82            push @opwords, $value;
    7883        }
    7984
     
    123128    }
    124129
     130    foreach $opword (@opwords) {
     131        &parse_opwords ($opword);
     132    }
     133
    125134    if (0) {
    126135        print STDERR "show: $show[0]\n";
     
    219228    # add column sorting elements here
    220229    for ($i = 0; $i < @field; $i++) {
     230        ($label, $value, $string) = &parse_label ($show[$i]);
    221231        if ($show[$i] eq "none")  { next; }
    222232        # 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";
     233        if ($label eq "op") {
     234            printf FILE "write_table_header (\"list\", \"$name[$i]\", \"$opf{$value}\", \$buttonLink, \$ID, '$myFile');\n";
     235        } else {
     236            printf FILE "write_table_header (\"list\", \"$name[$i]\", \"$field[$i]\", \$buttonLink, \$ID, '$myFile');\n";
     237        }
    224238    }
    225239}
     
    292306        }
    293307
     308        if ($label eq "op") {
     309            # create the basic link variable
     310            if ($link[$i]) {
     311                printf FILE "  \$link = \"$link[$i]\" . \"?menu=$MENU&\" . \$ID['link'];\n";
     312                # add extra GET data to target
     313                if ($extras[$i]) { &parse_extras ($linkarg{$extras[$i]}); }
     314                $myLink = "\$link";
     315            } else {
     316                $myLink = "\"\"";
     317            }
     318            printf FILE "  write_table_cell (\$class, $myLink, $ops{$value});\n";
     319            next;
     320        }
     321
    294322        if (($label eq "image") && !$link[$i]) {
    295323            # print the actual table cell line with the image...
     
    485513}
    486514
     515sub parse_opwords {
     516    my ($value) = $_[0];
     517
     518    @words = split (" ", $value);
     519    $name = shift (@words);
     520
     521    $opline = "";
     522    foreach $word (@words) {
     523        $fword = &parse_fieldname ($word);
     524        push @outwords, $fword;
     525        if ($word =~ m|^\$|) {
     526            $word = substr ($word, 1);
     527        }
     528        push @outfields, $word;
     529    }
     530    $outline = join (" ", @outwords);
     531    $ops{$name} = $outline;
     532    $outline = join (" ", @outfields);
     533    $opf{$name} = $outline;
     534
     535    return 1;
     536}
     537
    487538sub init_key {
    488539    my ($key)   = $_[0];
Note: See TracChangeset for help on using the changeset viewer.