Class: Deplate::Formatter::HTML_Site

Inherits:
Object
  • Object
show all
Defined in:
lib/deplate/mod/navbar-png.rb

Overview

mod-navbar1.rb @Author: Thomas Link (micathom AT gmail com) @Website: deplate.sf.net/ @License: GPL (see www.gnu.org/licenses/gpl.txt) @Created: 14-Aug-2004. @Revision: 0.80

Description:

Usage:

TODO:

CHANGES:

Instance Method Summary collapse

Instance Method Details

#prepare_navbar_pngObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/deplate/mod/navbar-png.rb', line 20

def prepare_navbar_png
    type = @deplate.variables['buttonsColour']
    fileformat = @deplate.variables['buttonsFileFormat'] || 'png'
    if type
        type = "-%s.%s" % [type, fileformat]
    else
        type = ".%s" % fileformat
    end
    hi = @deplate.variables['buttonsHighlight']
    if hi
        setup_highlight_image
    end
    [
        'prev',
        'home',
        'next',
        'go'
    ].each do |button|
        btn   = "navbar_#{button}"
        img   = "#{button}#{type}"
        hiimg = hi ? "hi-#{img}" : nil
        alt   = button.capitalize
        @deplate.variables["#{button}Button"] = include_image(nil, 
                                                              # img_url(img), 
                                                              img, 
                                                              {'hi' => hiimg, 'alt' => alt, 'id' => btn, :raw => true},
                                                              true
                                                             )
    end
end