2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2010 */
6 /* Inclusive Design Institute */
8 /* This program is free software. You can redistribute it and/or */
9 /* modify it under the terms of the GNU General Public License */
10 /* as published by the Free Software Foundation. */
11 /************************************************************************/
13 define('TR_INCLUDE_PATH', '../include/');
14 require(TR_INCLUDE_PATH.'vitals.inc.php');
15 require_once(TR_INCLUDE_PATH.'classes/FileUtility.class.php');
17 if ((isset($_REQUEST['popup']) && $_REQUEST['popup']) &&
18 (!isset($_REQUEST['framed']) || !$_REQUEST['framed'])) {
21 } else if (isset($_REQUEST['framed']) && $_REQUEST['framed'] && isset($_REQUEST['popup']) && $_REQUEST['popup']) {
29 // If Flash is detected, call the necessary css and js, and configure settings to use the Fluid Uploader
30 if (isset($_SESSION['flash']) && $_SESSION['flash'] == "yes") {
31 /* Provide the option of switching between Fluid Uploader and simple single file uploader
32 and save the user preference as a cookie */
33 if (!isset($_COOKIE["fluid_on"]))
34 trans.utility.setcookie("fluid_on", "yes", time()+1200);
36 $fluid_dir = 'jscripts/infusion/';
37 $framed = intval($_GET['framed']);
38 $popup = intval($_GET['popup']);
39 $current_path = TR_CONTENT_DIR.$_course_id.'/';
41 if ($_GET['pathext'] != '') {
42 $pathext = urldecode($_GET['pathext']);
43 } else if ($_POST['pathext'] != '') {
44 $pathext = $_POST['pathext'];
47 if($_GET['back'] == 1) {
48 $pathext = substr($pathext, 0, -1);
49 $slashpos = strrpos($pathext, '/');
53 $pathext = substr($pathext, 0, ($slashpos+1));
59 <link href="'.$fluid_dir.'components/uploader/css/Uploader.css" rel="stylesheet" type="text/css" />
60 <script src="'.$fluid_dir.'InfusionAll.js" type="text/javascript"></script>
61 <script language="JavaScript" type="text/javascript">
63 var myUpload; // mostly used for testing
65 jQuery(document).ready(function () {
66 myUpload = fluid.progressiveEnhanceableUploader(".flc-uploader", ".fl-ProgEnhance-basic", {
68 type: "fluid.swfUploadManager",
71 // Set the uploadURL to the URL for posting files to your server.
72 uploadURL: "'.$_base_href.'include/lib/upload.php?path='.urlencode($current_path.$pathext).'",
74 // This option points to the location of the SWFUpload Flash object that ships with Fluid Infusion.
75 flashURL: "jscripts/infusion/lib/swfupload/flash/swfupload.swf"
80 onFileSuccess: function (file, serverData){
81 // example assumes that the server code passes the new image URL in the serverData
82 window.location="'.$_SERVER['PHP_SELF'].'?pathext=' . urlencode($pathext) . SEP . 'popup=' . $popup . SEP . 'framed=' . $framed . SEP . 'msg=FILEUPLOAD_DONE'.SEP.'_course_id='.$_course_id.'";
87 type: "fluid.swfUploadSetupDecorator",
89 // This option points to the location of the Browse Files button used with Flash 10 clients.
90 flashButtonImageURL: "'.TR_BASE_HREF.'jscripts/infusion/components/uploader/images/browse.png"
100 if (isset($_GET['msg'])) $msg->addFeedback($_GET['msg']);
103 $_SESSION['done'] = 1;
105 require(TR_INCLUDE_PATH.'../file_manager/filemanager_display.inc.php');
110 <script type="text/javascript">
112 function Checkall(form){
113 for (var i = 0; i < form.elements.length; i++){
114 eval("form.elements[" + i + "].checked = form.checkall.checked");
117 function openWindow(page) {
118 newWindow = window.open(page, "progWin", "width=400,height=200,toolbar=no,location=no");
123 <?php require(TR_INCLUDE_PATH.'footer.inc.php'); ?>