module ApplicationHelper def form_field(object,field,flabel,example,val) html = "" html << "
" if object.errors[field.to_sym] html << "
" end html << "" if object.errors[field.to_sym] html << " " html << object.errors[field.to_sym].to_s html << "" html << "
" end html << "" html << "" html << t(:example) html << ": " html << example html << "" html << "
" end def form_button(text,image) html = "" html << "
" html << "
" end def form_button_value(text,image,onclick) html = "" html << "
" html << "
" end def simple_input_field(name,label,value) html = "" html << "
" html << "" html << "" html << "
" end def select_field(name,object,label,blank) html = "" html << "
" html << "" html << select(name, name, object.all.collect {|p| [ p.name, p.id ] }, { :include_blank => (blank == true ? true : false)}) html << "
" end #def form_simle_field(name,label,value) # html = "" # html << "
" # html << "" # html << "" # html << "
" #end def nav_to_folders link_to( t(:folders), :controller=>:folders, :action=>:manage ) end def nav_to_messages link_to( t(:messages), :controller=>:messages, :action=>:index ) end def nav_to_compose link_to( t(:compose), :controller=>:messages, :action=>:compose ) end def nav_to_contacts link_to( t(:contacts), :controller=>:contacts, :action=>:index ) end def nav_to_prefs link_to( t(:preferences), :controller=>:prefs, :action=>:index ) end def main_navigation(active) s = "" s += "" end def multi_select(id, name, objects, selected_objects, label, value,joiner,content = {}) options = "" objects.each do |o| selected = selected_objects.include?(o) ? " selected=\"selected\"" : "" option_value = escape_once(o.send(value)) text = [option_value] unless content[:text].nil? text = [] content[:text].each do |t| text << o.send(t) end text = text.join(joiner) end text.gsub!(/^\./,'') bracket = [] unless content[:bracket].nil? content[:bracket].each do |b| bracket << o.send(b) end bracket = bracket.join(joiner) end option_content = bracket.empty? ? "#{text}" : "#{text} (#{bracket})" options << "\n" end "
" end end