/
mm_value.coretag
53 lines (48 loc) · 1.33 KB
/
mm_value.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
51
52
53
# 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 mm-value Order field table
UserTag mm-value addAttr
UserTag mm-value Version $Revision: 1.4 $
UserTag mm-value Routine <<EOR
sub {
my($field, $table, $opt, $text) = @_;
my $record;
my $status;
my $reverse;
my $uid = $opt->{user};
unless ($record = $Vend::UI_entry) {
return '' unless ref($record = ui_acl_enabled());
}
#::logDebug("mm-value record: " . ::uneval($record));
$table = $opt->{table} || $::Scratch->{ui_data_table};
if($field eq 'user') {
return $Vend::Session->{ui_username} || $Vend::Session->{username} || $CGI::user;
}
my %hash_field = qw/
acl_keys 1
no_fields 1
yes_fields 1
no_keys 1
yes_keys 1
owner_field 1
/;
my $acl;
my $check;
if($check = $hash_field{$field}) {
if ($field eq 'acl_keys') {
return join "\n", get_ui_table_acl($table, $uid, 1);
}
else {
$acl = get_ui_table_acl($table, $uid);
return $acl->{$field};
}
}
else {
return $record->{$field};
}
}
EOR