Index: openacs-4/packages/xowiki/www/resources/wymeditor/skins/twopanels/skin.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/wymeditor/skins/twopanels/skin.css,v diff -u -N --- openacs-4/packages/xowiki/www/resources/wymeditor/skins/twopanels/skin.css 1 Jun 2009 07:20:22 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,134 +0,0 @@ -/* - * WYMeditor : what you see is What You Mean web-based editor - * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ - * Dual licensed under the MIT (MIT-license.txt) - * and GPL (GPL-license.txt) licenses. - * - * For further information visit: - * http://www.wymeditor.org/ - * - * File Name: - * screen.css - * main stylesheet for the WYMeditor skin - * See the documentation for more info. - * - * File Authors: - * Daniel Reszka (d.reszka a-t wymeditor dotorg) - * Jean-Francois Hovinne -*/ - -/*TRYING TO RESET STYLES THAT MAY INTERFERE WITH WYMEDITOR*/ - .wym_skin_twopanels p, .wym_skin_twopanels h2, .wym_skin_twopanels h3, - .wym_skin_twopanels ul, .wym_skin_twopanels li { background: transparent url(); margin: 0; padding: 0; border-width:0; list-style: none; } - - -/*HIDDEN BY DEFAULT*/ - .wym_skin_twopanels .wym_area_left { display: block; } - .wym_skin_twopanels .wym_area_right { display: block; } - - -/*TYPO*/ - .wym_skin_twopanels { font-size: 62.5%; font-family: Verdana, Arial, sans-serif; } - .wym_skin_twopanels h2 { font-size: 110%; /* = 11px */} - .wym_skin_twopanels h3 { font-size: 100%; /* = 10px */} - .wym_skin_twopanels li { font-size: 100%; /* = 10px */} - - -/*WYM_BOX*/ - .wym_skin_twopanels { border: 1px solid gray; background: #f2f2f2; padding: 5px} - - /*auto-clear the wym_box*/ - .wym_skin_twopanels:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - * html .wym_skin_twopanels { height: 1%;} - - -/*WYM_HTML*/ - .wym_skin_twopanels .wym_html { width: 98%;} - .wym_skin_twopanels .wym_html textarea { width: 100%; height: 200px; border: 1px solid gray; background: white; } - - -/*WYM_IFRAME*/ - .wym_skin_twopanels .wym_iframe { width: 98%;} - .wym_skin_twopanels .wym_iframe iframe { width: 100%; height: 200px; border: 1px solid gray; background: white } - - -/*AREAS*/ - .wym_skin_twopanels .wym_area_left { width: 100px; float: left;} - .wym_skin_twopanels .wym_area_right { width: 150px; float: right;} - .wym_skin_twopanels .wym_area_bottom { height: 1%; clear: both;} - * html .wym_skin_twopanels .wym_area_main { height: 1%;} - * html .wym_skin_twopanels .wym_area_top { height: 1%;} - *+html .wym_skin_twopanels .wym_area_top { height: 1%;} - -/*SECTIONS SYSTEM*/ - - /*common defaults for all sections*/ - .wym_skin_twopanels .wym_section { margin-bottom: 5px; } - .wym_skin_twopanels .wym_section h2, - .wym_skin_twopanels .wym_section h3 { padding: 1px 3px; margin: 0; } - .wym_skin_twopanels .wym_section a { padding: 0 3px; display: block; text-decoration: none; color: black; } - .wym_skin_twopanels .wym_section a:hover { background-color: yellow; } - /*hide section titles by default*/ - .wym_skin_twopanels .wym_section h2 { display: none; } - /*disable any margin-collapse*/ - .wym_skin_twopanels .wym_section { padding-top: 1px; padding-bottom: 1px; } - /*auto-clear sections*/ - .wym_skin_twopanels .wym_section ul:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - * html .wym_skin_twopanels .wym_section ul { height: 1%;} - - /*option: add this class to a section to make it render as a panel*/ - .wym_skin_twopanels .wym_panel { } - .wym_skin_twopanels .wym_panel h2 { display: block; } - - /*option: add this class to a section to make it render as a dropdown menu*/ - .wym_skin_twopanels .wym_dropdown h2 { display: block; } - .wym_skin_twopanels .wym_dropdown ul { display: none; position: absolute; background: white; } - .wym_skin_twopanels .wym_dropdown:hover ul, - .wym_skin_twopanels .wym_dropdown.hover ul { display: block; } - - /*option: add this class to a section to make its elements render buttons (icons are only available for the wym_tools section for now)*/ - .wym_skin_twopanels .wym_buttons li { float:left;} - .wym_skin_twopanels .wym_buttons a { width: 20px; height: 20px; overflow: hidden; padding: 2px } - /*image replacements*/ - .wym_skin_twopanels .wym_buttons li a { background: url(icons.png) no-repeat; text-indent: -9999px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_strong a { background-position: 0 -382px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_emphasis a { background-position: 0 -22px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_superscript a { background-position: 0 -430px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_subscript a { background-position: 0 -454px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_ordered_list a { background-position: 0 -48px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_unordered_list a{ background-position: 0 -72px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_indent a { background-position: 0 -574px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_outdent a { background-position: 0 -598px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_undo a { background-position: 0 -502px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_redo a { background-position: 0 -526px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_link a { background-position: 0 -96px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_unlink a { background-position: 0 -168px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_image a { background-position: 0 -121px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_table a { background-position: 0 -144px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_paste a { background-position: 0 -552px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_html a { background-position: 0 -193px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_preview a { background-position: 0 -408px;} - -/*DECORATION*/ - .wym_skin_twopanels .wym_section h2 { background: #ddd; border: solid gray; border-width: 0 0 1px;} - .wym_skin_twopanels .wym_section h2 span { color: gray;} - .wym_skin_twopanels .wym_panel { padding: 0; border: solid gray; border-width: 1px; background: white;} - .wym_skin_twopanels .wym_panel ul { margin: 2px 0 5px; } - .wym_skin_twopanels .wym_dropdown { padding: 0; border: solid gray; border-width: 1px 1px 0 1px; } - .wym_skin_twopanels .wym_dropdown ul { border: solid gray; border-width: 0 1px 1px 1px; margin-left: -1px; padding: 5px 10px 5px 3px;} - -/*DIALOGS*/ - .wym_dialog div.row { margin-bottom: 5px;} - .wym_dialog div.row input { margin-right: 5px;} - .wym_dialog div.row label { float: left; width: 150px; display: block; text-align: right; margin-right: 10px; } - .wym_dialog div.row-indent { padding-left: 160px; } - /*autoclearing*/ - .wym_dialog div.row:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - .wym_dialog div.row { display: inline-block; } - /* Hides from IE-mac \*/ - * html .wym_dialog div.row { height: 1%; } - .wym_dialog div.row { display: block; } - /* End hide from IE-mac */ - -/*WYMEDITOR_LINK*/ - a.wym_wymeditor_link { text-indent: -9999px; float: right; display: block; width: 50px; height: 15px; background: url(../wymeditor_icon.png); overflow: hidden; text-decoration: none; } Index: openacs-4/packages/xowiki/www/resources/wymeditor/skins/twopanels/skin.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/wymeditor/skins/twopanels/skin.js,v diff -u -N --- openacs-4/packages/xowiki/www/resources/wymeditor/skins/twopanels/skin.js 12 Oct 2008 19:34:59 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,39 +0,0 @@ -WYMeditor.SKINS['twopanels'] = { - - init: function(wym) { - - //move the containers panel to the left area - jQuery(wym._box).find(wym._options.containersSelector) - .appendTo("div.wym_area_left"); - - //render following sections as panels - jQuery(wym._box).find(wym._options.classesSelector + ', ' - + wym._options.containersSelector) - .addClass("wym_panel"); - - //render following sections as buttons - jQuery(wym._box).find(wym._options.toolsSelector) - .addClass("wym_buttons"); - - // auto add some margin to the main area sides if left area - // or right area are not empty (if they contain sections) - jQuery(wym._box).find("div.wym_area_right ul") - .parents("div.wym_area_right").show() - .parents(wym._options.boxSelector) - .find("div.wym_area_main") - .css({"margin-right": "155px"}); - - jQuery(wym._box).find("div.wym_area_left ul") - .parents("div.wym_area_left").show() - .parents(wym._options.boxSelector) - .find("div.wym_area_main") - .css({"margin-left": "115px"}); - - //make hover work under IE < 7 - jQuery(wym._box).find(".wym_section").hover(function(){ - jQuery(this).addClass("hover"); - },function(){ - jQuery(this).removeClass("hover"); - }); - } -}; Index: openacs-4/packages/xowiki/www/xinha/Makefile =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/xinha/Makefile,v diff -u -N --- openacs-4/packages/xowiki/www/xinha/Makefile 14 Dec 2005 16:13:01 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,14 +0,0 @@ -FILES = *.adp *.tcl blank.html - -SOURCE = /usr/local/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/OacsFs/popups/ - -unlink: - rm -f ${FILES} - cp -p ${SOURCE}/*.html . - cp -p ${SOURCE}/*.adp . - cp -p ${SOURCE}/*.tcl . - -link: - ln -sf ${SOURCE}/*.html . - ln -sf ${SOURCE}/*.adp . - ln -sf ${SOURCE}/*.tcl . Index: openacs-4/packages/xowiki/www/xinha/attach-file.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/xinha/attach-file.adp,v diff -u -N --- openacs-4/packages/xowiki/www/xinha/attach-file.adp 18 Aug 2006 18:57:42 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,285 +0,0 @@ - - - #acs-templating.HTMLArea_InsertImageTitle# - - - - - - - - - - - - -
#acs-templating.HTMLArea_InsertImageTitle# URL click here
- - -
#acs-templating.HTMLArea_InsertImageTitle# Upload click here
-
- - - - - - - - -
- -
- @HTML_UploadTitle@ - - - - - - - - - -
- - - - - - -
@formerror.upload_file@
-

- #acs-templating.This_image_can_be_reused_by#
- - @formgroup.widget;noquote@ @formgroup.label@ -
- [i] - #acs-templating.This_image_can_be_reused_help# - -
@formerror.share@
-
-
-   -
-
-
-
-
-
-
- - - Index: openacs-4/packages/xowiki/www/xinha/attach-file.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/xinha/attach-file.tcl,v diff -u -N --- openacs-4/packages/xowiki/www/xinha/attach-file.tcl 23 Dec 2008 11:34:59 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,145 +0,0 @@ -ad_page_contract { - Simple image upload, attach image to object_id passed in, if no - object_id, use the current package_id - @author Guenter Ernst guenter.ernst@wu-wien.ac.at, - @author Gustaf Neumann neumann@wu-wien.ac.at - @author Dave Bauer (dave@solutiongrove.com) - @creation-date 13.07.2004 - @cvs-id $Id: attach-file.tcl,v 1.2 2008/12/23 11:34:59 gustafn Exp $ -} { - {parent_id:integer} - {selector_type "image"} -} - -set f_url "" - -set user_id [ad_conn user_id] -# if user has write permission, create image upload form, -if {[permission::permission_p -party_id $user_id -object_id $parent_id \ - -privilege "write"]} { - - set write_p 1 - - # FIXME DAVEB i18n for share_options - set share_options [list [list "[_ acs-templating.Only_myself]" private] [list "[_ acs-templating.This_Group]" group] [list "[_ acs-templating.Anyone_on_this_system]" site] [list "[_ acs-templating.Anyone_on_the_internet]" public]] - ad_form \ - -name upload_form \ - -mode edit \ - -export {selector_type file_types parent_id} \ - -html { enctype multipart/form-data } \ - -form { - item_id:key - {upload_file:file(file) {html {size 30}} } - {share:text(radio),optional {label "[_ acs-templating.This_image_can_be_reused_by]"} {options $share_options} {help_text "[_ acs-templating.This_image_can_be_reused_help]"}} - {ok_btn:text(submit) {label "[_ acs-templating.HTMLArea_SelectUploadBtn]"} - } - } \ - -on_request { - set share site - } \ - -on_submit { - # check file name - if {$upload_file eq ""} { - template::form::set_error upload_form upload_file \ - [_ acs-templating.HTMLArea_SpecifyUploadFilename] - break - } - - if {[info exists folder_size]} { - # check per folder quota - set maximum_folder_size [parameter::get -parameter "MaximumFolderSize"] - - if { $maximum_folder_size ne "" } { - if { $folder_size+[file size ${upload_file.tmpfile}] > $maximum_folder_size } { - template::form::set_error upload_form upload_file \ - [_ file-storage.out_of_space] - break - } - } - } - - set file_name [template::util::file::get_property filename $upload_file] - set upload_tmpfile [template::util::file::get_property tmp_filename $upload_file] - set mime_type [template::util::file::get_property mime_type $upload_file] - if {$mime_type eq ""} { - set mime_type [ns_guesstype $file_name] - } - if {$selector_type eq "image" \ - && ![string match "image/*" $mime_type]} { - template::form::set_error upload_form upload_file \ - [_ acs-templating.HTMLArea_SelectImageUploadNoImage] - break - } - if {[string match "image/*" $mime_type]} { - - image::new \ - -item_id $item_id \ - -name ${item_id}_$file_name \ - -parent_id $parent_id \ - -tmp_filename $upload_tmpfile \ - -creation_user $user_id \ - -creation_ip [ad_conn peeraddr] \ - -package_id [ad_conn package_id] - } else { - content::item::new \ - -item_id $item_id \ - -name ${item_id}_$file_name \ - -parent_id $parent_id \ - -tmp_filename $upload_tmpfile \ - -creation_user $user_id \ - -creation_ip [ad_conn peeraddr] \ - -package_id [ad_conn package_id] - } - file delete $upload_tmpfile - permission::grant \ - -object_id $item_id \ - -party_id $user_id \ - -privilege admin - - switch -- $share { - private { - permission::set_not_inherit -object_id $item_id - } - group { - # Find the closest application group - # either dotlrn or acs-subsite - - permission::grant \ - -party_id [acs_magic_object "registered_users"] \ - -object_id $item_id \ - -privilege "read" - } - public { - permission::grant \ - -party_id [acs_magic_object "the_public"] \ - -object_id $item_id \ - -privilege "read" - } - site - - default { - permission::grant \ - -party_id [acs_magic_object "registered_users"] \ - -object_id $item_id \ - -privilege "read" - } - - } - if {$share eq "private"} { - # need a private URL that allows viewers of this - # object to see the image - # this isn't totally secure, because of course - # you need to be able to see the image somehow - # but we only allow read on the image if you can - # see the parent object - set f_url "/image/$item_id/private/$file_name" - } else { - set f_url "/image/$item_id/$file_name" - } - } - -} else { - set write_p 0 -} - -set HTML_Preview "Preview" -set HTML_UploadTitle "" \ No newline at end of file Index: openacs-4/packages/xowiki/www/xinha/blank.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/xinha/blank.html,v diff -u -N --- openacs-4/packages/xowiki/www/xinha/blank.html 14 Dec 2005 16:13:01 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1 +0,0 @@ \ No newline at end of file Index: openacs-4/packages/xowiki/www/xinha/file-selector.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/xinha/file-selector.adp,v diff -u -N --- openacs-4/packages/xowiki/www/xinha/file-selector.adp 2 Oct 2008 07:43:37 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,175 +0,0 @@ - - - @HTML_Title@ - - - - - - - - - - -
@HTML_Title@
-
@HTML_Context@
- -
- @HTML_Legend@ - -
@up_name@
-
-
@folder_name@
- -
- -
-
- - @error_msg@ - -
- - - - - - - - - - - -
-
- @HTML_Preview@ - -
-
- -
- @HTML_UploadTitle@ - - - - - - - - - -
- - - - - - -
@formerror.upload_file@
-
-
- -
-
-
-
-
-
- - -
-
- - - - Index: openacs-4/packages/xowiki/www/xinha/file-selector.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/xinha/file-selector.tcl,v diff -u -N --- openacs-4/packages/xowiki/www/xinha/file-selector.tcl 18 Mar 2010 10:03:56 -0000 1.13 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,339 +0,0 @@ -ad_page_contract { - @author Guenter Ernst guenter.ernst@wu-wien.ac.at - @author Gustaf Neumann neumann@wu-wien.ac.at - @creation-date 13.10.2005 - @cvs-id $Id: file-selector.tcl,v 1.13 2010/03/18 10:03:56 gustafn Exp $ -} { - {fs_package_id:integer,notnull,optional} - {folder_id:integer,optional} - {orderby:optional} - {selector_type "image"} - {file_types "*"} -} - -set HTML_NothingSelected [_ acs-templating.HTMLArea_SelectImageNothingSelected] -switch -- $selector_type { - "image" { - set HTML_Title [_ acs-templating.HTMLArea_SelectImageTitle] - set HTML_Legend [_ acs-templating.HTMLArea_SelectImage] - set HTML_Preview [_ acs-templating.HTMLArea_SelectImagePreview] - set HTML_UploadTitle [_ acs-templating.HTMLArea_SelectImageUploadTitle] - set HTML_Context "COMMUNITY NAME" - } - "file" { - set HTML_Title [_ acs-templating.HTMLArea_SelectFileTitle] - set HTML_Legend [_ acs-templating.HTMLArea_SelectFile] - set HTML_Preview [_ acs-templating.HTMLArea_SelectImagePreview] - set HTML_UploadTitle [_ acs-templating.HTMLArea_SelectFileUploadTitle] - set HTML_Context "COMMUNITY NAME" - } -} - -if {![info exists fs_package_id]} { - # we have not filestore package_id. This must be the first call. - if {[info exists folder_id]} { - # get package_id from folder_id - foreach {fs_package_id root_folder_id} \ - [fs::get_folder_package_and_root $folder_id] break - } else { - # get package_id from package name - set key file-storage - # get file-storage instance from this subsite - set subsite_node [subsite::get_element -element node_id] - set mount_url [site_node::get_children -package_key $key -node_id $subsite_node] - if { $mount_url eq "" } { - # no file-storage instance at this subsite so look to main site - set subsite_node [subsite::get_element -subsite_id [subsite::main_site_id] -element node_id] - set mount_url [site_node::get_children -package_key file-storage -node_id $subsite_node] - } - if { $mount_url ne "" } { - # file-storage instance IS at main site - array set site_node [site_node::get -url $mount_url] - set fs_package_id $site_node(package_id) - } else { - # look for any file-storage instance - # probably not what user wants; could return error instead - set id [apm_version_id_from_package_key $key] - set mount_url [site_node::get_children -all -package_key $key -node_id $id] - if {$mount_url ne ""} { - array set site_node [site_node::get -url $mount_url] - set fs_package_id $site_node(package_id) - } - } - } -} - -set write_p 0 -set error_msg "" -set folder_name "*** unknown ***" -array set formerror [list upload_file $error_msg] - -if {![info exists folder_id]} { - if {![info exists fs_package_id]} { - # The folder_id was not specified, the fs_package_id was not - # specified, and we could not locate any usable file-storage. We - # give up with a semi-i18ned message, nobody should ever see - # this... - set error_msg "[_ file-storage.lt_bad_folder_id_folder_].\nPerhaps you have no file-storage package mounted?" - array set formerror [list upload_file $error_msg] - ad_complain $error_msg - return - } - set folder_id [fs_get_root_folder -package_id $fs_package_id] - set root_folder_id $folder_id -} - -if {![fs_folder_p $folder_id]} { - set error_msg [_ file-storage.lt_The_specified_folder__1] - array set formerror [list upload_file $error_msg] - ad_complain $error_msg - return -} - - -# now we have at least a valid folder_id and a valid fs_package_id -if {![info exists root_folder_id]} { - set root_folder_id [fs_get_root_folder -package_id $fs_package_id] -} - -set fs_url [lindex [site_node::get_url_from_object_id -object_id $fs_package_id] 0] - -# # Don't allow delete if root folder -set root_folder_p [expr {$folder_id == $root_folder_id}] - -set user_id [ad_conn user_id] -permission::require_permission \ - -party_id $user_id -object_id $folder_id \ - -privilege "read" - -set up_url {} - -if { !$root_folder_p} { - set parent_folder_id [fs::get_parent -item_id $folder_id] - set up_name [fs::get_object_name -object_id $parent_folder_id] - set up_url [export_vars -base file-selector \ - {fs_package_id {folder_id $parent_folder_id} - selector_type file_types}] -} - - -# if user has write permission, create image upload form, -if {[permission::permission_p -party_id $user_id -object_id $folder_id \ - -privilege "write"]} { - set write_p 1 - ad_form \ - -name upload_form \ - -mode edit \ - -export {fs_package_id folder_id orderby selector_type file_types} \ - -html { enctype multipart/form-data } \ - -form { - {upload_file:file(file) {html {size 30}} } - {ok_btn:text(submit) {label "[_ acs-templating.HTMLArea_SelectUploadBtn]"} - } - } \ - -on_submit { - # check file name - if {$upload_file eq ""} { - template::form::set_error upload_form upload_file \ - [_ acs-templating.HTMLArea_SpecifyUploadFilename] - break - } - - if {[info exists folder_size]} { - # check per folder quota - set maximum_folder_size [parameter::get -parameter "MaximumFolderSize"] - - if { $maximum_folder_size ne "" } { - if { $folder_size+[file size ${upload_file.tmpfile}] > $maximum_folder_size } { - template::form::set_error upload_form upload_file \ - [_ file-storage.out_of_space] - break - } - } - } - - set file_name [template::util::file::get_property filename $upload_file] - set upload_tmpfile [template::util::file::get_property tmp_filename $upload_file] - set mime_type [template::util::file::get_property mime_type $upload_file] - - if {$selector_type eq "image" && ![string match "image/*" $mime_type]} { - template::form::set_error upload_form upload_file \ - [_ acs-templating.HTMLArea_SelectImageUploadNoImage] - break - } - - set existing_file_id [fs::get_item_id -name $file_name -folder_id $folder_id] - - if {$existing_file_id ne ""} { - # write new revision - fs::add_file \ - -name $file_name \ - -item_id $existing_file_id \ - -parent_id $folder_id \ - -tmp_filename $upload_tmpfile \ - -creation_user $user_id \ - -creation_ip [ad_conn peeraddr] \ - -package_id $fs_package_id - } else { - # write file - fs::add_file \ - -name $file_name \ - -parent_id $folder_id \ - -tmp_filename $upload_tmpfile \ - -creation_user $user_id \ - -creation_ip [ad_conn peeraddr] \ - -package_id $fs_package_id - } - - } -} - -# display the contents - -set folder_name [lang::util::localize [fs::get_object_name -object_id $folder_id]] -set content_size_total 0 - -set folder_path [::xo::db::sql::content_item get_path \ - -item_id $folder_id \ - -root_folder_id $root_folder_id] - -# -pass_to_urls {c} - -template::list::create \ - -name contents \ - -multirow contents \ - -pass_properties {fs_package_id selector_type folder_id} \ - -key object_id \ - -html {width 100%}\ - -filters {folder_id {} file_types {} selector_type {} fs_package_id {}} \ - -elements { - name { - label "[_ file-storage.Name]" - display_template { - - - - - - - #file-storage.@contents.type@# - onclick="selectImage('@contents.object_id@','@contents.file_url@','@contents.type@');return false;">@contents.name@ - } - orderby_desc {name desc} - orderby_asc {name asc} - html {nowrap ""} - } - content_size_pretty { - label "[_ file-storage.Size]" - orderby_desc {content_size desc} - orderby_asc {content_size asc} - } - type { - label "[_ file-storage.Type]" - orderby_desc {type desc} - orderby_asc {type asc} - } - last_modified_pretty { - label "[_ file-storage.Last_Modified]" - orderby_desc {last_modified_ansi desc} - orderby_asc {last_modified_ansi asc} - html {nowrap ""} - } - } - -set order_by_clause [expr {[exists_and_not_null orderby] ? - [template::list::orderby_clause -orderby -name contents] : - " order by fs_objects.sort_key, fs_objects.name asc"}] - - -if {$selector_type eq "image"} { - set file_types "image/%" -} -set filter_clause [expr {$file_types eq "*" ? "" : - "and (type like '$file_types' or type = 'folder')" }] - -set fs_sql "select object_id, name, live_revision, type, title, - to_char(last_modified, 'YYYY-MM-DD HH24:MI:SS') as last_modified_ansi, - content_size, url, sort_key, file_upload_name, - case - when :folder_path is null - then fs_objects.name - else :folder_path || '/' || name - end as file_url, - case - when last_modified >= (now() - cast('99999' as interval)) - then 1 - else 0 - end as new_p - from fs_objects - where parent_id = :folder_id - and exists (select 1 - from acs_object_party_privilege_map m - where m.object_id = fs_objects.object_id - and m.party_id = :user_id - and m.privilege = 'read') - $filter_clause - $order_by_clause" - -db_multirow -extend { - icon last_modified_pretty content_size_pretty - properties_link properties_url folder_p title -} contents get_fs_contents $fs_sql { - set last_modified_ansi [lc_time_system_to_conn $last_modified_ansi] - set last_modified_pretty [lc_time_fmt $last_modified_ansi "%x %X"] - set content_size_pretty [lc_numeric $content_size] - - if {$type eq "folder"} { - # append content_size_pretty " [_ file-storage.items]" - set content_size_pretty "" - } else { - append content_size_pretty " [_ file-storage.bytes]" - } - if {$title eq ""} {set title $name} - - set file_upload_name [fs::remove_special_file_system_characters \ - -string $file_upload_name] - - if { $content_size ne "" } { - incr content_size_total $content_size - } - - set name [lang::util::localize $name] - - switch -- $type { - folder { - set folder_p 1 - set icon /resources/file-storage/folder.gif - set file_url [export_vars -base file-selector \ - {fs_package_id {folder_id $object_id} - selector_type file_types}] - } - url { - set folder_p 1 - set icon /resources/url-button.gif - set file_url $fs_url/$url - } - default { - set folder_p 0 - set icon /resources/file-storage/file.gif - set file_url ${fs_url}view/$file_url - } - } - - - # We need to encode the hashes in any i18n message keys (.LRN plays - # this trick on some of its folders). If we don't, the hashes will cause - # the path to be chopped off (by ns_conn url) at the leftmost hash. - regsub -all {\#} $file_url {%23} file_url -} - - - - -ad_return_template Index: openacs-4/packages/xowiki/www/xinha/insert-file.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/xinha/insert-file.adp,v diff -u -N --- openacs-4/packages/xowiki/www/xinha/insert-file.adp 17 Aug 2006 21:29:29 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,285 +0,0 @@ - - - #acs-templating.HTMLArea_InsertImageTitle# - - - - - - - - - - - - -
#acs-templating.HTMLArea_InsertImageTitle# URL click here
- - -
#acs-templating.HTMLArea_InsertImageTitle# Upload click here
-
- - - - - - - - -
- -
- @HTML_UploadTitle@ - - - - - - - - - -
- - - - - - -
@formerror.upload_file@
-

- #acs-templating.This_image_can_be_reused_by#
- - @formgroup.widget;noquote@ @formgroup.label@ -
- [i] - #acs-templating.This_image_can_be_reused_help# - -
@formerror.share@
-
-
-   -
-
-
-
-
-
-
- - - Index: openacs-4/packages/xowiki/www/xinha/insert-file.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/xinha/insert-file.tcl,v diff -u -N --- openacs-4/packages/xowiki/www/xinha/insert-file.tcl 23 Dec 2008 11:34:59 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,145 +0,0 @@ -ad_page_contract { - Simple image upload, attach image to object_id passed in, if no - object_id, use the current package_id - @author Guenter Ernst guenter.ernst@wu-wien.ac.at, - @author Gustaf Neumann neumann@wu-wien.ac.at - @author Dave Bauer (dave@solutiongrove.com) - @creation-date 13.07.2004 - @cvs-id $Id: insert-file.tcl,v 1.2 2008/12/23 11:34:59 gustafn Exp $ -} { - {parent_id:integer} - {selector_type "image"} -} - -set f_url "" - -set user_id [ad_conn user_id] -# if user has write permission, create image upload form, -if {[permission::permission_p -party_id $user_id -object_id $parent_id \ - -privilege "write"]} { - - set write_p 1 - - # FIXME DAVEB i18n for share_options - set share_options [list [list "[_ acs-templating.Only_myself]" private] [list "[_ acs-templating.This_Group]" group] [list "[_ acs-templating.Anyone_on_this_system]" site] [list "[_ acs-templating.Anyone_on_the_internet]" public]] - ad_form \ - -name upload_form \ - -mode edit \ - -export {selector_type file_types parent_id} \ - -html { enctype multipart/form-data } \ - -form { - item_id:key - {upload_file:file(file) {html {size 30}} } - {share:text(radio),optional {label "[_ acs-templating.This_image_can_be_reused_by]"} {options $share_options} {help_text "[_ acs-templating.This_image_can_be_reused_help]"}} - {ok_btn:text(submit) {label "[_ acs-templating.HTMLArea_SelectUploadBtn]"} - } - } \ - -on_request { - set share site - } \ - -on_submit { - # check file name - if {$upload_file eq ""} { - template::form::set_error upload_form upload_file \ - [_ acs-templating.HTMLArea_SpecifyUploadFilename] - break - } - - if {[info exists folder_size]} { - # check per folder quota - set maximum_folder_size [parameter::get -parameter "MaximumFolderSize"] - - if { $maximum_folder_size ne "" } { - if { $folder_size+[file size ${upload_file.tmpfile}] > $maximum_folder_size } { - template::form::set_error upload_form upload_file \ - [_ file-storage.out_of_space] - break - } - } - } - - set file_name [template::util::file::get_property filename $upload_file] - set upload_tmpfile [template::util::file::get_property tmp_filename $upload_file] - set mime_type [template::util::file::get_property mime_type $upload_file] - if {$mime_type eq ""} { - set mime_type [ns_guesstype $file_name] - } - if {$selector_type eq "image" \ - && ![string match "image/*" $mime_type]} { - template::form::set_error upload_form upload_file \ - [_ acs-templating.HTMLArea_SelectImageUploadNoImage] - break - } - if {[string match "image/*" $mime_type]} { - - image::new \ - -item_id $item_id \ - -name ${item_id}_$file_name \ - -parent_id $parent_id \ - -tmp_filename $upload_tmpfile \ - -creation_user $user_id \ - -creation_ip [ad_conn peeraddr] \ - -package_id [ad_conn package_id] - } else { - content::item::new \ - -item_id $item_id \ - -name ${item_id}_$file_name \ - -parent_id $parent_id \ - -tmp_filename $upload_tmpfile \ - -creation_user $user_id \ - -creation_ip [ad_conn peeraddr] \ - -package_id [ad_conn package_id] - } - file delete $upload_tmpfile - permission::grant \ - -object_id $item_id \ - -party_id $user_id \ - -privilege admin - - switch -- $share { - private { - permission::set_not_inherit -object_id $item_id - } - group { - # Find the closest application group - # either dotlrn or acs-subsite - - permission::grant \ - -party_id [acs_magic_object "registered_users"] \ - -object_id $item_id \ - -privilege "read" - } - public { - permission::grant \ - -party_id [acs_magic_object "the_public"] \ - -object_id $item_id \ - -privilege "read" - } - site - - default { - permission::grant \ - -party_id [acs_magic_object "registered_users"] \ - -object_id $item_id \ - -privilege "read" - } - - } - if {$share eq "private"} { - # need a private URL that allows viewers of this - # object to see the image - # this isn't totally secure, because of course - # you need to be able to see the image somehow - # but we only allow read on the image if you can - # see the parent object - set f_url "/image/$item_id/private/$file_name" - } else { - set f_url "/image/$item_id/$file_name" - } - } - -} else { - set write_p 0 -} - -set HTML_Preview "Preview" -set HTML_UploadTitle "" \ No newline at end of file Index: openacs-4/packages/xowiki/www/xinha/insert-ilink.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/xinha/insert-ilink.adp,v diff -u -N --- openacs-4/packages/xowiki/www/xinha/insert-ilink.adp 14 Dec 2005 16:13:01 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,210 +0,0 @@ - - - #acs-templating.HTMLArea_InsertModifyLink# - - - - - - - - - - - -
#acs-templating.HTMLArea_InsertModifyLink#
-
-
- - - - - - - - - - - - - - - -
URL:
Title (tooltip):
Target: - - - - - - #acs-templating.HTMLArea_OpenFileStorage# - - -
  - - -
- - - -
- - Index: openacs-4/packages/xowiki/www/xinha/insert-ilink.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/xinha/insert-ilink.tcl,v diff -u -N --- openacs-4/packages/xowiki/www/xinha/insert-ilink.tcl 17 Aug 2006 01:44:27 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,21 +0,0 @@ -ad_page_contract { - @author Guenter Ernst guenter.ernst@wu-wien.ac.at, - @author Gustaf Neumann neumann@wu-wien.ac.at - @creation-date 13.07.2004 - @cvs-id $Id: insert-ilink.tcl,v 1.4 2006/08/17 01:44:27 gustafn Exp $ -} { - {fs_package_id:integer,optional} - {folder_id:integer,optional} - {file_types *} -} - -set selector_type "file" -set file_selector_link [export_vars -base file-selector \ - {fs_package_id folder_id selector_type file_types}] -set fs_found 1 - -#set user_id [ad_verify_and_get_user_id] -#permission::require_permission -party_id $user_id -object_id $fs_package_id \ -# -privilege "admin" - -ad_return_template Index: openacs-4/packages/xowiki/www/xinha/insert-image.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/xinha/insert-image.adp,v diff -u -N --- openacs-4/packages/xowiki/www/xinha/insert-image.adp 5 Jan 2007 12:11:03 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,235 +0,0 @@ - - - #acs-templating.HTMLArea_InsertImageTitle# - - - - - - - - - - - -
#acs-templating.HTMLArea_InsertImageTitle#
- -
- -
- - - - - - - - - - - - - - -
#acs-templating.HTMLArea_ImageURL# - -
#acs-templating.HTMLArea_ImageAlternateText#
- - - - - #acs-templating.HTMLArea_OpenFileStorage# -
-
-

- - - - - - -
-
- Layout - - - - - - - - - - -
#acs-templating.HTMLArea_ImageAlignment# - -
#acs-templating.HTMLArea_ImageBorderSize#
-
-
-
- #acs-templating.HTMLArea_ImageSpacing# - - - - - - - - - - -
#acs-templating.HTMLArea_ImageSpacingHorizontal#
#acs-templating.HTMLArea_ImageSpacingVertical#
-
-
- - - - - - - -
- Image Preview:
- -
-
- -
-

- - - Index: openacs-4/packages/xowiki/www/xinha/insert-image.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/xinha/insert-image.tcl,v diff -u -N --- openacs-4/packages/xowiki/www/xinha/insert-image.tcl 17 Aug 2006 01:44:27 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,14 +0,0 @@ -ad_page_contract { - @author Guenter Ernst guenter.ernst@wu-wien.ac.at, - @author Gustaf Neumann neumann@wu-wien.ac.at - @creation-date 13.07.2004 - @cvs-id $Id: insert-image.tcl,v 1.4 2006/08/17 01:44:27 gustafn Exp $ -} { - {fs_package_id:integer,optional} - {folder_id:integer,optional} -} - -set selector_type "image" -set file_selector_link [export_vars -base file-selector \ - {fs_package_id folder_id selector_type}] -set fs_found 1 Index: openacs-4/packages/xowiki/www/xinha/insert-wlink.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/xinha/insert-wlink.adp,v diff -u -N --- openacs-4/packages/xowiki/www/xinha/insert-wlink.adp 13 Dec 2008 22:45:40 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,70 +0,0 @@ - - - #acs-templating.HTMLArea_InsertWikiLink# - - - - - - - - - -
#acs-templating.HTMLArea_InsertWikiLink#
-
-

#xowiki.select_link_target#

- previous - @t1;noquote@ - next -
- Label: -
- - - Index: openacs-4/packages/xowiki/www/xinha/insert-wlink.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/xinha/insert-wlink.tcl,v diff -u -N --- openacs-4/packages/xowiki/www/xinha/insert-wlink.tcl 13 Dec 2008 22:45:40 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,59 +0,0 @@ -ad_page_contract { - popup for choosing a target for wiki link -} { - {package_id:integer} - {page_number:integer 1} - {page_size:integer 20} -} - -::xowiki::Package initialize -package_id $package_id -set total_rows [::xowiki::Includelet listing -package_id $package_id -count true] - -set url [ad_conn url] -set back_link [expr { ($page_number > 1) ? \ - [export_vars -base $url [list package_id [list page_number [expr {$page_number-1}]]]] \ - : ""}] -set next_link [expr { $total_rows > ($page_number * $page_size) ? \ - [export_vars -base $url [list package_id [list page_number [expr {$page_number+1}]]]] \ - : ""}] - -set listing [::xowiki::Includelet listing \ - -package_id $package_id -page_number $page_number -page_size $page_size \ - -orderby "title asc"] - -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 show_heritage $admin_p \ - -columns { - if {[[my info parent] set show_heritage]} { - Field inherited -label "" - } - AnchorField name -label [_ xowiki.Page-name] -html {onclick "onOK(this)"} - Field title -label [::xowiki::Page::slot::title set pretty_name] - } - -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 [$package_id pretty_link -parent_id $parent_id $name] - t1 add \ - -title $title \ - -name $name \ - -name.href "#" - - if {$show_heritage} { - if {$entry_package_id == $package_id} { - set label "" - } else { - set label [$entry_package_id instance_name] - } - [t1 last_child] set inherited $label - } -} - -set t1 [t1 asHTML]