File: menu

package info (click to toggle)
libtemplate-perl 2.14-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 5,496 kB
  • ctags: 667
  • sloc: perl: 15,349; makefile: 62; xml: 7; sh: 5
file content (19 lines) | stat: -rw-r--r-- 608 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[%# menu: generate sequence of buttons with optional left/right/select
  # ARGS:
  #	buttons = [ # list of buttons
  #	    { link => 'page1.html', text => 'First Page' },
  #	    { link => 'page2.html', text => 'Second Page' },
  #	      ...
  #	],
  #	select	    # item to select in range 1 to n (0: none)
  #	left	    # add left arrowhead to first item
  #	right	    # add right arrowhead to last item
-%]
[%  INCLUDE html/button 
	link   = b.link
	text   = b.text
	left   = loop.first ? left  : 0
	right  = loop.last  ? right : 0
	select = (select == loop.count) ? select : 0
    FOREACH b = buttons 
-%]