Class ::xowiki::includelet::my-categories (public)
::xowiki::IncludeletClass ::xowiki::includelet::my-categories
Defined in /var/www/openacs.org/packages/xowiki/tcl/includelet-procs.tcl
List the categories associated with the current page.
- Testcases:
- No testcase defined.
Source code: namespace eval ::xowiki::includelet {} ::nsf::object::alloc ::xowiki::IncludeletClass ::xowiki::includelet::my-categories {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-categories instproc render {} { :get_parameters set content "" set weblog_page [::$package_id get_parameter weblog_page:graph weblog] set entries [list] set href [export_vars -base [::$package_id package_url]$weblog_page {summary}] set notification_type "" if {[::$package_id get_parameter with_notifications:boolean 1] && [::xo::cc user_id] != 0} { ;# notifications require login set notification_type [notification::type::get_type_id -short_name xowiki_notif] } if {[::$package_id exists_query_parameter return_url]} { set return_url [::$package_id query_parameter return_url:localurl] } foreach cat_id [category::get_mapped_categories [${:__including_page} set item_id]] { lassign [category::get_data $cat_id] category_id category_name tree_id tree_name #:log "--cat $cat_id $category_id $category_name $tree_id $tree_name" set label [ns_quotehtml "$category_name ($tree_name)"] set entry "<a href='[ns_quotehtml $href&category_id=$category_id]'>[ns_quotehtml $label]</a>" if {$notification_type ne ""} { set notification_text "Subscribe category $category_name in tree $tree_name" set notifications_return_url [expr {[info exists return_url] ? $return_url : [ad_return_url]}] set notification_image "<adp:icon name='envelope' title='[ns_quotehtml $notification_text]'>" set cat_notif_link [export_vars -base /notifications/request-new {{return_url $notifications_return_url} {pretty_name $notification_text} {type_id $notification_type} {object_id $category_id}}] append entry "<a href='[ns_quotehtml $cat_notif_link]'> " $notification_image </a> } lappend entries $entry } if {[llength $entries]>0} { set content "#xowiki.categories#: [join $entries {, }]" } return $content } ::xowiki::includelet::my-categories instparametercmd parameter_declaration ::xowiki::includelet::my-categories instparametercmd __decoration ::nsf::relation::set ::xowiki::includelet::my-categories superclass ::xowiki::Includelet ::nx::slotObj -container slot ::xowiki::includelet::my-categories ::xowiki::includelet::my-categories::slot eval {set :__parameter { {__decoration none} {parameter_declaration { {-summary 1} }} }} ::nsf::object::alloc ::xotcl::Attribute ::xowiki::includelet::my-categories::slot::__decoration {set :accessor public set :configurable true set :convert false set :default none set :defaultmethods {} set :disposition alias set :domain ::xowiki::includelet::my-categories set :incremental 0 set :manager ::xowiki::includelet::my-categories::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} ::nsf::object::alloc ::xotcl::Attribute ::xowiki::includelet::my-categories::slot::parameter_declaration {set :accessor public set :configurable true set :convert false set :default { {-summary 1} } set :defaultmethods {} set :disposition alias set :domain ::xowiki::includelet::my-categories set :incremental 0 set :manager ::xowiki::includelet::my-categories::slot::parameter_declaration set :methodname parameter_declaration set :multiplicity 1..1 set :name parameter_declaration set :parameterSpec {-parameter_declaration:substdefault { {-summary 1} }} set :per-object false set :position 0 set :required false set :substdefault 0b111 set :trace none : init}XQL Not present: Generic, PostgreSQL, Oracle