Index: openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl,v diff -u -N -r1.86.6.2 -r1.86.6.3 --- openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 19 Jun 2004 17:41:22 -0000 1.86.6.2 +++ openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 14 Jul 2004 19:38:54 -0000 1.86.6.3 @@ -105,6 +105,7 @@ set portal_id [dotlrn_community::get_portal_id -community_id $community_id] set package_id [dotlrn::instantiate_and_mount $community_id [package_key]] set community_name [dotlrn_community::get_community_name $community_id] + set folder_id [fs::get_root_folder -package_id $package_id] fs::rename_folder -folder_id $folder_id -name "[_ dotlrn-fs.lt_community_names_Files]" @@ -210,6 +211,17 @@ # # portlet stuff # + + # Add the admin portlet + + set admin_portal_id [dotlrn_community::get_admin_portal_id \ + -community_id $community_id + ] + + fs_admin_portlet::add_self_to_page \ + -portal_id $admin_portal_id \ + -package_id $package_id + set args [ns_set create] ns_set put $args package_id $package_id Index: openacs-4/packages/file-storage/www/admin/upload-size-limit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/admin/upload-size-limit.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/admin/upload-size-limit.adp 14 Jul 2004 19:38:54 -0000 1.1.2.1 @@ -0,0 +1,11 @@ + +@title@ +@context@ + + + + + + + + Index: openacs-4/packages/file-storage/www/admin/upload-size-limit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/admin/upload-size-limit.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/admin/upload-size-limit.tcl 14 Jul 2004 19:38:54 -0000 1.1.2.1 @@ -0,0 +1,45 @@ +ad_page_contract { + + This page allows a file storage admin to change the + upload size. + + @author Tracy Adams (teadams@mit.edu) + @creation-date 2004-07-07 + @cvs-id $Id: upload-size-limit.tcl,v 1.1.2.1 2004/07/14 19:38:54 tracya Exp $ + +} { + {return_url ""} +} + +set max_size [ns_config "ns/server/[ns_info server]/module/nssock" maxinput] + +set title "Configure File Upload Limit" +set context [list "Configure File Upload Limit"] + +set upload_limit [parameter::get -parameter "MaximumFileSize"] + +ad_form -name upload_limit_size -export folder_id -form { + {new_size:integer(text) {label "Upload Limit (bytes) $max_size"} {value $upload_limit} {html { maxlength 8}}} + {return_url:text(hidden) {value $return_url}} + {submit:text(submit) {label "Change upload limit"}} +} -validate { + {new_size + { $new_size <= $max_size } + "Upload limit must be less than $max_size bytes"} + +} -on_submit { + parameter::set_value -parameter "MaximumFileSize" -value $new_size + if {![empty_string_p $return_url]} { + ns_returnredirect $return_url + } +} + + + + + + + + + + Index: openacs-4/packages/fs-portlet/sql/oracle/fs-admin-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/fs-portlet/sql/oracle/fs-admin-portlet-create.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/fs-portlet/sql/oracle/fs-admin-portlet-create.sql 14 Jul 2004 19:38:54 -0000 1.1.2.1 @@ -0,0 +1,163 @@ +-- +-- Copyright (C) 2001, 2002 MIT +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- Create File Storage Admin Portlet +-- +-- @author Tracy Adams (teadams@mit.edu) +-- @creation-date 2004-07-07 +-- @version $Id: fs-admin-portlet-create.sql,v 1.1.2.1 2004/07/14 19:38:54 tracya Exp $ + +declare + ds_id portal_datasources.datasource_id%TYPE; +begin + + ds_id := portal_datasource.new( + name => 'fs_admin_portlet', + description => 'Displays a File Storage Admin portlet' + ); + + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'shadeable_p', + value => 'f' + ); + + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'hideable_p', + value => 'f' + ); + + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'user_editable_p', + value => 'f' + ); + + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'shaded_p', + value => 'f' + ); + + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'link_hideable_p', + value => 't' + ); + + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 'f', + key => 'package_id', + value => '' + ); + +end; +/ +show errors + +declare + foo integer; +begin + + -- create the implementation + foo := acs_sc_impl.new ( + impl_contract_name => 'portal_datasource', + impl_name => 'fs_admin_portlet', + impl_pretty_name => 'File Storage Admin Portlet', + impl_owner_name => 'fs_admin_portlet' + ); + + -- add all the hooks + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'fs_admin_portlet', + 'GetMyName', + 'fs_admin_portlet::get_my_name', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'fs_admin_portlet', + 'GetPrettyName', + 'fs_admin_portlet::get_pretty_name', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'fs_admin_portlet', + 'Link', + 'fs_admin_portlet::link', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'fs_admin_portlet', + 'AddSelfToPage', + 'fs_admin_portlet::add_self_to_page', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'fs_admin_portlet', + 'Show', + 'fs_admin_portlet::show', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'fs_admin_portlet', + 'Edit', + 'fs_admin_portlet::edit', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'fs_admin_portlet', + 'RemoveSelfFromPage', + 'fs_admin_portlet::remove_self_from_page', + 'TCL' + ); + + -- Add the binding + acs_sc_binding.new( + contract_name => 'portal_datasource', + impl_name => 'fs_admin_portlet' + ); + +end; +/ +show errors + Index: openacs-4/packages/fs-portlet/sql/oracle/fs-admin-portlet-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/fs-portlet/sql/oracle/fs-admin-portlet-drop.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/fs-portlet/sql/oracle/fs-admin-portlet-drop.sql 14 Jul 2004 19:38:54 -0000 1.1.2.1 @@ -0,0 +1,113 @@ +-- +-- Copyright (C) 2001, 2002 MIT +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- + + +-- Drops fs admin portlet + +-- @author Tracy Adams (teadams@mit.edu) +-- @creation-date 2004-07-07 + +-- $Id: fs-admin-portlet-drop.sql,v 1.1.2.1 2004/07/14 19:38:54 tracya Exp $ + +-- This is free software distributed under the terms of the GNU Public +-- License version 2 or higher. Full text of the license is available +-- from the GNU Project: http://www.fsf.org/copyleft/gpl.html + +declare + ds_id portal_datasources.datasource_id%TYPE; +begin + + begin + select datasource_id into ds_id + from portal_datasources + where name = 'fs_admin_portlet'; + exception when no_data_found then + ds_id := null; + end; + + if ds_id is not null then + portal_datasource.del(ds_id); + end if; + +end; +/ +show errors; + +declare + foo integer; +begin + + -- drop the hooks + foo := acs_sc_impl.delete_alias ( + 'portal_datasource', + 'fs_admin_portlet', + 'GetMyName' + ); + + foo := acs_sc_impl.delete_alias ( + 'portal_datasource', + 'fs_admin_portlet', + 'GetPrettyName' + ); + + + foo := acs_sc_impl.delete_alias ( + 'portal_datasource', + 'fs_admin_portlet', + 'Link' + ); + + foo := acs_sc_impl.delete_alias ( + 'portal_datasource', + 'fs_admin_portlet', + 'AddSelfToPage' + ); + + foo := acs_sc_impl.delete_alias ( + 'portal_datasource', + 'fs_admin_portlet', + 'Show' + ); + + foo := acs_sc_impl.delete_alias ( + 'portal_datasource', + 'fs_admin_portlet', + 'Edit' + ); + + foo := acs_sc_impl.delete_alias ( + 'portal_datasource', + 'fs_admin_portlet', + 'RemoveSelfFromPage' + ); + + -- Drop the binding + acs_sc_binding.del ( + contract_name => 'portal_datasource', + impl_name => 'fs_admin_portlet' + ); + + -- drop the impl + foo := acs_sc_impl.del ( + 'portal_datasource', + 'fs_admin_portlet' + ); +end; +/ +show errors + Index: openacs-4/packages/fs-portlet/sql/oracle/fs-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/fs-portlet/sql/oracle/fs-portlet-create.sql,v diff -u -N -r1.19 -r1.19.6.1 --- openacs-4/packages/fs-portlet/sql/oracle/fs-portlet-create.sql 30 Sep 2003 13:11:40 -0000 1.19 +++ openacs-4/packages/fs-portlet/sql/oracle/fs-portlet-create.sql 14 Jul 2004 19:38:54 -0000 1.19.6.1 @@ -23,6 +23,7 @@ -- @@ fs-contents-portlet-create.sql +@@ fs-admin-portlet-create.sql declare ds_id portal_datasources.datasource_id%TYPE; Index: openacs-4/packages/fs-portlet/tcl/fs-admin-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/fs-portlet/tcl/fs-admin-portlet-procs.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/fs-portlet/tcl/fs-admin-portlet-procs.tcl 14 Jul 2004 19:38:54 -0000 1.1.2.1 @@ -0,0 +1,89 @@ +# +# Copyright (C) 2001, 2002 MIT +# +# This file is part of dotLRN. +# +# dotLRN is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# + +ad_library { + + Procedures to support the file-storage admin portlet + + @creation-date 2004-07-07 + @author Tracy Adams (teadams@mit.edu) + @version $Id: fs-admin-portlet-procs.tcl,v 1.1.2.1 2004/07/14 19:38:54 tracya Exp $ + +} + +namespace eval fs_admin_portlet { + + ad_proc -private get_my_name { + } { + return "fs_admin_portlet" + } + + ad_proc -public get_pretty_name { + } { + return "File Storage Administration" + } + + ad_proc -private my_package_key { + } { + return "fs-portlet" + } + + ad_proc -public link { + } { + return "" + } + + ad_proc -public add_self_to_page { + {-portal_id:required} + {-package_id:required} + } { + Adds a faq admin PE to the given admin portal. There should only + ever be one of these portals on an admin page with only one faq_package_id + + @param portal_id The page to add self to + @param package_id the id of the faq package + + @return element_id The new element's id + } { + ns_log Warning "adding fs admin portlet to page - [get_my_name]" + return [portal::add_element_parameters \ + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -key package_id \ + -value $package_id + ] + } + + ad_proc -public remove_self_from_page { + portal_id + } { + Removes fs admin PE from the given portal + } { + portal::remove_element -portal_id $portal_id -portlet_name [get_my_name] + } + + ad_proc -public show { + cf + } { + shows the portlet + } { + portal::show_proc_helper \ + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "fs-admin-portlet" + } + +} Index: openacs-4/packages/fs-portlet/www/fs-admin-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/fs-portlet/www/fs-admin-portlet.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/fs-portlet/www/fs-admin-portlet.adp 14 Jul 2004 19:38:56 -0000 1.1.2.1 @@ -0,0 +1,25 @@ +<% + + # + # Copyright (C) 2001, 2002 MIT + # + # This file is part of dotLRN. + # + # dotLRN is free software; you can redistribute it and/or modify it under the + # terms of the GNU General Public License as published by the Free Software + # Foundation; either version 2 of the License, or (at your option) any later + # version. + # + # dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY + # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + # details. + # + +%> + + + Index: openacs-4/packages/fs-portlet/www/fs-admin-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/fs-portlet/www/fs-admin-portlet.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/fs-portlet/www/fs-admin-portlet.tcl 14 Jul 2004 19:38:56 -0000 1.1.2.1 @@ -0,0 +1,39 @@ +# +# Copyright (C) 2001, 2002 MIT +# +# This file is part of dotLRN. +# +# dotLRN is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# + +ad_page_contract { + + The display logic for the bulk-mail portlet + + @author yon (yon@openforce.net) + @creation-date 2002-05-13 + @version $Id: fs-admin-portlet.tcl,v 1.1.2.1 2004/07/14 19:38:56 tracya Exp $ + +} -query { +} -properties { + user_id:onevalue + admin_p:onevalue + package_id:onevalue + scoped_p:onevalue +} + +array set config $cf + +set return_url [ns_conn url] + +set user_id [ad_conn user_id] + +ad_return_template