Method: ContextHelp::Base.html_help

Defined in:
lib/context_help/base.rb

.html_help(options) ⇒ Object



100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/context_help/base.rb', line 100

def self.html_help(options)
  if options[:help_builder].is_a?(Proc) 
    options[:help_builder].call(options)
  elsif options[:calculated_path]
    title = Helpers.get_title(options)
    text = Helpers.get_text(options)
    return '' if (title.nil? || text.nil?) and !(Rails.env.development? and @config[:show_missing])

    html = "<#{options[:title_tag]} id=\"#{options[:item_id]}\" class=\"#{options[:title_class]} #{options[:level_class]}\">#{title}</#{options[:title_tag]}>
    <#{options[:text_tag]} class=\"#{options[:text_class]} #{options[:level_class]}\">#{text}</#{options[:text_tag]}>"
    html += self.link_to_object(options)
    html
  end
end