/
meta_info.coretag
50 lines (43 loc) · 1.2 KB
/
meta_info.coretag
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Copyright 2002-2007 Interchange Development Group and others
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. See the LICENSE file for details.
UserTag meta-info Order table column key
UserTag meta-info attrAlias col column
UserTag meta-info addAttr
UserTag meta-info Version 1.4
UserTag meta-info Routine <<EOR
sub {
my ($table, $col, $key, $opt) = @_;
my $item;
if($table) {
$item = $table;
$item .= "::$col" if $col;
}
$item ||= $opt->{item} or return undef;
my $meta;
my $mdb;
if($opt->{meta_table}) {
$mdb = dbref($opt->{meta_table});
}
my @tries = $item;
if($opt->{specific}) {
unshift @tries, $item . "::$opt->{specific}";
}
for(@tries) {
$meta = Vend::Table::Editor::meta_record(
$_,
$opt->{view},
$mdb,
$opt->{extended_only},
)
and last;
}
return undef unless $meta;
#::logDebug("Got meta record back, looking for $key: " . ::uneval($meta));
return errmsg($meta->{$key}) if $opt->{localize};
return $meta->{$key};
}
EOR