[interchange] Removed unused bar_link sub
Josh Lavin <[email protected]> Thu, 01 Sep 2016 16:22:45 +0000
| Newsgroups | gmane.comp.web.interchange.cvs |
|---|---|
| Message-ID | <[email protected]> |
commit b0c0d8926525a50ca8cabad0bcc291243896fb8c Author: Josh Lavin <[email protected]> Date: Thu Sep 1 09:20:20 2016 -0700 Removed unused bar_link sub Doesn't work under IC 5.10, would have to be a GlobalSub. Also isn't called by demo catalog, so opting to remove. dist/catalog_before.cfg | 125 ----------------------------------------------- 1 files changed, 0 insertions(+), 125 deletions(-) --- diff --git a/dist/catalog_before.cfg b/dist/catalog_before.cfg index 1e9db16..1e9c2d3 100644 --- a/dist/catalog_before.cfg +++ b/dist/catalog_before.cfg @@ -57,128 +57,3 @@ 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