Fix handling of extra_query_params in Business::OnlinePayment wrapper.
[interchange.git] / code / UI_Tag / meta_info.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 # $Id: meta_info.coretag,v 1.4 2007-03-30 23:40:54 pajamian Exp $
9
10 UserTag meta-info Order      table column key
11 UserTag meta-info attrAlias  col column
12 UserTag meta-info addAttr
13 UserTag meta-info Version    $Revision: 1.4 $
14 UserTag meta-info Routine    <<EOR
15 sub {
16         my ($table, $col, $key, $opt) = @_;
17
18         my $item;
19         if($table) {
20                 $item = $table;
21                 $item .= "::$col" if $col;
22         }
23
24         $item ||= $opt->{item} or return undef;
25         my $meta;
26         my $mdb;
27
28         if($opt->{meta_table}) {
29                 $mdb = dbref($opt->{meta_table});
30         }
31         
32         my @tries = $item;
33
34         if($opt->{specific}) {
35                 unshift @tries, $item . "::$opt->{specific}";
36         }
37
38         for(@tries) {
39                 $meta = Vend::Table::Editor::meta_record(
40                                                                 $_,
41                                                                 $opt->{view},
42                                                                 $mdb,
43                                                                 $opt->{extended_only},
44                                                         )
45                                 and last;
46         }
47         return undef unless $meta;
48 #::logDebug("Got meta record back, looking for $key: " . ::uneval($meta));
49         return errmsg($meta->{$key}) if $opt->{localize};
50         return $meta->{$key};
51 }
52 EOR