' : ""
inner = "#{span}#{text}" +
"#{tip}"
link_to inner, href, :class=>'linkhastip', :tabindex=>'0'
end
# This helper constructs a text link optionally followed by an image
# link which, when clicked, will open a popup box in the window
# populated by a page from the installation's help wiki. The markup
# generated ensures that word-wrap in the browser will not separate
# the help icon from the link that precedes it. The helper's
# parameters are packaged in a single hash argument. The symbols
# used to index the argument hash are:
#
# [:destination] The value in the hash associated with :destination should be a complete HTML link, such as the return value from the Rails' helper link_to.
# [:already_generated] The value in the hash associated with :already_generated will be evaluated as a boolean to determine whether a popup help icon (image link) should be generated by this call to link_with_help_icon. When it evaluates to false/nil (including simply not being present in the argument hash at all), HTML for a help icon _is_ generated/returned.
# [:help_alt] The string in the hash associated with :help_alt will be used as the value for the +alt+ attribute of the anchor tag for the help icon/link (if generated). (The +alt+ tag, if any, for :destination should be incorporated in the link's markup before it is passed to this helper.)
# [:which_help] The string in the hash associated with :which_help is used as a component in the URL to the desired page from the installation's help wiki. It is combined with the installation's popup_url_prefix configuration value (see popup_help_icon) after being prefixed with Help:Popup/. That is, this helper assumes that within the help wiki, the content for all help displayed in a popup box in the page is stored as a sub-page of the help wiki's page +Popup+ within the wiki's namespace +Help+.
# [:text] The _optional_ value in the hash associated with :text will, if present, be included in the generated HTML between the content of :destination and the generated help icon. See the +text+ argument to popup_help_icon.
def link_with_help_icon( params )
help_link = ''
unless params[:already_generated]
unless params.has_key?(:help_alt)
raise ArgumentError, "Missing :help_alt entry from parameter hash"
end
unless params.has_key?(:which_help)
raise ArgumentError, "Missing :which_help entry from parameter hash"
end
help_link = popup_help_icon params[:help_alt],
("Help:Popup/" + params[:which_help]), params[:text]
end
unless params.has_key?(:destination)
raise ArgumentError, "Missing :destination entry from parameter hash"
end
return content_tag( 'span', params[:destination] + help_link,
:style => "white-space: nowrap;" ) + " "
end
def logo_image
result = ''
if WontoMedia.site_logo_title
result += "#{WontoMedia.site_logo_title}
\n"
end
logo_name = (File.exists?(
Rails.root.join( 'public', 'images', 'logo.jpg'))) ?
'/images/logo.jpg' :
'/images/logo.png'
result += image_tag( logo_name, :alt=>'Logo', :width=>'99%',
:style=>'margin-bottom: 0.7ex;' )
result
end
def allpages_alert
if File.exists? Rails.root.join(
'app', 'views', 'layouts', '_dynamic_alert_content.html' )
render :partial => File.join( 'layouts', 'dynamic_alert_framework' )
else
''
end
end
def site_content_url( page_name )
WontoMedia.site_content_url_prefix +
page_name +
WontoMedia.site_content_url_postfix
end
def ruby_hash_to_javascript( js_name, ruby_hash, prefix = 'id' )
has_started = false
js = ""
end
end