template::util::richtext_or_file::get_property (public)

 template::util::richtext_or_file::get_property what \
    richtext_or_file_list

Defined in packages/acs-templating/tcl/richtext-or-file-procs.tcl

Get a property of the richtext_or_file datatype. Valid properties are:

  • storage_type
  • mime_type
  • text
  • filename
  • tmp_filename
  • content_url

Parameters:
what
richtext_or_file_list

Partial Call Graph (max 5 caller/called nodes):
%3 template::widget::richtext_or_file template::widget::richtext_or_file (public) template::util::richtext_or_file::get_property template::util::richtext_or_file::get_property template::widget::richtext_or_file->template::util::richtext_or_file::get_property ad_html_text_convert ad_html_text_convert (public) template::util::richtext_or_file::get_property->ad_html_text_convert

Testcases:
No testcase defined.
Source code:
    lassign $richtext_or_file_list storage_type mime_type text filename tmp_filename content_url

    switch -- $what {
        storage_type {
            return $storage_type
        }
        mime_type {
            return $mime_type
        }
        text {
            return $text
        }
        filename {
            return $filename
        }
        tmp_filename {
            return $tmp_filename
        }
        content_url {
            return $content_url
        }
        file {
            return [list $filename $tmp_filename $mime_type]
        }
        html_value {
            switch -- $storage_type {
                text {
                    return [ad_html_text_convert -from $mime_type -to "text/html" -- $text]
                }
                file {
                    return "<a href=\"[ns_quotehtml $content_url]\">Download file</a>"
                }
            }
            return {}
        }
        default {
            error "Invalid property $what, valid properties are storage_type, mime_type, text, filename, tmp_filanme, content_url, html_value, file."
        }
    }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: