mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
Undoing recent changes ... should be in a separate file
This commit is contained in:
parent
1e03c552e3
commit
5875b7d611
@ -14,31 +14,14 @@
|
||||
optional_variable($wdir, "");
|
||||
optional_variable($action, "");
|
||||
|
||||
if (! is_numeric($id)) {
|
||||
// editing language
|
||||
if (! isadmin()) {
|
||||
error ("You must be site administrator to edit translations");
|
||||
}
|
||||
|
||||
//$activelangs = get_list_of_languages();
|
||||
//if (! in_array($id, $activelangs)) {
|
||||
// error("Selected translation is inactive. $activelangs");
|
||||
//}
|
||||
if (! $course = get_record("course", "id", $id) ) {
|
||||
error("That's an invalid course id");
|
||||
}
|
||||
|
||||
// Create "fake" course
|
||||
$course = new object;
|
||||
$course->id = $id;
|
||||
|
||||
} else {
|
||||
if (! $course = get_record("course", "id", $id) ) {
|
||||
error("That's an invalid course id");
|
||||
}
|
||||
require_login($course->id);
|
||||
|
||||
require_login($course->id);
|
||||
|
||||
if (! isteacheredit($course->id) ) {
|
||||
error("You need to be a teacher with editing privileges");
|
||||
}
|
||||
if (! isteacheredit($course->id) ) {
|
||||
error("You need to be a teacher with editing privileges");
|
||||
}
|
||||
|
||||
function html_footer() {
|
||||
@ -57,8 +40,6 @@
|
||||
|
||||
if ($course->id == $site->id) {
|
||||
$strfiles = get_string("sitefiles");
|
||||
} else if (! is_numeric($course->id)){
|
||||
$strfiles = $course->id;
|
||||
} else {
|
||||
$strfiles = get_string("files");
|
||||
}
|
||||
@ -95,13 +76,8 @@
|
||||
echo "<tr>";
|
||||
echo "<td colspan=\"2\">";
|
||||
}
|
||||
|
||||
if (is_numeric($id)) {
|
||||
$fileroot = $CFG->dataroot ;
|
||||
} else {
|
||||
$fileroot = $CFG->dirroot."/lang";
|
||||
}
|
||||
if (! $basedir = mdl_mkdir($fileroot, "$course->id")) {
|
||||
|
||||
if (! $basedir = make_upload_directory("$course->id")) {
|
||||
error("The site administrator needs to fix the file permissions");
|
||||
}
|
||||
|
||||
@ -681,15 +657,9 @@ function displaydir ($wdir) {
|
||||
|
||||
$fullpath = $basedir.$wdir;
|
||||
|
||||
$dontshow = array ("." , "..");
|
||||
|
||||
if (! is_numeric($id)) { //editing language files
|
||||
array_push($dontshow, "CVS");
|
||||
}
|
||||
|
||||
$directory = opendir($fullpath); // Find all files
|
||||
while ($file = readdir($directory)) {
|
||||
if (in_array($file , $dontshow)) {
|
||||
if ($file == "." || $file == "..") {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user