aboutsummaryrefslogtreecommitdiff
path: root/dudle.rb
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2010-01-25 15:10:13 +0100
committerBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2010-01-25 15:10:13 +0100
commit54af56748cafd9a141efd3d1c54bab798b0a12f7 (patch)
tree9505de1293536d2363b903f224844cb109bde357 /dudle.rb
parent045daaf0bdba1d80f230661fd09757ce0c0d160c (diff)
add possibility to add extensions
Diffstat (limited to 'dudle.rb')
-rw-r--r--dudle.rb23
1 files changed, 19 insertions, 4 deletions
diff --git a/dudle.rb b/dudle.rb
index f6981e0..e7e9239 100644
--- a/dudle.rb
+++ b/dudle.rb
@@ -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