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