4854: Infusion uploader integrated into file manager
[acontent.git] / docs / file_manager / index.php
index 75dc8cf..29ece72 100644 (file)
@@ -13,6 +13,7 @@
 define('TR_INCLUDE_PATH', '../include/');
 require(TR_INCLUDE_PATH.'vitals.inc.php');
 require_once(TR_INCLUDE_PATH.'classes/FileUtility.class.php');
+$_custom_css = $_base_href.'include/jscripts/infusion/components/uploader/css/Uploader.css';
 
 if ((isset($_REQUEST['popup']) && $_REQUEST['popup']) && 
        (!isset($_REQUEST['framed']) || !$_REQUEST['framed'])) {
@@ -33,7 +34,7 @@ if (isset($_SESSION['flash']) && $_SESSION['flash'] == "yes") {
     if (!isset($_COOKIE["fluid_on"]))
         trans.utility.setcookie("fluid_on", "yes", time()+1200); 
 
-    $fluid_dir = 'jscripts/infusion/';
+    $fluid_dir = 'include/jscripts/infusion/';
     $framed = intval($_GET['framed']);
     $popup = intval($_GET['popup']);
     $current_path = TR_CONTENT_DIR.$_course_id.'/';
@@ -54,46 +55,6 @@ if (isset($_SESSION['flash']) && $_SESSION['flash'] == "yes") {
         }
 
     }
-
-    $_custom_head .= '
-        <link href="'.$fluid_dir.'components/uploader/css/Uploader.css" rel="stylesheet" type="text/css" />
-        <script src="'.$fluid_dir.'InfusionAll.js" type="text/javascript"></script>
-        <script language="JavaScript" type="text/javascript">
-
-            var myUpload; // mostly used for testing
-
-            jQuery(document).ready(function () {
-                   myUpload = fluid.progressiveEnhanceableUploader(".flc-uploader", ".fl-ProgEnhance-basic", {
-                       uploadManager: {
-                                   type: "fluid.swfUploadManager",
-               
-                                   options: {
-                                      // Set the uploadURL to the URL for posting files to your server.
-                                      uploadURL: "'.$_base_href.'include/lib/upload.php?path='.urlencode($current_path.$pathext).'",
-               
-                                      // This option points to the location of the SWFUpload Flash object that ships with Fluid Infusion.
-                                      flashURL: "jscripts/infusion/lib/swfupload/flash/swfupload.swf"
-                                       }
-                               },
-               
-                       listeners: {
-                       onFileSuccess: function (file, serverData){
-                               // example assumes that the server code passes the new image URL in the serverData
-                               window.location="'.$_SERVER['PHP_SELF'].'?pathext=' . urlencode($pathext) . SEP . 'popup=' . $popup . SEP . 'framed=' . $framed . SEP . 'msg=FILEUPLOAD_DONE'.SEP.'_course_id='.$_course_id.'";
-                       }
-                   },
-               
-                 decorators: [{
-                    type: "fluid.swfUploadSetupDecorator",
-                    options: {
-                         // This option points to the location of the Browse Files button used with Flash 10 clients.
-                         flashButtonImageURL: "'.TR_BASE_HREF.'jscripts/infusion/components/uploader/images/browse.png"
-                                       }
-                 }]
-                    });
-               });
-        </script>
-    ';
 }
 
 global $msg;