Also look in the next-highest directory when detecting VCS; add SVN
[interchange.git] / code / UI_Tag / widget.coretag
1 # Copyright 2002-2007 Interchange Development Group and others
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.  See the LICENSE file for details.
7
8 UserTag widget Order       name
9 UserTag widget PosNumber   1
10 UserTag widget attrAlias   db table
11 UserTag widget attrAlias   column field
12 UserTag widget attrAlias   outboard key
13 UserTag widget addAttr
14 UserTag widget HasEndTag   1
15 UserTag widget Interpolate 1
16 UserTag widget Version     1.6
17 UserTag widget Routine     <<EOR
18 sub {
19         my($name, $opt, $string) = @_;
20         #my($name, $type, $value, $table, $column, $key, $data, $string) = @_;
21         my $value;
22         
23         if(defined $opt->{set}) {
24                 $value = $opt->{set};
25         }
26         else {
27                 $value = $::Values->{$name} || $opt->{default};
28         }
29         if($opt->{pre_filter}) {
30 #::logDebug("pre-filter with $opt->{pre_filter}");
31                 $value = $Tag->filter($opt->{pre_filter}, $value);
32         }
33         my $ref = {
34                                 attribute       => $opt->{attribute} || 'attribute',
35                                 db                      => $opt->{table},
36                                 field           => $opt->{field},
37                                 extra           => $opt->{extra} || $opt->{js},
38                                 cols            => $opt->{cols},
39                                 delimiter       => $opt->{delimiter},
40                                 rows            => $opt->{rows} || undef,
41                                 name            => $name,
42                                 outboard        => $opt->{key},
43                                 passed          => $opt->{data} || $opt->{passed} || $string,
44                                 type            => $opt->{type} || 'select',
45                                 value           => $value,
46                                 };
47
48         my $w = Vend::Form::display($ref);
49         if($opt->{filter}) {
50                 $w .= qq{<INPUT TYPE=hidden NAME="ui_filter:$name" VALUE="};
51                 $w .= $opt->{filter};
52                 $w .= '">';
53         }
54         return $w;
55 }
56 EOR