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::child-resources

Class Hierarchy of ::xowiki::includelet::child-resources

  • ::xotcl::Object[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]
      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]
        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::child-resources[i]
          Parameter for instances:
          parameter_declaration (default " {-skin:optional "yui-skin-sam"} {-show_types "::xowiki::Page,::xowiki::File,::xowiki::Form,::xowiki::FormPage"} {-regexp:optional} {-with_subtypes:optional false} {-orderby:optional "last_modified,desc"} {-publish_status "ready"} {-view_target ""} {-html-content} {-parent .} {-hide} {-menubar ""} ")
          Methods for instances:
          render, types_to_show
          Methods to be applied on the class:
          Methods provided by the meta-class

Class Relations

  • superclass: ::xowiki::Includelet[i]
::xowiki::IncludeletClass create ::xowiki::includelet::child-resources \
     -superclass ::xowiki::Includelet \
     -parameter {{
		parameter_declaration {
		    {-skin:optional "yui-skin-sam"}
		    {-show_types "::xowiki::Page,::xowiki::File,::xowiki::Form,::xowiki::FormPage"}
		    {-with_subtypes:optional false}
		    {-orderby:optional "last_modified,desc"}
		    {-publish_status "ready"}
		    {-view_target ""}
		    {-parent .}
		    {-menubar ""}


  • instproc render

    ::1787226 instproc render {} {
          my get_parameters
          set current_folder [my set __including_page]
          if {$parent eq ".."} {
    	set current_folder [$current_folder parent_id]
    	::xo::db::CrClass get_instance_from_db -item_id $current_folder
          if {![$current_folder istype ::xowiki::FormPage]} {
    	# current folder has to be a FormPage
    	set current_folder [$current_folder parent_id]
    	if {![$current_folder istype ::xowiki::FormPage]} {
    	  error "child-resources not included from a FormPage"
          set current_folder_id [$current_folder item_id]
          if {[::xo::cc query_parameter m] ne "list" && $parent ne ".."} {
    	set index [$current_folder property index]
    	if {$index ne ""} {
    	  set download [string match "file:*" $index]
    	  set index_link [$package_id pretty_link  -parent_id [$current_folder item_id]  -download $download  $index]
    	  return [$package_id returnredirect $index_link]
          set logical_folder_id $current_folder_id
          if {[$current_folder exists physical_item_id]} {
    	set current_folder_id [$current_folder set physical_item_id]
          $package_id instvar package_key
          set return_url [::xo::cc url] ;#"[$package_id package_url]edit-done"
          set category_url [export_vars -base [$package_id package_url] { {manage-categories 1} {object_id $package_id}}]
          set columns {objects edit object_type name last_modified mod_user delete}
          foreach column $columns {set ::hidden($column) 0 }
          if {[info exists hide]} {
    	foreach column $hide {if {[info exists ::hidden($column)]} {set ::hidden($column) 1}}
          # We have to use the global variable for the time being due to
          # scoping in "-columns"
          set ::with_publish_status [expr {$publish_status ne "ready"}]
          set t [::YUI::DataTable new -skin $skin -volatile  -columns {
    		   BulkAction objects -id ID -hide $::hidden(objects) -actions {
    		     Action new -label select -tooltip select -url admin/select
    		   # The "-html" options are currenty ignored in the YUI
    		   # DataTable. Not sure, it can be integrated in the traditional way. 
    		   # A full example for skinning the datatable is here:
    		   # http://developer.yahoo.com/yui/examples/datatable/dt_skinning.html
    		   HiddenField ID
    		   AnchorField edit -CSSclass edit-item-button -label ""  -hide $::hidden(edit)  -html {style "padding: 0px;"}
    		   if {$::with_publish_status} {
    		     ImageAnchorField publish_status -orderby publish_status.src -src ""  -width 8 -height 8 -border 0 -title "Toggle Publish Status"  -alt "publish status" -label [_ xowiki.publish_status] -html {style "padding: 2px;text-align: center;"}
    		   Field object_type -label [_ xowiki.page_kind] -orderby object_type -richtext false  -hide $::hidden(object_type)  -html {style "padding: 0px;"}
    		   AnchorField name -label [_ xowiki.Page-name] -orderby name  -hide $::hidden(name)  -html {style "padding: 2px;"}
    		   Field last_modified -label [_ xowiki.Page-last_modified] -orderby last_modified  -hide $::hidden(last_modified) 
    		   Field mod_user -label [_ xowiki.By_user] -orderby mod_user  -hide $::hidden(mod_user) 
    		   AnchorField delete -CSSclass delete-item-button  -hide $::hidden(delete)  -label "" ;#-html {onClick "return(confirm('Confirm delete?'));"}
          set extra_where_clause "true"
          # TODO: why filter on title and name?
          if {[info exists regexp]} {set extra_where_clause "(bt.title ~ '$regexp' OR ci.name ~ '$regexp' )"}
          set items [::xowiki::FormPage get_all_children  -folder_id $current_folder_id  -publish_status $publish_status  -object_types [my types_to_show]  -extra_where_clause $extra_where_clause]
          set package_id [::xo::cc package_id]
          set pkg ::$package_id
          set url [::xo::cc url]
          $pkg get_lang_and_name -default_lang "" -name [$current_folder name] lang name
          set folder [$pkg folder_path -parent_id [$current_folder parent_id]]
          set folder_ids [$items set folder_ids]
          foreach c [$items children] {
    	set name [$c name]
    	set page_link [::$package_id pretty_link  -parent_id $logical_folder_id  -context_url $url  -folder_ids $folder_ids  $name]
    	array set icon [$c render_icon]
    	if {[catch {set prettyName [$c pretty_name]} errorMsg]} {
    	  my msg "can't obtain pretty name of [$c item_id] [$c name]: $errorMsg"
    	  set prettyName $name
    	#set delete_link [export_vars -base  [$package_id package_url]  #		      [list {delete 1}  #			   [list item_id [$c item_id]]  #			   [list name [$c pretty_link]] return_url]]
    	set delete_link [export_vars -base $page_link {{m delete} return_url}]
    	$t add  -ID [$c name]  -name $prettyName  -name.href [export_vars -base $page_link {template_file html-content}]  -name.title [$c set title]  -object_type $icon(text)  -object_type.richtext $icon(is_richtext)  -last_modified [$c set last_modified]  -edit ""  -edit.href [export_vars -base $page_link {{m edit} return_url}]  -edit.title Edit  -mod_user [::xo::get_user_name [$c set creation_user]]  -delete ""  -delete.href $delete_link  -delete.title Delete
    	if {$::with_publish_status} {
    	  # TODO: this should get some architectural support
    	  if {[$c set publish_status] eq "ready"} {
    	    set image active.png
    	    set state "production"
    	  } else {
    	    set image inactive.png
    	    set state "ready"
    	  set revision_id [$c set revision_id]
    	  [$t last_child] set publish_status.src /resources/xowiki/$image
    	  [$t last_child] set publish_status.href  [export_vars -base [$package_id package_url]admin/set-publish-state  {state revision_id return_url}]
          foreach {att order} [split $orderby ,] break
          $t orderby -order [expr {$order eq "asc" ? "increasing" : "decreasing"}] $att
          set resources_list "[$t asHTML]"
          if {$menubar ne ""} {
    	set mb [::xowiki::MenuBar new -id submenubar]
    	# for now, just the first group
    	lassign $menubar Menu entries
    	$mb add_menu -name $Menu
    	set menuEntries {}
    	foreach e $entries {
    	  switch $e {
    	    ::xowiki::File {
    	      lappend menuEntries {entry -name New.File -label File -object_type ::xowiki::File}
    	    default {ns_log notice "can't handle $e in submenubar so far"}
    	$mb update_items  -package_id $package_id  -parent_id $current_folder_id  -return_url $return_url  -nls_language [$current_folder get_nls_language_from_lang [::xo::cc lang]]  $menuEntries
    	set menubar [$mb render-yui]
          set viewers [util_coalesce [$current_folder property viewers] [$current_folder get_parameter viewers]]
          set viewer_links ""
          foreach v $viewers {
    	set wf_link "${v}?p.folder=[${current_folder} name]"
    	append wf_link "&m=create-or-use"
    	append viewer_links [subst -nocommands -nobackslashes {<li><a href="$wf_link">view with $v</a></li>}]
          return "$menubar<ul>$viewer_links</ul> [$t asHTML]"
  • instproc types_to_show

    ::1787226 instproc types_to_show {} {
          my get_parameters
          foreach type [split $show_types ,] {set ($type) 1}
          return [lsort [array names ""]]

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