template::util::richtext::get_property (public)

 template::util::richtext::get_property what richtext_list

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

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

Parameters:
what (required)
the name of the property. Must be one of:
  • contents (synonyms content, text) - returns the actual contents of the textarea field
  • format (synonym mime_type) - returns the mimetype, e.g. 'text/plain'
  • html_value - returns the content converted to html format, regardless of the format the content is actually in. In case it is already text/html no conversion will be applied.
richtext_list (required)
a richtext datatype value, usually created with ad_form.

Partial Call Graph (max 5 caller/called nodes):
%3 general_comments_get_comments general_comments_get_comments (public) template::util::richtext::get_property template::util::richtext::get_property general_comments_get_comments->template::util::richtext::get_property packages/acs-admin/www/auth/authority.tcl packages/acs-admin/ www/auth/authority.tcl packages/acs-admin/www/auth/authority.tcl->template::util::richtext::get_property packages/acs-tcl/lib/page-error.tcl packages/acs-tcl/ lib/page-error.tcl packages/acs-tcl/lib/page-error.tcl->template::util::richtext::get_property packages/bug-tracker/www/bug-add.tcl packages/bug-tracker/ www/bug-add.tcl packages/bug-tracker/www/bug-add.tcl->template::util::richtext::get_property packages/bug-tracker/www/bug.tcl packages/bug-tracker/ www/bug.tcl packages/bug-tracker/www/bug.tcl->template::util::richtext::get_property ad_html_text_convert ad_html_text_convert (public) template::util::richtext::get_property->ad_html_text_convert

Testcases:
No testcase defined.
Source code:
    lassign $richtext_list contents format

    switch -- $what {
        content - contents - text {
            return $contents
        }
        format - mime_type {
            return $format
        }
        html_value {
            if { $contents ne "" } {
                return [ad_html_text_convert -from $format -to "text/html" -- $contents]
            } else {
                return {}
            }
        }

        default {
            error "Parameter supplied to util::richtext::get_property 'what' must be one of: 'contents', 'format', 'html_value'. You specified: '$what'."
        }
    }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: