diff options
author | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2010-01-25 15:10:13 +0100 |
---|---|---|
committer | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2010-01-25 15:10:13 +0100 |
commit | 54af56748cafd9a141efd3d1c54bab798b0a12f7 (patch) | |
tree | 9505de1293536d2363b903f224844cb109bde357 | |
parent | 045daaf0bdba1d80f230661fd09757ce0c0d160c (diff) |
add possibility to add extensions
-rw-r--r-- | .bzrignore | 4 | ||||
-rw-r--r-- | dudle.rb | 23 |
2 files changed, 21 insertions, 6 deletions
@@ -1,5 +1,5 @@ -intern config.rb -css/* locale/dudle.pot locale/de/dudle.mo +css/* +extensions/* @@ -35,7 +35,7 @@ require "config" require "charset" class Dudle - attr_reader :html, :table, :urlsuffix, :css, :title + attr_reader :html, :table, :urlsuffix, :css, :title, :tab def tabs(active_tab) ret = "<div id='tabs'><ul>" tabs = [] @@ -145,6 +145,15 @@ class Dudle <div id='content'> <h1>#{@title}</h1> HEAD + + + ################### + # init extenisons # + ################### + @extensions = [] + Dir.open("#{@basedir}/extensions/").each{|f| + @extensions << f if File.exists?("#{@basedir}/extensions/#{f}/main.rb") + } end def wizzard_nav @@ -195,10 +204,16 @@ READY @html << long @html << "</a>" unless short == GetText.locale.language } - @html << "</div>" + @html << "</div>" # languageChooser + + @html << "</div>" # content + @html << "</div>" # main + + @extensions.each{|e| + require "#{@basedir}/extensions/#{e}/main" + } - @html << "</div>" - @html << "</div></body>" + @html << "</body>" @html.out(@cgi) end |