Class ::xowiki::Includelet (public)

 ::xotcl::Class ::xowiki::Includelet[i]

Defined in

Testcases:
No testcase defined.
Source code:
namespace eval ::xowiki {}
::nsf::object::alloc ::xotcl::Class ::xowiki::Includelet {set :__default_metaclass ::xotcl::Class
   set :__default_superclass ::xotcl::Object
   array set :html {view-item-button {{{<b>view-item-button</b> -page_id -title <em>#xowiki.view#</em> -alt <em>view</em> -link <em>&#34;&#34;</em> -book_mode <em>false</em>}}
<p>Button to view the current or a different page} delete-item-button {{{<b>delete-item-button</b> -page_id -title <em>#xowiki.delete#</em> -alt <em>delete</em> -book_mode <em>false</em>}}
<p>Button to delete the current or a different page} s5 {{{<b>s5</b> -category_id -slideshow:boolean <em>false</em> -pagenr <em>0</em> -style <em>standard</em> -menu_buttons <em>view edit copy create delete</em>}}
<p>} exam-top-includelet {{{<b>exam-top-includelet</b> -countdown_audio_alarm <em>true</em> -target_time <em>&#34;&#34;</em> -url_poll <em>&#34;&#34;</em> -url_dismiss <em>&#34;&#34;</em> -poll_interval <em>5000</em>}}
<p>This is the top includelet for the in-class exam, containing a
        countdown timer and the personal notifications includelet} book {{{<b>book</b> -category_id -menu_buttons <em>edit</em> -folder_mode <em>false</em> -locale <em>&#34;&#34;</em> -range <em>&#34;&#34;</em> -allow_reorder <em>&#34;&#34;</em> -orderby <em>page_order,asc</em> -with_footer <em>false</em> -publish_status <em>ready</em>}}
<p>Show contents in book mode.} edit-item-button {{{<b>edit-item-button</b> -page_id -title <em>#xowiki.edit#</em> -alt <em>edit</em> -book_mode <em>false</em> -link <em>&#34;&#34;</em> -target <em>&#34;&#34;</em>}}
<p>Button to edit the current or a different page} digg {{{<b>digg</b> -description <em>&#34;&#34;</em> -url}}
<p>Add a button to submit article to digg.} collab-graph {{{<b>collab-graph</b> -max_edges <em>70</em> -cutoff <em>0.1</em> -show_anonymous <em>message</em> -user_id}}
<p>Include a collaboration graph} iframe {{{<b>iframe</b> -title <em>&#34;&#34;</em> -url:required -width <em>100%</em> -height <em>500px</em>}}
<p>Include an iframe containing the specified URL} chat_room {{{<b>chat_room</b> -chat_id -mode:optional <em>&#34;&#34;</em> -path:optional <em>&#34;&#34;</em> -skin:optional <em>&#34;&#34;</em>}}
<p>Include a chat room} gravatar {{{<b>gravatar</b> -email:required -size <em>80</em>}}
<p>Include gravatar picture for the specified email} my-categories {{{<b>my-categories</b> -summary <em>1</em>}}
<p>List the categories associated with the
        current page.} jquery-carousel {{{<b>jquery-carousel</b>}}
<p>Display a sequence of pages via jquery-carousel, based on book
        includelet.} bookmarklet-button {{{<b>bookmarklet-button</b> -siteurl <em>&#34;&#34;</em> -label <em>&#34;&#34;</em>}}
<p>Include bookmarklet button that makes it easy to add the
        current page as a bookmark in the browser of the client.} activity-graph {{{<b>activity-graph</b> -max_edges <em>70</em> -cutoff <em>0.1</em> -max_activities:integer <em>100</em> -show_anonymous <em>message</em>}}
<p>Include an activity graph} presence {{{<b>presence</b> -interval <em>10 minutes</em> -max_users:integer <em>40</em> -show_anonymous <em>summary</em> -page}}
<p>Show users actively in the wiki.} current-irc-log {{{<b>current-irc-log</b> -date <em>&#34;&#34;</em>}}
<p>} launch-zoom {{{<b>launch-zoom</b>}}
<p>} jquery-infinite-carousel {{{<b>jquery-infinite-carousel</b>}}
<p>Display a sequence of pages via jquery-infinite-carousel, based on book
        includelet.} launch-bigbluebutton {{{<b>launch-bigbluebutton</b>}}
<p>} jquery-cloud-carousel {{{<b>jquery-cloud-carousel</b>}}
<p>Display a sequence of pages via jquery-cloud-carousel, based on book
        includelet.} wf-todo {{{<b>wf-todo</b> -workflow <em>&#34;&#34;</em> -user_id -ical <em>0</em> -max_entries}}
<p>} delicious {{{<b>delicious</b> -description <em>&#34;&#34;</em> -tags <em>&#34;&#34;</em> -url}}
<p>Add a button to submit article to delicious.} jquery-spacegallery {{{<b>jquery-spacegallery</b>}}
<p>Display a sequence of pages via jquery-spacegalleryl, based on book
        includelet.} references-graph {{{<b>references-graph</b> -folder <em>.</em> -page <em>&#34;&#34;</em> -link_type <em>link</em> -rankdir <em>LR</em> -fontsize <em>12</em>}}
<p>Include a graph of the (partial) link structure in a wiki,
            starting either with a page or a folder. When a page is
            provided, the local link structure of this page is
            visualized (including incoming and outgoing links of the
            page; e.g. -page "." for the current page).
            Alternatively, the content of a folder can be shown.} rss-button {{{<b>rss-button</b> -span <em>10d</em> -name_filter -entries_of -title}}
<p>Include an RSS button referring to pages of the specified time span.} html-file {{{<b>html-file</b> -title <em>&#34;&#34;</em> -extra_css <em>&#34;&#34;</em> -levels <em>0</em> -file:required}}
<p>Include the specified HTML file} categories-recent {{{<b>categories-recent</b> -max_entries:integer <em>10</em> -tree_name <em>&#34;&#34;</em> -locale <em>&#34;&#34;</em> -pretty_age <em>off</em>}}
<p>Display recent entries by categories.} slidy {{{<b>slidy</b>}}
<p>Display a sequence of pages via W3C slidy, based on book includelet} tags {{{<b>tags</b> -limit:integer <em>20</em> -summary:boolean <em>0</em> -popular:boolean <em>0</em> -page}}
<p>Display specified tags.} form-stats {{{<b>form-stats</b> -form -parent_id -property <em>_state</em> -orderby <em>count,desc</em> -renderer <em>table</em>}}
<p>Include form statistics for the specofied Form page.} get {{{<b>get</b> -variable -form_variable -source <em>&#34;&#34;</em>}}
<p>Get an instance variable from the current or from a different
        page.} available-formfields {{{<b>available-formfields</b> -flat:boolean <em>false</em>}}
<p>List the available form field types of this installation.} my-general-comments {{{<b>my-general-comments</b>}}
<p>List the general comments available for the
        current page.} link-with-local-return-url {{{<b>link-with-local-return-url</b> -text <em>&#34;&#34;</em> -url <em>&#34;&#34;</em>}}
<p>Insert a link with extra return URL pointing the current
        object. This is particularly useful in cases, where a
        return URL must be created for a page that does not yet
        exist at time of definition (e.g. for link pointing to
        concrete workflow instances)} LTI-LaunchButton {{{<b>LTI-LaunchButton</b> -launch_button_label <em>Join Meeting</em> -launch_button_title <em>Click to join</em> -title <em>&#34;&#34;</em> -presentation <em>window</em>}}
<p>} flowplayer {{{<b>flowplayer</b> -mp4:required,nohtml}}
<p>Include an mp4 image using flowplayer} form-menu {{{<b>form-menu</b> -form_item_id:integer -parent_id -form -buttons <em>new answers</em> -button_objs -return_url}}
<p>Include a form menu for the specified Form} form-usages {{{<b>form-usages</b> -form_item_id:integer,1..n -form -parent_id -package_ids <em>&#34;&#34;</em> -orderby <em>_raw_last_modified,desc</em> -view_field <em>_name</em> -publish_status <em>all</em> -field_names -hidden_field_names <em>_last_modified</em> -extra_form_constraints <em>&#34;&#34;</em> -inherit_from_forms <em>&#34;&#34;</em> -category_id -unless -where -extra_where_clause <em>&#34;&#34;</em> -csv <em>true</em> -voting_form -voting_form_form <em>&#34;&#34;</em> -voting_form_anon_instances <em>t</em> -generate -with_form_link <em>true</em> -with_categories -wf -bulk_actions <em>&#34;&#34;</em> -buttons <em>edit delete</em> -renderer <em>&#34;&#34;</em> -return_url -date_format -with_checkboxes:boolean <em>false</em>}}
<p>Show usages of the specified form.} last-visited {{{<b>last-visited</b> -max_entries:integer <em>20</em>}}
<p>Display last visited pages.} my-tags {{{<b>my-tags</b> -summary <em>1</em>}}
<p>List the tags associated with the
        current page.} available-includelets {{{<b>available-includelets</b>}}
<p>List the available includelets of this installation.} my-refers {{{<b>my-refers</b>}}
<p>List the pages which are referred to the
        current page.} user-timeline {{{<b>user-timeline</b> -user_id -data <em>timeline-data</em> -interval1 <em>DAY</em> -interval2 <em>MONTH</em>}}
<p>Include a timeline of changes of the current or specified user
        (based on yahoo timeline API)} most-popular {{{<b>most-popular</b> -max_entries:integer <em>10</em> -interval}}
<p>Display most popular pages of this wiki instance.} my-references {{{<b>my-references</b>}}
<p>List the pages which are referring to the
        current page.} countdown-timer {{{<b>countdown-timer</b> -target_time <em>&#34;&#34;</em> -audio_alarm <em>true</em>}}
<p>Countdown timer} folders {{{<b>folders</b> -show_full_tree <em>false</em> -context_tree_view <em>false</em>}}
<p>List the folder tree of the current instance} community-link {{{<b>community-link</b> -text <em>&#34;&#34;</em> -url <em>&#34;&#34;</em>}}
<p>Include a link to the community including the current page.
        This includelet is designed to work with dotlrn.} yui-carousel {{{<b>yui-carousel</b> -title <em>&#34;&#34;</em> -item_size <em>600x400</em> -image_size -num_visible <em>1</em> -play_interval <em>0</em> -auto_size <em>0</em> -folder -glob <em>&#34;&#34;</em> -form <em>&#34;&#34;</em>}}
<p>Include YUI carousel showing the pages of the specified or
        current folder.} launch-jupyter {{{<b>launch-jupyter</b>}}
<p>} composite-form {{{<b>composite-form</b> -edit_links:boolean <em>false</em> -pages <em>&#34;&#34;</em> -ordered_pages}}
<p>Create a form from the selection} child-resources {{{<b>child-resources</b> -skin:optional <em>yui-skin-sam</em> -show_types <em>::xowiki::Page,::xowiki::File,::xowiki::Form,::xowiki::FormPage</em> -regexp:optional -language_specific:boolean <em>false</em> -with_subtypes:boolean,optional <em>false</em> -orderby:token,optional <em>last_modified,desc</em> -publish_status:wordchar <em>ready</em> -view_target <em>&#34;&#34;</em> -html-content -parent <em>.</em> -columns <em>
              objects
              edit
              publish_status
              object_type
              name
              last_modified
              mod_user
              duplicate
              delete
            </em> -hide <em>&#34;&#34;</em> -menubar <em>&#34;&#34;</em>}}
<p>} selection {{{<b>selection</b> -edit_links:boolean <em>true</em> -pages <em>&#34;&#34;</em> -ordered_pages <em>&#34;&#34;</em> -source -publish_status <em>ready</em> -menu_buttons <em>edit</em> -range <em>&#34;&#34;</em>}}
<p>Provide a selection of pages} kibana {{{<b>kibana</b> -chart <em>openacs-status-codes</em> -from <em>now-24h</em> -to <em>now</em> -hash <em>&#34;&#34;</em> -width:integer <em>800</em> -height:integer <em>400</em>}}
<p>Include a Kibana chart identified by the provided hash} my-yahoo-publisher {{{<b>my-yahoo-publisher</b> -publisher <em>&#34;&#34;</em> -rssurl}}
<p>Name of the publisher, when posting URLs to my yahoo (use in
        connection with with_yahoo_publisher).} unread-items {{{<b>unread-items</b> -max_entries:integer <em>20</em>}}
<p>List unread items.} categories {{{<b>categories</b> -tree_name <em>&#34;&#34;</em> -tree_style:boolean <em>1</em> -no_tree_name:boolean <em>0</em> -count:boolean <em>0</em> -summary:boolean <em>0</em> -locale <em>&#34;&#34;</em> -open_page <em>&#34;&#34;</em> -order_items_by <em>title,asc</em> -style <em>mktree</em> -category_ids <em>&#34;&#34;</em> -parent <em>/</em> -except_category_ids <em>&#34;&#34;</em> -allow_edit <em>false</em> -ordered_composite}}
<p>List the specified category tree.} timeline {{{<b>timeline</b> -user_id -data <em>timeline-data</em> -interval1 <em>DAY</em> -interval2 <em>MONTH</em>}}
<p>Include a timeline of changes (based on yahoo timeline API)} chat {{{<b>chat</b> -title <em>&#34;&#34;</em> -chat_id <em>&#34;&#34;</em> -mode <em>&#34;&#34;</em> -path <em>&#34;&#34;</em> -skin -login_messages_p -logout_messages_p -avatar_p -timewindow}}
<p>Include a chat in the current page} copy-item-button {{{<b>copy-item-button</b> -page_id -alt <em>copy</em> -book_mode <em>false</em>}}
<p>Button to copy a page} creation-date {{{<b>creation-date</b> -source <em>&#34;&#34;</em> -format <em>%m-%d-%Y</em>}}
<p>Include the creation date of the current
        or specified page in the provided format.} create-item-button {{{<b>create-item-button</b> -page_id -alt <em>new</em> -book_mode <em>false</em>}}
<p>Button to create a new page based on the current one} graph {{{<b>graph</b>}}
<p>} random-form-page {{{<b>random-form-page</b> -form:required -publish_status <em>ready</em> -expires <em>600</em>}}
<p>Include random form page (instance of the specified form)} item-button {{{<b>item-button</b>}}
<p>} recent {{{<b>recent</b> -max_entries:integer <em>10</em> -allow_edit:boolean <em>false</em> -allow_delete:boolean <em>false</em> -pretty_age <em>off</em>}}
<p>Display recent modified entries.} most-frequent-visitors {{{<b>most-frequent-visitors</b> -max_entries:integer <em>15</em>}}
<p>List the most frequent visitors.} set-parameter {{{<b>set-parameter</b>}}
<p>Set a parameter accessible to the current page (for certain
        tailorings), accessible in the page via e.g. the query
        parameter interface.} vspace {{{<b>vspace</b> -height <em>&#34;&#34;</em> -width <em>&#34;&#34;</em>}}
<p>} rss-client {{{<b>rss-client</b> -url:required -max_entries:integer <em>15</em>}}
<p>Include RSS content} personal-notification-messages {{{<b>personal-notification-messages</b> -url_poll <em>&#34;&#34;</em> -url_dismiss <em>&#34;&#34;</em> -poll_interval <em>5000</em>}}
<p>} toc {{{<b>toc</b> -style <em>&#34;&#34;</em> -renderer <em>&#34;&#34;</em> -open_page <em>&#34;&#34;</em> -book_mode <em>false</em> -folder_mode <em>false</em> -ajax <em>false</em> -expand_all <em>false</em> -remove_levels <em>0</em> -category_id -locale <em>&#34;&#34;</em> -orderby <em>&#34;&#34;</em> -source <em>&#34;&#34;</em> -range <em>&#34;&#34;</em> -allow_reorder <em>&#34;&#34;</em> -include_in_foldertree <em>true</em> -CSSclass_top_ul <em>&#34;&#34;</em> -CSSclass_ul <em>&#34;&#34;</em>}}
<p>} unresolved-references {{{<b>unresolved-references</b>}}
<p>List the pages with unresolved references in the current
        xowiki/xowf package. This is intended for use by admins.}}}
::xowiki::Includelet proc listing {-package_id {-count:boolean false} -folder_id {-parent_id ""} {-page_size 20} {-page_number ""} {-orderby ""} {-use_package_path true} {-extra_where_clause ""} {-glob ""}} {
    if {$count} {
      set attribute_selection "count(*)"
      set orderby ""      ;# no need to order when we count
      set page_number  ""      ;# no pagination when count is used
    } else {
      set attribute_selection "i.name, r.title, p.page_id, r.publish_date,  r.mime_type, i.parent_id, o.package_id,  to_char(r.publish_date,'YYYY-MM-DD HH24:MI:SS') as formatted_date"
    }
    if {$page_number ne ""} {
      set limit $page_size
      set offset [expr {$page_size*($page_number-1)}]
    } else {
      set limit ""
      set offset ""
    }
    set parent_id_clause [::xowiki::Includelet parent_id_clause  -base_table i  -use_package_path $use_package_path  -parent_id $parent_id  -base_package_id $package_id]

    if {$glob ne ""} {
      append extra_where_clause [::xowiki::Includelet glob_clause -base_table i $glob]
    }

    set sql [::xo::dc select  -vars $attribute_selection  -from "cr_items i, cr_revisions r, xowiki_page p, acs_objects o"  -where "$parent_id_clause  and r.revision_id = i.live_revision  and i.item_id = o.object_id  and p.page_id = r.revision_id  and i.publish_status <> 'production' $extra_where_clause"  -orderby $orderby  -limit $limit -offset $offset]

    if {$count} {
      return [::xo::dc get_value count_listing $sql]
    } else {
      set s [::xowiki::Page instantiate_objects -sql $sql]
      return $s
    }
  }
::xowiki::Includelet proc parent_id_clause {{-base_table bt} {-use_package_path true} {-parent_id ""} -base_package_id:required} {
    #
    # Get the package path and from it, the folder_ids. The parent_id
    # of the returned pages should be a direct child of the folder.
    #
    if {$parent_id eq ""} {
      set parent_id [::$base_package_id folder_id]
    }
    set packages [::$base_package_id package_path]
    if {$use_package_path && [llength $packages] > 0} {
      set parent_ids [list $parent_id]
      foreach p $packages {lappend parent_ids [$p folder_id]}
      return "$base_table.parent_id in ([ns_dbquotelist $parent_ids])"
    } else {
      return "$base_table.parent_id = [ns_dbquotevalue $parent_id]"
    }
  }
::xowiki::Includelet proc js_encode string {
    string map [list \n \\n \" {\"} ' {\'}] $string
  }
::xowiki::Includelet proc html_encode string {
    # &apos; is not a known entity to some validators, so we use the
    # numerical entity here for encoding "'"
    return [string map [list & "&amp;" < "&lt;" > "&gt;" \" "&quot;" ' "&#39;"$string]
  }
::xowiki::Includelet proc html_to_text string {
    return [string map [list "&amp;" &] $string]
  }
::xowiki::Includelet proc available_includelets {} {
    unset -nocomplain :html
    :describe_includelets [::xowiki::Includelet info subclass]
    set result "<ul>"
    foreach d [lsort [array names :html]] {
      append result "<li>" [set :html($d)] "</li>" \n
    }
    append result "</ul>"
    return $result
  }
::xowiki::Includelet proc require_YUI_JS {{-version 2.7.0} {-ajaxhelper true} path} {
    if {$ajaxhelper} {
      ::xo::Page requireJS "/resources/ajaxhelper/yui/$path"
    } else {
      ::xo::Page requireJS "//yui.yahooapis.com/$version/build/$path"
      security::csp::require script-src yui.yahooapis.com
    }
  }
::xowiki::Includelet proc glob_clause {{-base_table ci} {-attribute name} value} {
    # Return a clause for name matching.
    # value uses * for matching
    set glob [string map [list * %] $value]
    return " and $base_table.$attribute like '$glob'"
  }
::xowiki::Includelet proc html_id name {
    # Construct a valid HTML id or name.
    # For details, see http://www.w3.org/TR/html4/types.html
    #
    # For XOTcl object names, strip first the colons
    set name [string trimleft $name :]

    # make sure, the ID starts with characters
    if {![regexp {^[A-Za-z]} $name]} {
      set name id_$name
    }

    # replace unwanted characters
    regsub -all -- {[^A-Za-z0-9_.-]} $name _ name
    return $name
  }
::xowiki::Includelet proc require_YUI_CSS {{-version 2.7.0} {-ajaxhelper true} path} {
    if {$ajaxhelper} {
      ::xo::Page requireCSS "/resources/ajaxhelper/yui/$path"
    } else {
      ::xo::Page requireCSS "//yui.yahooapis.com/$version/build/$path"
      security::csp::require style-src yui.yahooapis.com
    }
  }
::xowiki::Includelet proc describe_includelets includelet_classes {
    #:log "--plc=$includelet_classes "
    foreach cl $includelet_classes {
      set result ""
      append result "{{<b>[namespace tail $cl]</b>"
      foreach p [$cl info parameter] {
        if {[llength $p] != 2} continue
        lassign $p name value
        if {$name eq "parameter_declaration"} {
          foreach pp $value {
            #append result ""
            switch [llength $pp] {
              1 {append result $pp"}
              2 {
                set v [lindex $pp 1]
                if {$v eq ""} {set v {""}}
                append result " [lindex $pp 0] <em>[ns_quotehtml $v]</em>"
              }
            }
            #append result "\n"
          }
        }
      }
      append result "}}\n<p>"
      set index [::xo::api object_index "" $cl]
      if {[nsv_exists api_library_doc $index]} {
        set doc_elements [nsv_get api_library_doc $index]
        append result [lindex [dict get $doc_elements main] 0]
      }
      set :html([namespace tail $cl]) $result
      :describe_includelets [$cl info subclass]
    }
  }
::xowiki::Includelet proc locale_clause {-revisions -items package_id locale} {
    set default_locale [::$package_id default_locale]
    set system_locale ""

    set with_system_locale [regexp {(.*)[+]system} $locale _ locale]
    if {$locale eq "default"} {
      set locale $default_locale
      set include_system_locale 0
    }
    #:msg "--L with_system_locale=$with_system_locale, locale=$locale, default_locale=$default_locale"

    set locale_clause ""
    if {$locale ne ""} {
      set locale_clause " and $revisions.nls_language = '$locale'"
      if {$with_system_locale} {
        set system_locale [lang::system::locale -package_id $package_id]
        #:msg "system_locale=$system_locale, default_locale=$default_locale"
        if {$system_locale ne $default_locale} {
          set locale_clause " and ($revisions.nls_language = '$locale'
        or $revisions.nls_language = '$system_locale' and not exists
          (select 1 from cr_items i where i.name = '[string range $locale 0 1]:' ||
          substring($items.name,4) and i.parent_id = $items.parent_id))"
        }
      }
    }

    #:msg "--locale $locale, def=$default_locale sys=$system_locale, cl=$locale_clause locale_clause=$locale_clause"
    return [list $locale $locale_clause]
  }
::xowiki::Includelet proc js_name name {
    return ID[string map [list : _ # _] $name]
  }
::xowiki::Includelet proc publish_status_clause {{-base_table ci} value} {
    set table_prefix ""
    if {$base_table ne ""} {
      set table_prefix "$base_table."
    }
    set publish_status_clause ""
    if {$value ne "all"} {
      set valid_states {production ready live expired}
      set clauses [list]
      foreach state [split $value |] {
        if {$state ni $valid_states} {
          error "no such state: '$state'; valid states are: production, ready, live, expired"
        }
        lappend clauses "${table_prefix}publish_status='$state'"
      }
      if {[llength $clauses] > 0} {
        set publish_status_clause " and ([join $clauses { or }])"
      }
    }
    return $publish_status_clause
  }
::xowiki::Includelet instproc category_clause {category_spec {item_ref p.item_id}} {
    # the category_spec has the syntax "a,b,c|d,e", where the values are category_ids
    # pipe symbols are or-operations, commas are and-operations;
    # no parenthesis are permitted
    set extra_where_clause ""
    set or_names [list]
    set ors [list]
    foreach cid_or [split $category_spec |] {
      set ands [list]
      set and_names [list]
      foreach cid_and [split $cid_or ,] {
        if {![nsf::is integer $cid_and]} {
          ad_return_complaint 1 "invalid category id '$cid_and'"
          ad_script_abort
        }
        lappend and_names [::category::get_name $cid_and]
        lappend ands "exists (select 1 from category_object_map  where object_id = $item_ref and category_id = [ns_dbquotevalue $cid_and])"
      }
      lappend or_names [join $and_names { and }]
      lappend ors "([join $ands { and }])"
    }
    if {$ors eq "()"} {
      set cnames ""
    } else {
      set cnames [join $or_names { or }]
      set extra_where_clause "and ([join $ors { or }])"
    }
    #:log "--cnames $category_spec -> $cnames // <$extra_where_clause>"
    return [list $cnames $extra_where_clause]
  }
::xowiki::Includelet instproc tableWidget {} {
    return [expr {[::template::CSS toolkit] in {bootstrap5 bootstrap}
                  ? "::xowiki::BootstrapTable"
                  : "TableWidget" }]
  }
::xowiki::Includelet instproc include_head_entries {} {
    # The purpose of this method is to contain all calls to include
    # CSS files, JavaScript, etc. in the HTML head. This kind of
    # requirement could as well be included e.g. in render, but this
    # won't work, when the result of "render" is cached.  This method
    # is called before render to be executed even when render is not
    # due to caching.  It is intended to be overloaded by subclasses.
  }
::xowiki::Includelet instproc get_page_order {-source -ordered_pages -pages} {
    #
    # first check, if we can load the page_order from the page
    # denoted by source
    #
    if {[info exists source]} {
      set p [:resolve_page_name $source]
      if {$p ne ""} {
        set ia [$p set instance_attributes]
        if {[dict exists $ia pages]} {
          set pages [dict get $ia pages]
        } elseif {[dict exists $ia ordered_pages]} {
          set ordered_pages [dict get $ia ordered_pages]
        }
      }
    }

    # compute a list of ordered_pages from pages, if necessary
    if {[info exists ordered_pages]} {
      foreach {order page} $ordered_pages {set :page_order($page$order}
    } else {
      set i 0
      foreach page $pages {set :page_order($page) [incr i]}
    }
  }
::xowiki::Includelet instproc screen_name user_id {
    set screen_name [acs_user::get_user_info -user_id $user_id -element screen_name]
    if {$screen_name eq ""} {
      set screen_name [person::get_person_info -person_id $user_id -element name]
    }
    return $screen_name
  }
::xowiki::Includelet instproc initialize {} {
    # This method is called at a time after init and before render.
    # It can be used to alter specified parameter from the user,
    # or to influence the rendering of a decoration (e.g. title etc.)
  }
::xowiki::Includelet instproc resolve_page_name page_name {
    return [${:__including_page} resolve_included_page_name $page_name]
  }
::xowiki::Includelet instproc js_name {} {
    return [[self class] js_name [self]]
  }
::xowiki::Includelet instproc get_current_folder parent {
    set package_id [${:__including_page} package_id]
    #:log "get_current_folder: including_page current_folder $current_folder '[$current_folder name]'"

    if {$parent eq ".."} {
      set current_folder [${:__including_page} parent_id]
      ::xo::db::CrClass get_instance_from_db -item_id $current_folder
    } elseif {$parent eq "."} {
      set current_folder ${:__including_page}
    } elseif {$parent eq "/"} {
      # set current_folder to the package folder
      set current_folder [::$package_id folder_id]
    } else {
      set page [::$package_id get_page_from_item_ref  -use_package_path true  -use_site_wide_pages true  -use_prototype_pages true  -default_lang [string range ${:locale} 0 1]  -parent_id [${:__including_page} parent_id]  $parent]
      if {$page ne ""} {
        set current_folder $page
      } else {
        ns_log warning "could not fetch folder via item_ref '$parent'"
        set current_folder ${:__including_page}
      }
    }
    #:log "get_current_folder: parent $parent, current_folder $current_folder '[$current_folder name]', folder is formPage [$current_folder istype ::xowiki::FormPage]"

    if {![$current_folder istype ::xowiki::FormPage]} {
      # current folder has to be a FormPage
      set current_folder [$current_folder parent_id]
      #:log "###### use parent of current folder $current_folder '[$current_folder name]'"

      if {![$current_folder istype ::xowiki::FormPage]} {
        error "get_current_folder not included from a FormPage"
      }
    }
    return $current_folder
  }
::xowiki::Includelet instparametercmd id
::xowiki::Includelet instparametercmd name
::xowiki::Includelet instparametercmd title
::xowiki::Includelet instparametercmd __decoration
::xowiki::Includelet instparametercmd parameter_declaration
::nsf::relation::set ::xowiki::Includelet superclass ::xo::Context

::nx::slotObj -container slot ::xowiki::Includelet
::xowiki::Includelet::slot eval {set :__parameter {
        {name ""}
        {title ""}
        {__decoration "portlet"}
        {parameter_declaration {}}
        {id}
      }}

::nsf::object::alloc ::xotcl::Attribute ::xowiki::Includelet::slot::title {set :accessor public
   set :configurable true
   set :convert false
   set :default {}
   set :defaultmethods {}
   set :disposition alias
   set :domain ::xowiki::Includelet
   set :incremental 0
   set :manager ::xowiki::Includelet::slot::title
   set :methodname title
   set :multiplicity 1..1
   set :name title
   set :parameterSpec {-title:substdefault {}}
   set :per-object false
   set :position 0
   set :required false
   set :substdefault 0b111
   set :trace none
   : init}

::nsf::object::alloc ::xotcl::Attribute ::xowiki::Includelet::slot::parameter_declaration {set :accessor public
   set :configurable true
   set :convert false
   set :default {}
   set :defaultmethods {}
   set :disposition alias
   set :domain ::xowiki::Includelet
   set :incremental 0
   set :manager ::xowiki::Includelet::slot::parameter_declaration
   set :methodname parameter_declaration
   set :multiplicity 1..1
   set :name parameter_declaration
   set :parameterSpec {-parameter_declaration:substdefault {}}
   set :per-object false
   set :position 0
   set :required false
   set :substdefault 0b111
   set :trace none
   : init}

::nsf::object::alloc ::xotcl::Attribute ::xowiki::Includelet::slot::__decoration {set :accessor public
   set :configurable true
   set :convert false
   set :default portlet
   set :defaultmethods {}
   set :disposition alias
   set :domain ::xowiki::Includelet
   set :incremental 0
   set :manager ::xowiki::Includelet::slot::__decoration
   set :methodname __decoration
   set :multiplicity 1..1
   set :name __decoration
   set :parameterSpec {-__decoration:substdefault portlet}
   set :per-object false
   set :position 0
   set :required false
   set :substdefault 0b111
   set :trace none
   : init}

::nsf::object::alloc ::xotcl::Attribute ::xowiki::Includelet::slot::id {set :accessor public
   set :configurable true
   set :convert false
   set :defaultmethods {}
   set :disposition alias
   set :domain ::xowiki::Includelet
   set :incremental 0
   set :manager ::xowiki::Includelet::slot::id
   set :methodname id
   set :multiplicity 1..1
   set :name id
   set :parameterSpec -id
   set :per-object false
   set :position 0
   set :required false
   set :trace none
   : init}

::nsf::object::alloc ::xotcl::Attribute ::xowiki::Includelet::slot::name {set :accessor public
   set :configurable true
   set :convert false
   set :default {}
   set :defaultmethods {}
   set :disposition alias
   set :domain ::xowiki::Includelet
   set :incremental 0
   set :manager ::xowiki::Includelet::slot::name
   set :methodname name
   set :multiplicity 1..1
   set :name name
   set :parameterSpec {-name:substdefault {}}
   set :per-object false
   set :position 0
   set :required false
   set :substdefault 0b111
   set :trace none
   : init}

namespace eval ::xowiki {::namespace export Menu YUIMenuBar YUIMenuBarItem YUIMenu YUIMenuItem YUIMenuItemList YUIContextMenu YUIContextMenuItem}
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: