]> git.mjollnir.org Git - moodle.git/commitdiff
Merged fixes from STABLE that allow creator to restore to any course
authormoodler <moodler>
Thu, 23 Sep 2004 11:34:47 +0000 (11:34 +0000)
committermoodler <moodler>
Thu, 23 Sep 2004 11:34:47 +0000 (11:34 +0000)
backup/restore_check.html
backup/restore_form.html

index bd5b5726c55c3a992ab5e802f359e982d202d3c6..05f04b4324afacb03b8d99688386a3e783cc0668 100644 (file)
     }
  
     //Depending the selected restoreto:
-    // If user is a teacher (and nor admin):
+    // If user is a teacher (and not creator):
     //    0-Current course, deleting: Put $restore->course_id and $restore->deleting (true), create the restore object
     //    1-Current course, adding: Put $restore->course_id and $restore->deleting (false), create the restore object
-    // If the uses is an admin:
+    // If the uses is a creator:
     //    0-Existing course, deleting: Select the destination course and launch the check again, then
     //        put $restore->course_id and $restore->deleting (true), create the restore object.
     //    1-Existing course, adding: Select the destination course and launch the check again, then
     //        put $restore->course_id and $restore->deleting (false), create the restore object.
     //    2-New course: Create the restore object and launch the execute.
 
-    //If the user is a teacher and not an admin
-    if (isteacher($id) and !isadmin()) {
+    //If the user is a teacher and not a creator
+    if (isteacheredit($id) and !iscreator()) {
         $restore->course_id = $id;
         if ($restore->restoreto == 0) {
             $restore->deleting = true;
         }
     }
 
-    //If the user is an admin
-    if (isadmin()) {
+    //If the user is a creator (or admin)
+    if (iscreator()) {
         //Set restore->deleting as needed
         if ($restore->restoreto == 0) {
             $restore->deleting = true;
     }
 
     //Now, select the course if needed
-    if (($restore->restoreto == 0 or $restore->restoreto == 1) and ($restore->course_id == 0) and (isadmin())) {
+    if (($restore->restoreto == 0 or $restore->restoreto == 1) and ($restore->course_id == 0) and (iscreator())) {
         if ($courses = get_courses("all","c.fullname")) {
             print_heading(get_string("choosecourse"));
             print_simple_box_start("center");
index 795b90d06e05b82d61702e89a35cb7db1c30aff6..14b4749e5d67503994de6dc2d176fac3b7b2d830 100644 (file)
@@ -123,11 +123,11 @@ function selectItemInMenuByName(formId, menuName, selectIndex ) {
     echo "<td align=\"right\"><p><b>";
     echo get_string("restoreto").":</b>";
     echo "</td><td>";
-    if (isteacheredit($id) and !isadmin()) {
+    if (isteacheredit($id) and !iscreator()) {
         $restore_restoreto_options[0] = get_string("currentcoursedeleting");
         $restore_restoreto_options[1] = get_string("currentcourseadding");
     } 
-    if (isadmin()) {
+    if (iscreator()) {
         $restore_restoreto_options[0] = get_string("existingcoursedeleting");
         $restore_restoreto_options[1] = get_string("existingcourseadding");
         $restore_restoreto_options[2] = get_string("newcourse");