コード例 #1
0
ファイル: show.php プロジェクト: nikosv/openeclass
if ($show_orphan_file and $file_path) {
    if (!preg_match('/\.html?$/i', $file_path)) {
        if (!$is_in_playmode)
            send_file_by_url_file_path($file_path);
        else {
            require_once 'include/lib/multimediahelper.class.php';

            $path_components = explode('/', str_replace('//', chr(1), $file_path));
            $file_info = public_path_to_disk_path($path_components, '');

            $mediaPath = file_url($file_info->path, $file_info->filename);
            $mediaURL = $urlServer . 'modules/ebook/document.php?course=' . $course_code . '&ebook_id=' . $ebook_id . '&download=' . $file_info->path;
            $token = token_generate($file_info->path, true);
            $mediaAccess = $mediaPath . '?token=' . $token;

            echo MultimediaHelper::mediaHtmlObjectRaw($mediaAccess, $mediaURL, $mediaPath);
            exit();
        }
    }
}

$pageName = $langEBook;
if ($unit !== false) {
    $exit_fullscreen_link = $urlAppend . "modules/units/index.php?course=$course_code&id=$unit";
    $unit_parameter = 'unit=' . $unit;
} else {
    $exit_fullscreen_link = $urlAppend . "modules/ebook/index.php?course_code=$course_code";
    $unit_parameter = '';
}
$q = Database::get()->queryArray("SELECT ebook_section.id AS sid,
                      ebook_section.public_id AS psid,