<pre>
XoWiki is a Wiki implementation for OpenACS in XOTcl. Instead of
@@ -54,7 +54,7 @@
BSD-Style
0
-
+
Index: openacs-4/packages/xowiki/tcl/link-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/link-procs.tcl,v
diff -u -r1.31 -r1.32
--- openacs-4/packages/xowiki/tcl/link-procs.tcl 9 Aug 2007 18:05:53 -0000 1.31
+++ openacs-4/packages/xowiki/tcl/link-procs.tcl 13 Aug 2007 13:52:11 -0000 1.32
@@ -219,6 +219,19 @@
}
}
+ Class create ::xowiki::Link::css -superclass ::xowiki::Link::file -parameter {
+ }
+ ::xowiki::Link::css instproc render_found {href label} {
+ ::xowiki::Page requireCSS $href
+ return ""
+ }
+ Class create ::xowiki::Link::js -superclass ::xowiki::Link::file -parameter {
+ }
+ ::xowiki::Link::js instproc render_found {href label} {
+ ::xowiki::Page requireJS $href
+ return ""
+ }
+
Class create ::xowiki::Link::swf -superclass ::xowiki::Link::file -parameter {
width height bgcolor version
quality wmode align salign play loop menu scale
Index: openacs-4/packages/xowiki/tcl/package-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/package-procs.tcl,v
diff -u -r1.81 -r1.82
--- openacs-4/packages/xowiki/tcl/package-procs.tcl 10 Aug 2007 18:39:22 -0000 1.81
+++ openacs-4/packages/xowiki/tcl/package-procs.tcl 13 Aug 2007 13:52:11 -0000 1.82
@@ -145,7 +145,8 @@
#my msg "lang=$lang name=$name"
set encoded_name [string map [list %2d - %5f _ %2e .] [ns_urlencode $name]]
if {$download} {
- set url ${host}${package_prefix}download/${lang}/$encoded_name$anchor
+ #set url ${host}${package_prefix}download/${lang}/$encoded_name$anchor
+ set url ${host}${package_prefix}download/file/$encoded_name$anchor
} elseif {$lang ne $default_lang || [[self class] exists www-file($name)]} {
set url ${host}${package_prefix}${lang}/$encoded_name$anchor
} else {
@@ -466,6 +467,9 @@
if {$item_id == 0 && $lang eq "download"
&& [regexp {^([^/]+)/(.*)$} $local_name _ prefix base_name]} {
set item_id [::Generic::CrItem lookup -name ${prefix}:$base_name -parent_id $folder_id]
+ if {$item_id == 0} {
+ set item_id [::Generic::CrItem lookup -name image:$base_name -parent_id $folder_id]
+ }
if {$item_id != 0} {
upvar $method_var method
set method download
Index: openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl,v
diff -u -r1.30 -r1.31
--- openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl 1 Aug 2007 20:02:51 -0000 1.30
+++ openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl 13 Aug 2007 13:52:11 -0000 1.31
@@ -231,6 +231,7 @@
}
::xowiki::update_views
}
+
if {[apm_version_names_compare $from_version_name "0.56"] == -1 &&
[apm_version_names_compare $to_version_name "0.56"] > -1} {
ns_log notice "-- upgrading to 0.56"
@@ -292,13 +293,35 @@
if {[apm_version_names_compare $from_version_name "0.60"] == -1 &&
[apm_version_names_compare $to_version_name "0.60"] > -1} {
ns_log notice "-- upgrading to 0.60"
- # load for all xowiki package instances te weblog-portlet prototype page
+ # load for all xowiki package instances the weblog-portlet prototype page
foreach package_id [::xowiki::Package instances] {
::xowiki::Package initialize -package_id $package_id -init_url false
$package_id import_prototype_page weblog-portlet
}
}
+ set v 0.62
+ if {[apm_version_names_compare $from_version_name $v] == -1 &&
+ [apm_version_names_compare $to_version_name $v] > -1} {
+ ns_log notice "-- upgrading to $v"
+
+ # for all xowiki package instances
+ foreach package_id [::xowiki::Package instances] {
+ ::xowiki::Package initialize -package_id $package_id -init_url false
+ # rename swf:name and image:name to file:name
+ db_dml change_swf \
+ "update cr_items set name = 'file' || substring(name,4) \
+ where name like 'swf:%' and parent_id = [$package_id folder_id]"
+ db_dml change_image \
+ "update cr_items set name = 'file' || substring(name,6) \
+ where name like 'image:%' and parent_id = [$package_id folder_id]"
+ # reload updated prototype pages
+ $package_id import_prototype_page book
+ $package_id import_prototype_page weblog
+ # TODO check: jon.griffin
+ }
+ }
+
if {[apm_version_names_compare $from_version_name "0.65"] == -1 &&
[apm_version_names_compare $to_version_name "0.65"] > -1} {
ns_log notice "-- upgrading to 0.65"
Index: openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl,v
diff -u -r1.85 -r1.86
--- openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 9 Aug 2007 18:05:53 -0000 1.85
+++ openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 13 Aug 2007 13:52:11 -0000 1.86
@@ -164,6 +164,7 @@
.mp3 {set mime audio/mpeg}
.cdf {set mime application/x-netcdf}
.flv {set mime video/x-flv}
+ .swf {set mime application/x-shockwave-flash}
}
}
return $mime
Index: openacs-4/packages/xowiki/tcl/xowiki-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-procs.tcl,v
diff -u -r1.164 -r1.165
--- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 10 Aug 2007 10:55:01 -0000 1.164
+++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 13 Aug 2007 13:52:11 -0000 1.165
@@ -641,22 +641,51 @@
set name ""
my instvar parent_id package_id
- # do we have a language link (it starts with a ':')
if {[regexp {^:(..):(.*)$} $link _ lang stripped_name]} {
+ # language link (it starts with a ':')
set link_type language
- } elseif {[regexp {^(file|image|swf):(.*)$} $link _ link_type stripped_name]} {
+ } elseif {[regexp {^(file|image|js|css|swf):(.*)$} $link _ \
+ link_type stripped_name]} {
+ # (typed) file links
set lang ""
- set name $link
+ set name file:$stripped_name
+ } elseif {[regexp {^:(..):(.*)$} $link _ lang stripped_name]} {
+ set link_type language
} else {
# do we have a typed link?
- if {![regexp {^([^:][^:][^:]+):((..):)?(.+)$} $link _ link_type _ lang stripped_name]} {
+ if {![regexp {^([^:][^:][^:]+):((..):)?(.+)$} $link _ \
+ link_type _ lang stripped_name]} {
# must be an untyped link; defaults, in case the second regexp does not match either
set lang ""
- set link_type link
set stripped_name $link
+
regexp {^(..):(.+)$} $link _ lang stripped_name
+ switch -glob -- [::xowiki::guesstype $link] {
+ text/css {
+ set link_type css
+ set name file:$stripped_name
+ }
+ application/x-javascript {
+ set link_type js
+ set name file:$stripped_name
+ }
+ application/x-shockwave-flash {
+ set link_type swf
+ set name swf:$stripped_name; # not consistent, but backward compatible
+ }
+ image/* {
+ set link_type image
+ set name image:$stripped_name
+ }
+ default {
+ set link_type link
+ set name $stripped_name
+ }
+ }
}
}
+
+ #my msg name=$name,stripped_name=$stripped_name,link_type=$link_type,lang=$lang
set normalized_name [::$package_id normalize_name $stripped_name]
if {$lang eq ""} {set lang [my lang]}
if {$name eq ""} {set name $lang:$normalized_name}
@@ -971,7 +1000,8 @@
File instproc get_content {} {
my instvar name mime_type description parent_id package_id creation_user
# don't require permissions here, such that rss can present the link
- set page_link [$package_id make_link -privilege public [self] download ""]
+ #set page_link [$package_id make_link -privilege public [self] download ""]
+ set page_link [$package_id pretty_link -download true [my name]]
#my log "--F page_link=$page_link ---- "
set t [TableWidget new -volatile \
-columns {
Index: openacs-4/packages/xowiki/www/prototypes/book.page
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/prototypes/book.page,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/xowiki/www/prototypes/book.page 9 Aug 2007 11:45:18 -0000 1.3
+++ openacs-4/packages/xowiki/www/prototypes/book.page 13 Aug 2007 13:52:11 -0000 1.4
@@ -8,7 +8,7 @@
>>right-col75<<
@title@
Creator: @creator@
-{{book -menu_buttons "edit-item-button create-item-button delete-item-button"}}
+{{book -menu_buttons "edit copy create delete"}}
>><<
}