[% action_links = [ { permission => 'search', label => 'Search', ico => 'search' } { permission => 'register', label => 'Register', ico => 'person' } { permission => 'modify_results', label => 'WorkList', ico => 'note' } { permission => 'print_all', label => 'PrintRun', ico => 'print' } { permission => 'search', label => 'Resources', ico => 'scissors' } { permission => 'do_admin', label => 'Admin', ico => 'wrench' } ]; IF c.cfg('settings').have_hmrn AND c.user_can('hmrn_admin'); action_links.push({ permission => 'search', label => 'HMRN', ico => 'foo' }); END; %] [% # PROCESS dumper.tt dump = active_link %]
| [% FOREACH action_links; NEXT UNLESS c.user_can(permission); re = '(?i)' _ label; # see VMethods matches = active_link.match(re); # admin tab on its own: NEXT IF active_link.match('admin') AND label != 'Admin'; %] [% END %] [% user.first_name | ucfirst %] [% user.last_name | ucfirst %] [% IF active_link.match('admin') %] [close window] [% ELSE %] [log out] [% END %] | [% END %]
|
[% c.cfg('settings').application_name %] » [% # my.meta_title defined in .tt: template.title || my.meta_title || action | ucfirst %] runtime: %SCRIPTRUNTIMER% [% USE date(format = '%a %d %B %Y @ %R', locale = 'en_GB'); date.format # time.strftime('%a %d %B %Y @ %R %Z') %]