Index: openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml,v
diff -u -r1.49 -r1.50
--- openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml 13 Nov 2008 14:48:32 -0000 1.49
+++ openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml 24 Nov 2008 14:06:06 -0000 1.50
@@ -118,11 +118,13 @@
RSS Client
Search
Search pages of this package ...
+ To create a click, click on a page name
Title
Title
Unread Items
View
+ View page in original context %context%
View this page ...
more...
%errorMsg%
Index: openacs-4/packages/xowiki/tcl/form-field-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/form-field-procs.tcl,v
diff -u -r1.119 -r1.120
--- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 6 Nov 2008 20:53:45 -0000 1.119
+++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 24 Nov 2008 14:06:06 -0000 1.120
@@ -1097,6 +1097,7 @@
javascript
{height}
{style}
+ {wiki_p true}
}
richtext::xinha set editor_mixin 1
richtext::xinha instproc initialize {} {
@@ -1108,12 +1109,13 @@
-default [::xo::parameter get_from_package_key \
-package_key "acs-templating" -parameter "XinhaDefaultPlugins"]]
}
- my set options [my get_attributes editor plugins width height folder_id script_dir javascript]
+ my set options [my get_attributes editor plugins width height folder_id script_dir javascript wiki_p]
# for the time being, we can't set the defaults via parameter,
# but only manually, since the editor is used as a mixin, the parameter
# would have precedence over the defaults of subclasses
if {![my exists height]} {my set height 350px}
if {![my exists style]} {my set style "width: 100%;"}
+ if {![my exists wiki_p]} {my set wiki_p 1}
}
richtext::xinha instproc render_input {} {
set disabled [expr {[my exists disabled] && [my disabled] ne "false"}]
@@ -1129,7 +1131,7 @@
array set o [my set options]
set xinha_options ""
- foreach e {width height folder_id fs_package_id file_types attach_parent_id} {
+ foreach e {width height folder_id fs_package_id file_types attach_parent_id wiki_p package_id} {
if {[info exists o($e)]} {
append xinha_options "xinha_config.$e = '$o($e)';\n"
}
Index: openacs-4/packages/xowiki/tcl/includelet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/includelet-procs.tcl,v
diff -u -r1.78 -r1.79
--- openacs-4/packages/xowiki/tcl/includelet-procs.tcl 23 Nov 2008 18:43:42 -0000 1.78
+++ openacs-4/packages/xowiki/tcl/includelet-procs.tcl 24 Nov 2008 14:06:07 -0000 1.79
@@ -248,6 +248,54 @@
}
}
+ ::xowiki::Includelet proc listing {
+ -package_id
+ {-count:boolean false}
+ {-folder_id}
+ {-parent_id}
+ {-page_size 20}
+ {-page_number ""}
+ {-orderby ""}
+ } {
+ 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, 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 sql [::xo::db::sql select \
+ -vars $attribute_selection \
+ -from "cr_items i, cr_revisions r, xowiki_page p, acs_objects o" \
+ -where "[::xowiki::Includelet parent_id_clause -bt i -base_package_id $package_id] \
+ 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'" \
+ -orderby $orderby \
+ -limit $limit -offset $offset]
+
+ if {$count} {
+ return [db_string [my qn presence_count_users] $sql]
+ } else {
+ set s [::xowiki::Page instantiate_objects -sql $sql]
+ return $s
+ }
+ }
+
+
+ #
+ # inherited methods for all includelets
+ #
+
::xowiki::Includelet instproc resolve_page_name {page_name} {
return [[my set __including_page] resolve_included_page_name $page_name]
}
@@ -809,20 +857,15 @@
ImageField_DeleteIcon delete -label ""
}
}
-
- db_foreach [my qn get_pages] \
- [::xo::db::sql select \
- -vars "i.name, r.title, p.page_id, r.publish_date, i.parent_id, o.package_id, \
- to_char(r.publish_date,'YYYY-MM-DD HH24:MI:SS') as formatted_date" \
- -from "cr_items i, cr_revisions r, xowiki_page p, acs_objects o" \
- -where "[::xowiki::Includelet parent_id_clause -bt i -base_package_id $package_id] \
- 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'" \
- -orderby "publish_date desc" \
- -limit $max_entries ] {
+ 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 name parent_id title formatted_date page_id
+ set entry_package_id [$entry set package_id]
+
set page_link [[my package_id] pretty_link -parent_id $parent_id $name]
t1 add \
-title $title \
@@ -831,28 +874,28 @@
if {$allow_edit} {
set p [::xo::db::CrClass get_instance_from_db -item_id 0 -revision_id $page_id]
- set edit_link [$package_id make_link -link $page_link $p edit return_url]
+ 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
}
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 [$package_id make_link -link $page_link $p delete return_url]
+ set delete_link [$entry_package_id make_link -link $page_link $p delete return_url]
[t1 last_child] set delete.href $delete_link
}
if {$show_heritage} {
- if {$package_id == [my package_id]} {
+ 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 [$package_id pretty_link -parent_id $parent_id $name]
- set label [$package_id instance_name]
+ set href [$entry_package_id pretty_link -parent_id $parent_id $name]
+ set label [$entry_package_id instance_name]
set title [_ xowiki.view_in_context [list context $label]]
set alt $title
set class "inherited"