Ejemplo n.º 1
0
    mkdir($restoreThis, 0755, true);
    archiveTables($course_id, $course_code, $restoreThis);
    recurse_copy($webDir . '/courses/' . $course_code,
        $restoreThis . '/html');

    register_posted_variables(array(
        'course_code' => true,
        'course_lang' => true,
        'course_title' => true,
        'course_desc' => true,
        'course_vis' => true,
        'course_prof' => true), 'all');

    create_restored_course($tool_content, $restoreThis, $course_code, $course_lang, $course_title, $course_desc, $course_vis, $course_prof);
    $course_code = $currentCourseCode; // revert course code to the correct value
} else {
    $desc = Database::get()->querySingle("SELECT description FROM course WHERE id = ?d", $course_id)->description;
    $old_deps = array();
    Database::get()->queryFunc("SELECT department FROM course_department WHERE course = ?d",
        function ($dep) use ($treeObj, &$old_deps) {
            $old_deps[] = array('name' => $treeObj->getFullPath($dep->department));
        }, $course_id);

    $tool_content = course_details_form($public_code, $currentCourseName, $titulaires, $currentCourseLanguage, null, $visible, $desc, $old_deps);
}

load_js('jstree3');
list($js, $html) = $treeObj->buildCourseNodePicker();
$head_content .= $js;
draw($tool_content, 2, null, $head_content);
Ejemplo n.º 2
0
            $data['public_code'] = $data['fake_code'];
        }
        $faculte = get_serialized_file('faculte');
        $course_units = get_serialized_file('course_units');
        $unit_resources = get_serialized_file('unit_resources');
        $description = '';
        if (($unit_data = search_table_dump($course_units, 'order', -1))) {
            if (($resource_data = search_table_dump($unit_resources, 'order', -1))) {
                $description = purify($resource_data['comments']);
            }
        }
        $tool_content = course_details_form($data['public_code'], $data['intitule'], $data['titulaires'], $data['languageCourse'], $data['type'], $data['visible'], $description, $faculte);
    } else {
        // Old-style backup
        $data = parse_backup_php($base . '/backup.php');
        $tool_content = course_details_form($data['code'], $data['title'], $data['prof_names'], $data['lang'], $data['type'], $data['visible'], $data['description'], $data['faculty']);
    }
} else {

// -------------------------------------
// Display restore info form
// -------------------------------------
    enableCheckFileSize();
    $tool_content .= "<div class='alert alert-info'><label>$langFirstMethod</label> $langRequest1</div>
        <div class='form-wrapper'>
            <form role='form' class='form-horizontal' action='" . $_SERVER['SCRIPT_NAME'] . "' method='post' enctype='multipart/form-data'>            
            <div class='form-group'>
                <div class='col-sm-4'>" .
                    fileSizeHidenInput() . "
                    <input type='file' name='archiveZipped' />
                </div>