forked from brianjmiller/interchange_ep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcatalog_before.cfg
184 lines (168 loc) · 4.88 KB
/
catalog_before.cfg
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
ParseVariables Yes
ifdef @UI_BASE
Variable UI_BASE @@UI_BASE@@
endif
ifndef UI_BASE
Variable UI_BASE admin
endif
ifdef @LockType ne 'none'
Variable UI_LOCKING 1
endif
Variable INTERCHANGE_EMAIL [email protected]
Variable INTERCHANGE_URL http://www.icdevgroup.org/
ifdef @UI
Variable UI_ABOUT_LOGIN_URL http://www.icdevgroup.org/
Variable UI_ABOUT_NORMAL_URL http://www.icdevgroup.org/
Variable UI_ACCESS_TABLE access
Variable UI_BOTTOMIMG poweredby.gif
Variable UI_HELP_HEIGHT 480
Variable UI_HELP_WIDTH 650
Variable UI_LEFT_WIDTH 150
Variable UI_SHIPPED_STATUS shipped
Variable UI_MAIN_WIDTH 600
Variable UI_META_TABLE mv_metadata
Variable UI_PRODUCT_DIR products
Variable UI_PAGE_DIR pages
Variable UI_OVERALL_WIDTH 750
Variable UI_P_ALINK #CC3333
Variable UI_P_BG #FFFFFF
Variable UI_P_LINK #CC3333
Variable UI_P_VLINK #FF3333
Variable UI_RIGHT_WIDTH 450
Variable UI_SZ_LIST_CUSTOMER 50
Variable UI_SZ_LIST_ORDER 50
Variable UI_T_BG beige
Variable UI_T_PROPERTIES cellpadding=3 cellspacing=0 width=90% border=0
Variable UI_T_ROW_EVEN #EEEEEE
Variable UI_T_ROW_ODD #FFFFFF
Variable UI_TOP_BG #CC0000
Variable UI_ITEM_TABLES products pricing inventory merchandising options:sku
Database ichelp ichelp.txt TAB
Database ichelp PRELOAD lib/UI/ichelp.txt
Database ichelp PRELOAD_EMPTY_ONLY 1
Database ichelp HIDE_EDIT 1
Database ichelp AUTO_EXPORT __UI_LOCKING__
endif
ParseVariables No
## Deprecated, could be removed in IC 5.2
Variable MV_DEFAULT_SEARCH_FILE products
Variable MV_DEFAULT_SEARCH_TABLE products
Sub <<EOR
sub bar_link {
my $base = shift || 'cat';
my $extra;
$base =~ s/(\W.*)//s
and $extra = $1;
my $ref = shift;
my $code = $ref->[0];
my $record = tag_data($base, 'n/a', $code, { hash => 1 });
return $ref->[0] unless $record;
my $url;
my $anchor;
my $highlight;
my $first;
my $expand;
LINK: {
if($record->{link_type} eq 'external') {
$first = $record->{url};
$first =~ s/\s+$//;
$first =~ s/^\s+//;
$url = $first;
}
elsif ($record->{link_type} eq 'internal') {
my ($page, $form) = split /\s+/, $record->{url}, 2;
my $current = $Tag->var('MV_PAGE', 1);
$highlight = 1 if $page eq $current
or
$page eq $CGI->{ui_explode};
$url = $Tag->area( { href => $page, form => $form });
}
elsif ($record->{link_type} eq 'simple') {
my (@items) = split /\s*[\n,]\s*/, $record->{selector};
my @out;
my $fi = $record->{tab};
my $sp = $record->{page};
my %options = (
href => 'scan',
);
push @out, "fi=$fi" if $fi;
push @out, "sp=$sp" if $sp;
push @out, "st=db";
if(! @items) {
push @out, "ra=yes";
$options{arg} = join "\n", @out;
$url = $Tag->area(\%options);
last LINK;
}
push @out, "co=yes";
for(@items) {
my ($col, $string) = split /\s*=\s*/;
push @out, "sf=$col";
push @out, "se=$string";
push @out, "op=eq";
}
push @out, $record->{search}
if $record->{search} =~ /^\s*\w\w=/;
push @out, qq{va=banner_image=$record->{banner_image}} if ($record->{banner_image});
push @out, qq{va=banner_text=$record->{banner_text}} if ($record->{banner_text});
$options{arg} = join "\n", @out;
$url = $Tag->area(\%options);
}
elsif ($record->{link_type} eq 'complex') {
$record->{search} =~ s/[\r\n+]/\n/g;
$record->{search} .= qq{\nva=banner_text=$record->{banner_text}} if ($record->{banner_text});
$record->{search} .= qq{\nva=banner_image=$record->{banner_image}} if ($record->{banner_image});
$url = $Tag->area('scan', $record->{search});
}
else {
$url = "";
}
}
ANCHOR: {
my $display_text = $record->{banner_text} || $record->{name};
$display_text =~ s/"/"/g;
if($record->{display_type} eq 'url') {
$anchor = "";
}
elsif ($record->{display_type} eq 'name') {
$anchor = $display_text;
}
elsif ($record->{display_type} eq 'icon') {
$anchor = qq{<img src="$record->{image}" alt="$display_text"};
$anchor .= " $record->{image_prop}"
if $record->{image_prop};
$anchor .= '>';
$anchor .= $display_text;
}
elsif ($record->{display_type} eq 'image') {
$anchor = qq{<img src="$record->{image}" alt="$display_text"};
$anchor .= " $record->{image_prop}"
if $record->{image_prop};
$anchor .= '>';
}
else {
$anchor = $display_text;
}
}
return $url if ! $anchor;
return $anchor if ! $url;
EXPAND: {
if ($url =~ /\?/) {
$expand = "&expand=$code";
}
else {
$expand = "?expand=$code";
}
}
my $tmpl = $record->{link_template}
|| $extra
|| $Variable->{BAR_LINK_TEMPLATE}
|| q{<A HREF="$URL$" class=barlink>$ANCHOR$</A>};
$record->{ANCHOR} = $anchor;
$record->{EXPAND} = $expand;
$record->{URL} = $url;
$tmpl =~ s!{HIGHLIGHT}(.*?){/HIGHLIGHT}! $highlight ? $1 : '' !gise;
$tmpl =~ s/\$(\w+)\$/$record->{$1}/g;
return $tmpl;
}
EOR