general_comments_create_link (public)

 general_comments_create_link [ -object_name object_name ] \
    [ -link_text link_text ] [ -context_id context_id ] \
    [ -category category ] [ -link_attributes link_attributes ] \
    object_id [ return_url ]

Defined in packages/general-comments/tcl/general-comments-procs.tcl

Generates an html link to add a comment to an object.

Switches:
-object_name (optional)
The name of the object.
-link_text (optional, defaults to "#general-comments.Add_comment#")
The text to display for the link.
-context_id (optional)
The context_id for the comment.
-category (optional)
A category to associate comment to.
-link_attributes (optional)
Some additional parameters for the link. Could be used to set the link title and other things like that. Ex. -link_attributes { title="My link title" }
Parameters:
object_id (required)
The object to comment on.
return_url (optional)
A url for the user to return to after viewing a comment.

Partial Call Graph (max 5 caller/called nodes):
%3 test_general_comments_create_link general_comments_create_link (test general-comments) general_comments_create_link general_comments_create_link test_general_comments_create_link->general_comments_create_link acs_object_name acs_object_name (public) general_comments_create_link->acs_object_name export_vars export_vars (public) general_comments_create_link->export_vars general_comments_package_url general_comments_package_url (public) general_comments_create_link->general_comments_package_url Class ::xowiki::includelet::my-general-comments Class ::xowiki::includelet::my-general-comments (public) Class ::xowiki::includelet::my-general-comments->general_comments_create_link packages/download/www/one-archive.tcl packages/download/ www/one-archive.tcl packages/download/www/one-archive.tcl->general_comments_create_link packages/download/www/one-revision.tcl packages/download/ www/one-revision.tcl packages/download/www/one-revision.tcl->general_comments_create_link packages/faq/www/one-faq.tcl packages/faq/ www/one-faq.tcl packages/faq/www/one-faq.tcl->general_comments_create_link packages/file-storage/www/file.tcl packages/file-storage/ www/file.tcl packages/file-storage/www/file.tcl->general_comments_create_link

Testcases:
general_comments_create_link
Source code:
    # get the package url
    set package_url [general_comments_package_url]
    if { $package_url eq "" } {
        return ""
    }

    # initialize variables
    if { ![info exists object_name] } { set object_name [acs_object_name $object_id] }
    if { ![info exists context_id] } { set context_id $object_id }

    set html [subst {<a href="[ns_quotehtml [export_vars -base ${package_url}comment-add {object_id
         object_name return_url context_id category}]]" $link_attributes>$link_text</a>}]

    return $html
Generic XQL file:
packages/general-comments/tcl/general-comments-procs.xql

PostgreSQL XQL file:
packages/general-comments/tcl/general-comments-procs-postgresql.xql

Oracle XQL file:
packages/general-comments/tcl/general-comments-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: