Module | DocumentsHelper
In: | app/helpers/documents_helper.rb

### Methods

icon_for_document relative_path_for_photo url_for_photo

### Public Instance methods

icon_for_document(document, target="news")

[Source]

        # File app/helpers/documents_helper.rb, line 2
     2:   def icon_for_document(document, target="news")
     3:     # if target.eql?("search")
     4:     #   img = "/images/doc_types/#{document.class.to_s.downcase}.gif"
     5:     # else
     6:       if document.icon
     7:         img = document.icon.photo.url(:tiny)
     8:         alt = document.icon.name
     9:       else
    10:         if document.is_a?(Link)
    11:           img = '/images/doc_types/link.gif'
    12:           alt = t('documents.enlace_externo')
    13:         else
    14:           img = '/images/gv.gif'
    15:           alt = "Irekia"
    16:         end
    17:       end
    18:     # end
    19:     image_tag(img, :width => 30, :height => 30, :alt => alt)
    20:   end

relative_path_for_photo(path)

[Source]

        # File app/helpers/documents_helper.rb, line 27
    27:   def relative_path_for_photo(path)
    28:     path.sub(/^#{Document::MULTIMEDIA_PATH}/,'')
    29:   end

url_for_photo(path)

[Source]

        # File app/helpers/documents_helper.rb, line 23
    23:   def url_for_photo(path)
    24:     Document::MULTIMEDIA_URL + relative_path_for_photo(path)
    25:   end

[Validate]