xotcl.wu-wien.ac.at
Begin main content
Methods: Source: Variables:
[All Methods | Documented Methods | Hide Methods] [Display Source | Hide Source] [Show Variables | Hide Variables]

::xowiki::IncludeletClass[i] ::xowiki::includelet::recent

Class Hierarchy of ::xowiki::includelet::recent

  • ::xotcl::Object[i]
    Meta-class:
    ::xotcl::Class[i]
    Methods for instances:
    __api_make_doc, __api_make_forward_doc, __timediff, abstract, ad_doc, ad_forward, ad_proc, appendC, arrayC, asHTML, autonameC, check, classC, cleanupC, configureC, containsC, copyC, db_0or1rowC, db_1rowC, debug, defaultmethodC, destroyC, destroy_on_cleanup, ds, evalC, existsC, extractConfigureArg, filterC, filterguardC, filtersearch, forward, hasclass, incrC, infoC, init, instvarC, invarC, isclass, ismetaclass, ismixin, isobject, istype, lappendC, log, method, mixinC, mixinguardC, moveC, msg, noinitC, objectparameter, parametercmdC, proc, procsearch, qn, requireNamespaceC, residualargsC, self, serialize, setC, set_instance_vars_defaults, show-object, substC, traceC, unknown, unsetC, uplevelC, upvarC, volatileC, vwait
    Methods to be applied on the class (in addition to the methods provided by the meta-class):
    getExitHandler, setExitHandler, unsetExitHandler
    • ::xo::Context[i]
      Meta-class:
      ::xotcl::Class[i]
      Parameter for instances:
      actual_query (default " "), locale, package_id (default "0"), parameter_declaration (default "")
      Methods for instances:
      exists_query_parameter, export_vars, get_all_query_parameter, get_parameters, initialize, original_url_and_query, process_query_parameter, query_parameter
      Methods to be applied on the class:
      Methods provided by the meta-class
      • ::xowiki::Includelet[i]
        Meta-class:
        ::xotcl::Class[i]
        Parameter for instances:
        __decoration (default "portlet"), id, name (default ""), parameter_declaration (default ""), title (default "")
        Methods for instances:
        category_clause, get_page_order, include_head_entries, initialize, js_name, resolve_page_name, screen_name
        Methods to be applied on the class (in addition to the methods provided by the meta-class):
        available_includelets, describe_includelets, glob_clause, html_encode, html_id, html_to_text, js_encode, js_name, listing, locale_clause, parent_id_clause, publish_status_clause, require_YUI_CSS, require_YUI_JS
        • ::xowiki::includelet::recent[i]
          Meta-class:
          ::xowiki::IncludeletClass[i]
          Parameter for instances:
          parameter_declaration (default " {-max_entries:integer 10} {-allow_edit:boolean false} {-allow_delete:boolean false} {-pretty_age off} "), title (default "Recently Changed Pages")
          Methods for instances:
          render
          Methods to be applied on the class:
          Methods provided by the meta-class

Class Relations

  • superclass: ::xowiki::Includelet[i]
::xowiki::IncludeletClass create ::xowiki::includelet::recent \
     -superclass ::xowiki::Includelet \
     -parameter {{parameter_declaration {
          {-max_entries:integer 10}
          {-allow_edit:boolean false}
          {-allow_delete:boolean false}
          {-pretty_age off}
        }} {title "Recently Changed Pages"}}

Methods

  • instproc render

    ::1791804 instproc render {} {
        my get_parameters
        ::xo::Page requireCSS "/resources/acs-templating/lists.css"
        set admin_p [::xo::cc permission -object_id $package_id -privilege admin  -party_id [::xo::cc set untrusted_user_id]]
        set show_heritage $admin_p
    
        TableWidget t1 -volatile  -set allow_edit $allow_edit  -set allow_delete $allow_delete  -set show_heritage $admin_p  -columns {
              Field date -label [_ xowiki.Page-last_modified]
              if {[[my info parent] set allow_edit]} {
                AnchorField edit -CSSclass edit-item-button -label "" -html {style "padding-right: 2px;"} -richtext 1
              }
              if {[[my info parent] set show_heritage]} {
                AnchorField inherited -label "" -CSSclass inherited
              } 
              AnchorField title -label [::xowiki::Page::slot::title set pretty_name]
              if {[[my info parent] set allow_delete]} {
                AnchorField delete -CSSclass delete-item-button -label "" -richtext 1
              }
            }
    
        set listing [::xowiki::Includelet listing  -package_id $package_id -page_number 1 -page_size $max_entries  -orderby "publish_date desc"]
    
        foreach entry [$listing children] {
          $entry instvar parent_id formatted_date page_id {title entry_title} {name entry_name}
            set entry_package_id [$entry set package_id]
          
            set page_link [$entry_package_id pretty_link -parent_id $parent_id $entry_name]
            switch -- $pretty_age {
    	  1 {set age [::xowiki::utility pretty_age -timestamp [clock scan $formatted_date] -locale [my locale]]}
    	  2 {set age [::xowiki::utility pretty_age -timestamp [clock scan $formatted_date] -locale [my locale] -levels 2]}
    	  default {set age $formatted_date}
    	}
    
            t1 add  -title $entry_title  -title.href $page_link  -date $age
    
            if {$allow_edit} {
              set p [::xo::db::CrClass get_instance_from_db -item_id 0 -revision_id $page_id]
              set edit_link [$entry_package_id make_link -link $page_link $p edit return_url]
              #my log "page_link=$page_link, edit=$edit_link"
              [t1 last_child] set edit.href $edit_link
              [t1 last_child] set edit " "
            }
            if {$allow_delete} {
              if {![info exists p]} {
                set p [::xo::db::CrClass get_instance_from_db -item_id 0 -revision_id $page_id]
              }
              set delete_link [$entry_package_id make_link -link $page_link $p delete return_url]
              [t1 last_child] set delete.href $delete_link
              [t1 last_child] set delete " "
            }
            if {$show_heritage} {
              if {$entry_package_id == [my package_id]} {
                set href ""
                set title "" 
                set alt ""
                set class ""
                set label ""
              } else {
                # provide a link to the original
                set href $page_link
                set label [$entry_package_id instance_name]
                set title [_ xowiki.view_in_context [list context $label]]
                set alt $title
                set class "inherited"
              }
              [t1 last_child] set inherited $label
              [t1 last_child] set inherited.href $href
              [t1 last_child] set inherited.title $title
              [t1 last_child] set inherited.CSSclass $class
            }
          }
        return [t1 asHTML]
      }
    

Variables

::xowiki::includelet::recent set __default_metaclass ::xotcl::Class
::xowiki::includelet::recent set __default_superclass ::xotcl::Object
::xowiki::includelet::recent set aggregating false
::xowiki::includelet::recent set cacheable false
::xowiki::includelet::recent set localized true
::xowiki::includelet::recent set personalized true

Methods: Source: Variables:
[All Methods | Documented Methods | Hide Methods] [Display Source | Hide Source] [Show Variables | Hide Variables]