2 dsetting = "opac.default_list";
3 tclass = "temporary divider";
5 # Wrap a url to open in a new tab in staff client.
6 MACRO opac_wrap(url) BLOCK;
7 IF ctx.is_staff AND NOT ctx.is_browser_staff;
8 # void(0) to return false and not go to new page in current tab.
9 "javascript:xulG.new_tab(xulG.urls.XUL_OPAC_WRAPPER, {}, {'opac_url' : 'oils://remote" _ url _ "'});void(0);";
16 # Results table context
19 rec_anchor = 'record_' _ ctx.bre_id;
21 # Record details context
22 rec_anchor => ctx.bre_id;
25 record_title = attrs.title; # same for either context
27 IF ctx.user_setting_map.defined(dsetting);
28 default_list = ctx.user_setting_map.$dsetting;
31 IF (!default_list) && ctx.bookbags.size;
35 href = opac_wrap(mkurl(ctx.opac_root _ '/mylist/add', {
36 record => ctx.bre_id, anchor => rec_anchor
40 <li><a href="#" class="no-dec">
41 <img src="[% ctx.media_prefix %]/images/clipboard.png[% ctx.cache_key %]"
42 [% html_text_attr('alt',
43 l('Add item to a list: [_1]', record_title)) %]/>
44 [% l("Add to my list") %]
48 label = (ctx.default_bookbag) ? ctx.default_bookbag : l('Default List');
49 class = (ctx.bookbags.size) ? "default divider" : "default";
50 href = opac_wrap(mkurl(ctx.opac_root _ '/myopac/list/update', {
51 action => 'add_rec', list => default_list,
52 record => ctx.bre_id, anchor => rec_anchor
55 <li class="[% class %]"><a href="[% href %]">[% label %]</a></li>
57 [% IF ctx.bookbags.size;
59 FOREACH bag IN ctx.bookbags;
60 href = opac_wrap(mkurl(ctx.opac_root _ '/myopac/list/update', {
61 action => 'add_rec', list => bag.id, record => ctx.bre_id,
65 IF i == ctx.bookbags.size;
71 <a href="[% href %]">[% bag.name %]</a>
78 <a href="[% opac_wrap(mkurl(ctx.opac_root _ '/myopac/lists', {
79 limit => ctx.bookbag_count, add_rec => ctx.bre_id,
80 anchor => rec_anchor })) %]"
81 title="[% l('See all of my lists') %]">
86 <a href="[% opac_wrap(mkurl(ctx.opac_root _ '/myopac/lists', {
87 add_rec => ctx.bre_id, anchor => rec_anchor
89 [% l('Add to new list') %]