1 [%- USE money = format(l('$%.2f'));
6 SET DATE_FORMAT = l('%m/%d/%Y');
7 PROCESS "opac/parts/config.tt2";
9 # Don't wrap in l() here; do that where this format string is actually used.
10 SET HUMAN_NAME_FORMAT = '[_1] [_2] [_3] [_4] [_5]';
12 is_advanced = CGI.param("_adv").size;
13 is_special = CGI.param("_special").size;
15 # -----------------------------------------------------------------------------
16 # mkurl( destination_page, params_to_set, params_to_clear )
18 # Current page, updated params:
19 # mkurl('', {foo => 'bar', boo => 'baz'});
21 # New page, one param is a list:
22 # mkurl('http://flarg.baz/squz', {foo => 'bar', boo => ['baz', 'faz']});
24 # New page, clear all existing params before applying new ones:
25 # mkurl('/fuz/buster', {foo => 'bar', boo => 'baz'}, 1);
27 # Current page, clear 'some_param' from the existing params:
28 # mkurl('', {foo => 'bar', boo => 'baz'}, ['some_param']);
29 MACRO mkurl(page, params, clear_params) BLOCK;
31 # clone the query string to avoid clobberation
32 cgi = CGI.new(CGI.query_string);
34 # remove requested params
35 IF clear_params.0; # array
36 FOR p IN clear_params; cgi.delete(p); END;
41 # x and y are artifacts of using <input type="image" /> tags
42 # instead of true submit buttons, and their values are never used.
49 list = (params.$k.0 OR max == -1) ? params.$k : [params.$k];
50 IF list.size == 0; NEXT; END;
51 # CGI croaks on already-decoded strings. force-encode to be safe.
52 FOR p IN list; encoded.push(ctx.encode_utf8(p)); END;
53 foo = cgi.param("-name", k, "-values", encoded);
56 # for url brevity, remove any params that have no value
59 IF val == ''; cgi.delete(p); END;
61 # Delete POST vars unless we asked for them
62 UNLESS CGI.url_param(p).defined OR params.defined(p);
69 page _ '?' _ cgi.query_string;
74 # staying on the current page
75 cgi.url("-path" => 1, "-query" => 1);
79 # Whether we want Dojo or not may one day be a wholly distinct
80 # concern from whether we want autosuggest, so let's get used to
81 # defining that separately.
84 use_autosuggest = ctx.get_cgf("opac.use_autosuggest");
86 IF use_autosuggest.enabled == "t";