$toolName = $langMyDocs; } else { $menuTypeID = 2; $toolName = $langDoc; } load_js('tools.js'); $pageName = $langCreateDoc; $uploadPath = $editPath = false; if (isset($_GET['uploadPath'])) { $uploadPath = q($_GET['uploadPath']); } elseif (isset($_GET['editPath'])) { $editPath = q($_GET['editPath']); $uploadPath = my_dirname($editPath); } if (defined('EBOOK_DOCUMENTS')) { $navigation[] = array('url' => 'edit.php?course=' . $course_code . '&id=' . $ebook_id, 'name' => $langEBookEdit); } $backUrl = documentBackLink($uploadPath); if ($can_upload) { $navigation[] = array('url' => $backUrl, 'name' => $toolName); if ($editPath) { $pageName = $langEditDoc; $info = Database::get()->querySingle("SELECT * FROM document WHERE $group_sql AND path = ?s", $editPath); $htmlFileName = " <div class='form-group'>
$curDirPath = my_dirname($path); redirect_to_current_dir(); } } // teacher only // Common for teachers and students // Set current directory if (!isset($curDirPath)) { $curDirPath = isset($_GET['openDir'])? $_GET['openDir']: ''; if ($curDirPath == '/' or $curDirPath == '\\') { $curDirPath = ''; } } $curDirName = my_basename($curDirPath); $parentDir = my_dirname($curDirPath); if (strpos($curDirName, '/../') !== false or ! is_dir(realpath($basedir . $curDirPath))) { $tool_content .= $langInvalidDir; draw($tool_content, $menuTypeID); exit; } $order = 'ORDER BY sort_key COLLATE utf8_unicode_ci'; $sort = 'name'; $reverse = false; if (isset($_GET['sort'])) { if ($_GET['sort'] == 'type') { $order = 'ORDER BY format'; $sort = 'type'; } elseif ($_GET['sort'] == 'date') { $order = 'ORDER BY date_modified';