xowiki::Package instproc make_link (public)
<instance of xowiki::Package> make_link \ [ -with_entities with_entities ] [ -privilege privilege ] \ [ -link link ] object [ method ] args [ args... ]
Defined in /var/www/openacs.org/packages/xowiki/tcl/package-procs.tcl
Creates conditionally a link for use in xowiki. When the generated link will be activated, the specified method of the object will be invoked. make_link checks in advance, whether the actual user has enough rights to invoke the method. If not, this method returns empty.
- Switches:
- -with_entities (optional, defaults to
"0"
)- -privilege (optional)
- When provided, the privilege can be "public" (do not check rights) or a privilege to be checked on the package_id and the current user. When this parameter is not specified, the policy is used to determine the rights to be checked.
- -link (optional)
- When this parameter is specified, is used used as base link for export_vars when applied on pages (or for packages as next segment under the package url). When not specified, the base url for pages is the current url, and for packages it is the package url.
- Parameters:
- object (required, object)
- The object to which the link refers to. If it is a package_id it will base to the root_url of the package_id. If it is a page, it will base to the page_url
- method (optional)
- Which method to use. This will be appended as "m=method" to the url. Examples for methods:
- view: To view and existing page
- edit: To edit an existing page
- revisions: To view the revisions of an existing page
- args (required)
- List of attributes to be append to the link. Every element can be an attribute name, or a "name value" pair. Behaves like export_vars.
- Returns:
- The link or empty
- See Also:
- Testcases:
- xowiki_test_cases