diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0c6f1fc..b33fc85 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -493,14 +493,43 @@ module ApplicationHelper content_tag('div', result) end - def theme_javascript() + def theme_option( opt=nil ) conf = RAILS_ROOT.to_s() + '/public/designs/themes/' + current_theme.to_s() + '/theme.yml' - js = File.exists?(conf) ? YAML.load_file(conf)['js'] : [] + if File.exists?(conf) + opt ? YAML.load_file(conf)[opt.to_s()] : YAML.load_file(conf) + else + nil + end + end + + def theme_opt_menu_search + opt = theme_option( :menu_search ) + if opt == 'none' + "" + elsif opt == 'simple_search' + s = _('Search...') + '
' + else #opt == 'lightbox_link' is default + lightbox_link_to ''+ _('Search'), { + :controller => 'search', + :action => 'popup', + :category_path => (@category ? @category.explode_path : []) }, + :id => 'open_search' + end + end + + def theme_javascript html = [] - js.each do |file| + theme_option(:js).each do |file| file = '/designs/themes/'+ current_theme.to_s() + '/javascript/'+ file +'.js' if File.exists? RAILS_ROOT.to_s() +'/public'+ file diff --git a/app/helpers/assets_helper.rb b/app/helpers/assets_helper.rb index 7534c51..2257cb2 100644 --- a/app/helpers/assets_helper.rb +++ b/app/helpers/assets_helper.rb @@ -12,7 +12,11 @@ module AssetsHelper [ options.merge(:asset => 'comments'), "icon-menu-comments", _('Comments') ], ].map do |target,css_class,name| - content_tag('li', link_to(content_tag('span', '', :class => css_class) + name, target)) + content_tag('li', + link_to( + content_tag('span', '', :class => css_class) + + content_tag('strong', name), + target )) end.join("\n") end diff --git a/app/views/layouts/application.rhtml b/app/views/layouts/application.rhtml index 66113c7..feac27c 100644 --- a/app/views/layouts/application.rhtml +++ b/app/views/layouts/application.rhtml @@ -78,6 +78,9 @@