Module: VersionsHelper
- Defined in:
- app/helpers/versions_helper.rb
Instance Method Summary collapse
-
#form_tabs ⇒ Object
Find the list of tabs for the popup when editing a node.
Instance Method Details
#form_tabs ⇒ Object
Find the list of tabs for the popup when editing a node. To add a tab for some document class, create a file named ‘_ClassName.rhtml’ in the folder ‘app/views/templates/edit_tabs’.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/helpers/versions_helper.rb', line 4 def form_tabs tabs = ['text', 'title'] klass = nil @node.class.ancestors.map { |a| a.to_s.downcase }.each do |k| if File.exists?(File.join(Zena::ROOT, 'app', 'views', 'templates', 'edit_tabs', '_' + k + '.rhtml')) klass = k break end break if k == 'node' end tabs << klass if klass tabs << 'custom' tabs << 'help' end |