# # say ( @ ) .. Utility routine to output to stderr on generation # sub say { local ( *TTY ); open ( TTY, ">/dev/tty" ); print TTY @_; close ( TTY ); } # # # # extended a with attribute 'once': the link is only generated once per page and language - # all further invocations will be replaced with %body only. # " "" { my $body, $href, $lang, $key, $attr; %body $href = ''; $lang = ''; $key = "$lang" . "-" . "$href"; if ( $ONCELIST {$key} eq qq|$body| ) { $body } else { $ONCELIST {$key} = qq|$body|; $body } } /> %body /> /> # # # # LEGO(R) # LEGO® # # # # { my $email = ''; my $do_show_href = ''; my $href_pattern = ''; my $user, $domain, $body; %body ( $user, $domain ) = ( $email =~ /^([^@]+)@([^@]+)$/ ); $email = "$user--AT--$domain"; if ( $do_show_href ) { if ( $href_pattern ne "" ) { $body =~ s/$href_pattern/$email/; } else { $body = $email; } } $body } # # ... # # Creates a row of clickable thumbnails with an optional comment # { # The $name variable is used in other tags and # so is global $name = ''; { # initialise the data structure for this particular navbar # and fill it with some already known information my $CFG = {}; $IMGLIST{$name} = $CFG; $CFG->{NAME} = $name; $CFG->{SCALE} = ''; $CFG->{REL} = ''; $CFG->{DIR} = ''; $CFG->{THUMBDIR} = ''; $CFG->{IMAGES} = []; } } %body # # comment # # Creates a thumbnail entry in an IMGLIST # { my $tmp; %body my $IMG = {}; push ( @{$IMGLIST{$name}->{IMAGES}}, $IMG); $IMG->{FILE} = ''; $IMG->{THUMBFILE} = ''; $IMG->{THUMBWIDTH} = ''; $IMG->{THUMBHEIGHT} = ''; $IMG->{LABEL} = $tmp; } # # # # Renders the given IMGLIST at the current position #
{ my $name = ''; my $cols = ''; my $CFG = $IMGLIST{$name}; my $scale = $CFG->{SCALE}; my $realcols = $cols + $cols - 1; my $i = 0; foreach my $IMG (@{$CFG->{IMAGES}}) { my $small = $IMG->{THUMBFILE}; my $big = $IMG->{FILE}; my $lbl = $IMG->{LABEL}; my $width = $IMG->{THUMBWIDTH}; my $height = $IMG->{THUMBHEIGHT}; my $firstinrow; my $lastinrow; my $sizetext = ""; $small = "$CFG->{THUMBDIR}/$small" unless ( $small =~ m,^/, || $small =~ m,^http://, ); $big = "$CFG->{DIR}/$big" unless ( $big =~ m,^/, || $big =~ m,^http://, ); $firstinrow = 1 if (( $i % $cols ) == 0 ); $lastinrow = 1 if (( $i % $cols ) == ( $cols - 1 )); #say ( "COLS: $cols, current index: $i, index mod cols: ", $i % $cols, " --> fir: $firstinrow / lir: $lastinrow \n" ); if ( $firstinrow ) { } my $lbltag; if ( $lbl ) { $lbltag = "$lbl"; } # and have to be within on statement !! $sizetext = "width=\"$width\" height=\"$height\"" unless ( $width == 0 || $height == 0 ); if ( $lastinrow ) { } $i++; } if (( $i % $cols ) != ( $cols - 1 )) { }
$lbl$lbltag
}
# # ... # # Shortcut IMGLIST for BrickShelf folders # %body # # # # Shortcut IMGLIST:IMG for BrickShelf folders # %1
    %body
# # ...text... # # Easily create pictured links to subpages (for use on index.wml pages) #
  • <en: Picture of /><de: Bild von />
    %body
  • # # >...text... # # Easily create pictured links to subpages (for use on index.wml pages) # %body # # ] [PICTURE=]>name # # Easily create links to pictures/datasheets for products # %body  picture />  datasheet /> # # ...text... # # Link to an internal page, using the current language # %body