Class ::xowiki::includelet::my-references (public)
::xowiki::IncludeletClass ::xowiki::includelet::my-references
Defined in /var/www/openacs.org/packages/xowiki/tcl/includelet-procs.tcl
List the pages which are referring to the current page.
- Testcases:
- No testcase defined.
Source code: namespace eval ::xowiki::includelet {} ::nsf::object::alloc ::xowiki::IncludeletClass ::xowiki::includelet::my-references {set :__default_metaclass ::xotcl::Class set :__default_superclass ::xotcl::Object set :aggregating false set :cacheable false set :localized true set :personalized true} ::xowiki::includelet::my-references instproc render {} { :get_parameters set item_id [${:__including_page} item_id] set refs [list] # The same image might be linked both, as img or file on one page, # so we need DISTINCT. xo::dc foreach -prepare integer get_references { SELECT DISTINCT page,ci.name,ci.parent_id,o.package_id as pid from xowiki_references,cr_items ci,acs_objects o where reference = :item_id and ci.item_id = page and ci.item_id = o.object_id } { if {$pid eq ""} { # # In versions before oacs 5.2, the following query returns # empty. # set pid [::xo::dc get_value 5.2 { select package_id from cr_folders where folder_id = :parent_id }] } if {$pid ne ""} { ::xowiki::Package require $pid lappend refs "<a href='[ns_quotehtml [$pid pretty_link -parent_id $parent_id $name]]'>[ns_quotehtml $name]</a>" } } set references [join $refs ", "] array set lang {found "" undefined ""} foreach i [${:__including_page} array names lang_links] { set lang($i) [join [${:__including_page} set lang_links($i)] ", "] } append references " " $lang(found) set result "" if {$references ne " "} { append result "#xowiki.references_label# $references" } if {$lang(undefined) ne ""} { append result "#xowiki.create_this_page_in_language# $lang(undefined)" } return $result } ::xowiki::includelet::my-references instparametercmd __decoration ::nsf::relation::set ::xowiki::includelet::my-references superclass ::xowiki::Includelet ::nx::slotObj -container slot ::xowiki::includelet::my-references ::xowiki::includelet::my-references::slot eval {set :__parameter {{__decoration none}}} ::nsf::object::alloc ::xotcl::Attribute ::xowiki::includelet::my-references::slot::__decoration {set :accessor public set :configurable true set :convert false set :default none set :defaultmethods {} set :disposition alias set :domain ::xowiki::includelet::my-references set :incremental 0 set :manager ::xowiki::includelet::my-references::slot::__decoration set :methodname __decoration set :multiplicity 1..1 set :name __decoration set :parameterSpec {-__decoration:substdefault none} set :per-object false set :position 0 set :required false set :substdefault 0b111 set :trace none : init}XQL Not present: Generic, PostgreSQL, Oracle