1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <?php
- use ChamiloSession as Session;
- require_once __DIR__.'/../inc/global.inc.php';
- $_course = api_get_course_info();
- $htmlHeadXtra[] = "<script>
- function check_unzip() {
- if (document.upload.unzip.checked) {
- document.upload.if_exists[0].disabled=true;
- document.upload.if_exists[1].checked=true;
- document.upload.if_exists[2].disabled=true;
- } else {
- document.upload.if_exists[0].checked=true;
- document.upload.if_exists[0].disabled=false;
- document.upload.if_exists[2].disabled=false;
- }
- }
- </script>";
- $is_allowed_to_edit = api_is_allowed_to_edit(null, true);
- if (!$is_allowed_to_edit) {
- api_not_allowed(true);
- }
- $path = '/';
- if (isset($_REQUEST['curdirpath'])) {
- $path = $_REQUEST['curdirpath'];
- }
- $toolFromSession = Session::read('my_tool');
- if (isset($_REQUEST['tool'])) {
- $my_tool = $_REQUEST['tool'];
- Session::write('my_tool', $_REQUEST['tool']);
- } elseif (!empty($toolFromSession)) {
- $my_tool = $toolFromSession;
- } else {
- $my_tool = 'document';
- Session::write('my_tool', $my_tool);
- }
- Event::event_access_tool(TOOL_UPLOAD);
- switch ($my_tool) {
- case TOOL_LEARNPATH:
- require 'form.scorm.php';
- break;
-
- case TOOL_DROPBOX:
- case TOOL_STUDENTPUBLICATION:
- case TOOL_DOCUMENT:
- default:
- require 'form.document.php';
- break;
- }
|