module View (@@proc_table ||= {})['album_page'] = proc do _buf = ""; _buf << "\n"; pagename='albums' _buf << "\n"; language=nil _buf << " Giovanni Ferro - "; _buf << ERB::Util.h(@album.name); _buf << "
\n"; if pagename=='index' then _buf << " Home\n"; end if pagename!='index' then _buf << " Home\n"; end _buf << " | \n"; if pagename=='albums' then _buf << " Albums\n"; end if pagename!='albums' then _buf << " Albums\n"; end _buf << " | \n"; if pagename=='guestbook' then _buf << " Guestbook\n"; end if pagename!='guestbook' then _buf << " Guestbook \n"; end _buf << " | \n"; if pagename=='cv' then _buf << " Curriculum\n"; end if pagename!='cv' then _buf << " Curriculum\n"; end _buf << " | \n"; if pagename=='contactme' then _buf << " Contact Me\n"; end if pagename!='contactme' then _buf << " Contact Me\n"; end _buf << " - style: 1 | 2 \n"; if not language.nil? then _buf << " - lang: \n"; if language=='it' then _buf << " it \n"; end if language!='it' then _buf << " it \n"; end _buf << " |\n"; if language=='en' then _buf << " en \n"; end if language!='en' then _buf << " en \n"; end end _buf << "
\n"; if @album.leaves.length>0 then _buf << " \n"; end _buf << " \n"; if @album.leaves.length>0 then _buf << " \n"; end _buf << " \n"; if @album.childs.length>0 then _buf << " \n"; end _buf << " \n"; if @album.childs.length>0 then _buf << " \n"; end _buf << "
\n"; if not @album.root? then _buf << " \n"; end _buf << "
\n"; item_ctr = 0 for item in @album.breadcrumbs item_ctr += 1 if item_ctr > 1 _buf << " ::\n"; end item_path = item[:path] # retrieve path and item_title = item[:title] # title from a hash if item_path.nil? # if path is null then _buf << (item_title).to_s; else _buf << " \n"; _buf << (item_title).to_s; _buf << " \n"; end end _buf << " "; _buf << ERB::Util.h(@album.nr_leaves); _buf << " "; _buf << ERB::Util.h(@resource.photos); _buf << "\n"; if @album.nr_childs>0 then _buf << " "; _buf << ERB::Util.h(@album.nr_childs); _buf << " sub-albums\n"; end _buf << "
"; _buf << ERB::Util.h(@album.description); _buf << " \"Top\"/   \"Up\"/    
"; _buf << ERB::Util.h(@resource.thumbnails); _buf << "
\n"; start_pos = 1 while start_pos <= @album.leaves.length idx = start_pos _buf << " \n"; while idx <= @album.leaves.length && idx % 7 != 0 photo = @album.leaves[ idx-1 ] _buf << " \n"; idx += 1 end _buf << " \n"; idx = start_pos _buf << " \n"; while idx <= @album.leaves.length && idx % 7 != 0 photo = @album.leaves[ idx-1 ] _buf << " \n"; idx += 1 end _buf << " \n"; start_pos += 7 end _buf << "
\"Giovanni
"; _buf << ERB::Util.h(photo.name); _buf << "
"; _buf << ERB::Util.h(@resource.subalbums); _buf << "
\n"; col = 1 for subalbum in @album.childs if col == 1 _buf << " \n"; end _buf << " \n"; col += 1 if col == 3 col = 1 _buf << " \n"; end end if col != 1 _buf << " \n"; end _buf << "
\""; "; _buf << ERB::Util.h(subalbum.name); _buf << "
"; _buf << ERB::Util.h(subalbum.nr_leaves); _buf << " photos\n"; if subalbum.nr_childs>0 then _buf << " , "; _buf << ERB::Util.h(subalbum.nr_childs); _buf << " sub-albums\n"; end _buf << "
"; _buf << ERB::Util.h(subalbum.description); _buf << "
Copyright © 2002-2004, Giovanni Ferro
\"Valid     \"Valid
\n"; ; _buf end#proc module_function def expand_album_page(context={}) if context.is_a?(Hash) hash = context context = Object.new hash.each { |key, val| context.instance_variable_set("@#{key}", val) } end proc_obj = @@proc_table['album_page'] context.instance_eval(&proc_obj) end end