AC_4897, AC_4898, AC_4899: Multifile uploader fixes.
[acontent.git] / docs / file_manager / index.php
1 <?php
2 /************************************************************************/
3 /* AContent                                                             */
4 /************************************************************************/
5 /* Copyright (c) 2010                                                   */
6 /* Inclusive Design Institute                                           */
7 /*                                                                      */
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 /************************************************************************/
12
13 define('TR_INCLUDE_PATH', '../include/');
14 require(TR_INCLUDE_PATH.'vitals.inc.php');
15 require_once(TR_INCLUDE_PATH.'classes/FileUtility.class.php');
16 $_custom_css = $_base_href.'include/jscripts/infusion/components/uploader/css/Uploader.css';
17
18 if ((isset($_REQUEST['popup']) && $_REQUEST['popup']) && 
19         (!isset($_REQUEST['framed']) || !$_REQUEST['framed'])) {
20         $popup = TRUE;
21         $framed = FALSE;
22 } else if (isset($_REQUEST['framed']) && $_REQUEST['framed'] && isset($_REQUEST['popup']) && $_REQUEST['popup']) {
23         $popup = TRUE;
24         $framed = TRUE;
25 } else {
26         $popup = FALSE;
27         $framed = FALSE;
28 }
29
30 // If Flash is detected, call the necessary css and js, and configure settings to use the Fluid Uploader
31 if (isset($_SESSION['flash']) && $_SESSION['flash'] == "yes") {
32     /* Provide the option of switching between Fluid Uploader and simple single file uploader
33        and save the user preference as a cookie */
34     if (!isset($_COOKIE["fluid_on"]))
35         trans.utility.setcookie("fluid_on", "yes", time()+1200); 
36
37     $fluid_dir = 'include/jscripts/infusion/';
38     $framed = intval($_GET['framed']);
39     $popup = intval($_GET['popup']);
40     $current_path = TR_CONTENT_DIR.$_course_id.'/';
41
42     if ($_GET['pathext'] != '') {
43         $pathext = urldecode($_GET['pathext']);
44     } else if ($_POST['pathext'] != '') {
45         $pathext = $_POST['pathext'];
46     }
47
48     if($_GET['back'] == 1) {
49         $pathext  = substr($pathext, 0, -1);
50         $slashpos = strrpos($pathext, '/');
51         if($slashpos == 0) {
52             $pathext = '';
53         } else {
54             $pathext = substr($pathext, 0, ($slashpos+1));
55         }
56
57     }
58 }
59
60 global $msg;
61 if (isset($_GET['msg'])) $msg->addFeedback($_GET['msg']);
62
63 require('top.php');
64 $_SESSION['done'] = 1;
65
66 require(TR_INCLUDE_PATH.'../file_manager/filemanager_display.inc.php');
67
68 closedir($dir);
69
70 ?>
71 <script type="text/javascript">
72 //<!--
73 function Checkall(form){ 
74   for (var i = 0; i < form.elements.length; i++){    
75     eval("form.elements[" + i + "].checked = form.checkall.checked");  
76   } 
77 }
78 function openWindow(page) {
79         newWindow = window.open(page, "progWin", "width=400,height=200,toolbar=no,location=no");
80         newWindow.focus();
81 }
82 //-->
83 </script>
84 <?php require(TR_INCLUDE_PATH.'footer.inc.php'); ?>