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.'components/uploader/css/Uploader.css" rel="stylesheet" type="text/css" />
62 <script src="'.$fluid_dir.'InfusionAll.js" type="text/javascript"></script>
63 <script language="JavaScript" type="text/javascript">
65 var myUpload; // mostly used for testing
67 jQuery(document).ready(function () {
68 myUpload = fluid.progressiveEnhanceableUploader(".flc-uploader", ".fl-ProgEnhance-basic", {
70 type: "fluid.swfUploadManager",
73 // Set the uploadURL to the URL for posting files to your server.
74 uploadURL: "'.$_base_href.'include/lib/upload.php?path='.urlencode($current_path.$pathext).'",
76 // This option points to the location of the SWFUpload Flash object that ships with Fluid Infusion.
77 flashURL: "jscripts/infusion/lib/swfupload/flash/swfupload.swf"
82 onFileSuccess: function (file, serverData){
83 // example assumes that the server code passes the new image URL in the serverData
84 window.location="'.$_SERVER['PHP_SELF'].'?pathext=' . urlencode($pathext) . SEP . 'popup=' . $popup . SEP . 'framed=' . $framed . SEP . 'msg=FILEUPLOAD_DONE";
89 type: "fluid.swfUploadSetupDecorator",
91 // This option points to the location of the Browse Files button used with Flash 10 clients.
92 flashButtonImageURL: "'.AT_BASE_HREF.'jscripts/infusion/components/uploader/images/browse.png"
102 if (isset($_GET['msg']))
103 $msg -> addFeedback($_GET['msg']);
106 $_SESSION['done'] = 1;
108 require(AT_INCLUDE_PATH.'html/filemanager_display.inc.php');
113 <script type="text/javascript">
115 function Checkall(form){
116 for (var i = 0; i < form.elements.length; i++){
117 eval("form.elements[" + i + "].checked = form.checkall.checked");
120 function openWindow(page) {
121 newWindow = window.open(page, "progWin", "width=400,height=200,toolbar=no,location=no");
126 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>