2 /****************************************************************/
4 /****************************************************************/
5 /* Copyright (c) 2002-2010 */
6 /* Inclusive Design Institute */
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_once(AT_INCLUDE_PATH.'../mods/_core/file_manager/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 ATutor.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 language="JavaScript" type="text/javascript">
64 var myUpload; // mostly used for testing
66 jQuery(document).ready(function () {
67 myUpload = fluid.progressiveEnhanceableUploader(".flc-uploader", ".fl-ProgEnhance-basic", {
69 type: "fluid.swfUploadManager",
72 // Set the uploadURL to the URL for posting files to your server.
73 uploadURL: "'.$_base_href.'include/lib/upload.php?path='.urlencode($current_path.$pathext).'",
75 // This option points to the location of the SWFUpload Flash object that ships with Fluid Infusion.
76 flashURL: "jscripts/infusion/lib/swfupload/flash/swfupload.swf"
81 onFileSuccess: function (file, serverData){
82 // example assumes that the server code passes the new image URL in the serverData
83 window.location="'.$_SERVER['PHP_SELF'].'?pathext=' . urlencode($pathext) . SEP . 'popup=' . $popup . SEP . 'framed=' . $framed . SEP . 'msg=FILEUPLOAD_DONE";
88 type: "fluid.swfUploadSetupDecorator",
90 // This option points to the location of the Browse Files button used with Flash 10 clients.
91 flashButtonImageURL: "'.AT_BASE_HREF.'jscripts/infusion/components/uploader/images/browse.png"
101 if (isset($_GET['msg']))
102 $msg -> addFeedback($_GET['msg']);
105 $_SESSION['done'] = 1;
107 require(AT_INCLUDE_PATH.'../mods/_core/file_manager/filemanager_display.inc.php');
112 <script type="text/javascript">
114 function Checkall(form){
115 for (var i = 0; i < form.elements.length; i++){
116 eval("form.elements[" + i + "].checked = form.checkall.checked");
119 function openWindow(page) {
120 newWindow = window.open(page, "progWin", "width=400,height=200,toolbar=no,location=no");
125 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>