2 /****************************************************************/
4 /****************************************************************/
5 /* Copyright (c) 2002-2008 by Greg Gay & Joel Kronenberg */
6 /* Adaptive Technology Resource Centre / University of Toronto */
9 /* This program is free software. You can redistribute it and/or*/
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /****************************************************************/
15 define('AT_INCLUDE_PATH', '../../include/');
16 require(AT_INCLUDE_PATH.'vitals.inc.php');
17 require(AT_INCLUDE_PATH.'lib/filemanager.inc.php');
19 if ((isset($_REQUEST['popup']) && $_REQUEST['popup']) &&
20 (!isset($_REQUEST['framed']) || !$_REQUEST['framed'])) {
23 } else if (isset($_REQUEST['framed']) && $_REQUEST['framed'] && isset($_REQUEST['popup']) && $_REQUEST['popup']) {
31 // If Flash is detected, call the necessary css and js, and configure settings to use the Fluid Uploader
32 if (isset($_SESSION['flash']) && $_SESSION['flash'] == "yes") {
33 /* Provide the option of switching between Fluid Uploader and simple single file uploader
34 and save the user preference as a cookie */
35 if (!isset($_COOKIE["fluid_on"]))
36 setcookie("fluid_on", "yes", time()+1200);
38 $fluid_dir = 'jscripts/infusion/';
39 $framed = intval($_GET['framed']);
40 $popup = intval($_GET['popup']);
41 $current_path = AT_CONTENT_DIR.$_SESSION['course_id'].'/';
43 if ($_GET['pathext'] != '') {
44 $pathext = urldecode($_GET['pathext']);
45 } else if ($_POST['pathext'] != '') {
46 $pathext = $_POST['pathext'];
49 if($_GET['back'] == 1) {
50 $pathext = substr($pathext, 0, -1);
51 $slashpos = strrpos($pathext, '/');
55 $pathext = substr($pathext, 0, ($slashpos+1));
61 <link href="'.$fluid_dir.'framework/fss/css/infusion-theme.css" rel="stylesheet" type="text/css" />
62 <link href="'.$fluid_dir.'components/uploader/css/Uploader.css" rel="stylesheet" type="text/css" />
63 <script src="'.$fluid_dir.'InfusionAll.js" type="text/javascript"></script>
64 <script language="JavaScript" type="text/javascript">
66 var myUpload; // mostly used for testing
68 jQuery(document).ready(function () {
69 myUpload = fluid.progressiveEnhanceableUploader(".flc-uploader", ".fl-ProgEnhance-basic", {
71 type: "fluid.swfUploadManager",
74 // Set the uploadURL to the URL for posting files to your server.
75 uploadURL: "'.$_base_href.'include/lib/upload.php?path='.urlencode($current_path.$pathext).'",
77 // This option points to the location of the SWFUpload Flash object that ships with Fluid Infusion.
78 flashURL: "jscripts/infusion/lib/swfupload/flash/swfupload.swf"
83 onFileSuccess: function (file, serverData){
84 // example assumes that the server code passes the new image URL in the serverData
85 window.location="'.$_SERVER['PHP_SELF'].'?pathext=' . urlencode($pathext) . SEP . 'popup=' . $popup . SEP . 'framed=' . $framed . SEP . 'msg=FILEUPLOAD_DONE";
90 type: "fluid.swfUploadSetupDecorator",
92 // This option points to the location of the Browse Files button used with Flash 10 clients.
93 flashButtonImageURL: "'.AT_BASE_HREF.'jscripts/infusion/components/uploader/images/browse.png"
103 if (isset($_GET['msg']))
104 $msg -> addFeedback($_GET['msg']);
107 $_SESSION['done'] = 1;
109 require(AT_INCLUDE_PATH.'html/filemanager_display.inc.php');
114 <script type="text/javascript">
116 function Checkall(form){
117 for (var i = 0; i < form.elements.length; i++){
118 eval("form.elements[" + i + "].checked = form.checkall.checked");
121 function openWindow(page) {
122 newWindow = window.open(page, "progWin", "width=400,height=200,toolbar=no,location=no");
127 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>