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 -N -r1.43 -r1.44
--- openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml 8 Sep 2008 10:33:08 -0000 1.43
+++ openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml 10 Sep 2008 08:51:24 -0000 1.44
@@ -54,6 +54,8 @@
Updated form
%errorMsg%
Invalid Form %errorMsg%
+ HTTP Url of the Image (you might drag an image displayed by a web-browser here)
+ Cut&Paste URL of YouTube video (http://www.youtube.com/....)
Assignee
State
Index
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 -N -r1.90 -r1.91
--- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 9 Sep 2008 13:18:23 -0000 1.90
+++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 10 Sep 2008 08:51:24 -0000 1.91
@@ -1285,6 +1285,10 @@
Class youtube_url -superclass text
youtube_url set urlre {^http://www.youtube.com/watch[?]v=(.*)$}
+ youtube_url instproc initialize {} {
+ next
+ if {[my help_text] eq ""} {my help_text "#xowiki.formfield-youtube_url-help_text#"}
+ }
youtube_url instproc pretty_value {v} {
if {$v eq ""} {
return ""
@@ -1314,12 +1318,16 @@
margin margin-left margin-right margin-top margin-bottom
border border-width position top botton left right
}
+ image_url instproc initialize {} {
+ next
+ if {[my help_text] eq ""} {my help_text "#xowiki.formfield-image_url-help_text#"}
+ }
image_url instproc entry_name {value} {
set value [string map [list %2e .] $value]
if {![regexp -nocase {/([^/]+)[.](gif|jpg|jpeg|png)} $value _ name ext]} {
return ""
}
- return image:$name.$ext
+ return file:$name.$ext
}
image_url instproc check=image_check {value} {
if {$value eq ""} {return 1}
@@ -1343,12 +1351,14 @@
my log "--img cannot tranfer image '$value' ($errorMsg)"
return 0
}
+ #my msg "guess mime_type of $entry_name = [::xowiki::guesstype $entry_name]"
set import_file [ns_tmpnam]
::xowiki::write_file $import_file $img
set file_object [::xowiki::File new -destroy_on_cleanup \
-title $entry_name \
-name $entry_name \
-parent_id $folder_id \
+ -mime_type [::xowiki::guesstype $entry_name] \
-package_id [[my object] package_id] \
-creation_user [::xo::cc user_id] \
]