[moodle] / moodle / backup / restore_check.html Repository:

Diff of /moodle/backup/restore_check.html

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.48.2.2, Tue Mar 18 06:30:53 2008 WST revision 1.48.2.3, Mon Apr 14 07:53:38 2008 WST

By stronk7:

Restore to the frontpage should work now (interface). MDL-12760

# Line 173  Line 173 
173      }      }
174    
175      // pass in the course category param      // pass in the course category param
176      $cat_id = optional_param('restore_restorecatto', 0, PARAM_INT);      $restore->restore_restorecatto = optional_param('restore_restorecatto', 0, PARAM_INT);
     if ($cat_id) {  
         $restore->restore_restorecatto = $cat_id;  
     }  
177    
178      //We have the object with data, put it in the session      //We have the object with data, put it in the session
179      $SESSION->restore = $restore;      $SESSION->restore = $restore;
# Line 203  Line 200 
200      }      }
201    
202      //Depending the selected restoreto:      //Depending the selected restoreto:
203      // If user is a teacher (and not creator):      // If user is a teacher (and not creator) or we are restoring from within SITEID:
204      //    0-Current course, deleting: Put $restore->course_id and $restore->deleting (true), create the restore object      //    0-Current course, deleting: Put $restore->course_id and $restore->deleting (true), create the restore object
205      //    1-Current course, adding: Put $restore->course_id and $restore->deleting (false), create the restore object      //    1-Current course, adding: Put $restore->course_id and $restore->deleting (false), create the restore object
206      // If the uses is a creator:      // If the uses is a creator:
# Line 213  Line 210 
210      //        put $restore->course_id and $restore->deleting (false), create the restore object.      //        put $restore->course_id and $restore->deleting (false), create the restore object.
211      //    2-New course: Create the restore object and launch the execute.      //    2-New course: Create the restore object and launch the execute.
212    
213      //If the user is a teacher and not a creator      //If the user is a teacher and not a creator or we are restoring from within SITEID
   
   
     //if (!has_capability('moodle/course:create', get_context_instance(CONTEXT_SYSTEM, SITEID))) {  
214    
215      if (!user_can_create_courses()) {      if (!user_can_create_courses() || $id = SITEID) {
216          $restore->course_id = $id;          $restore->course_id = $id;
217          if ($restore->restoreto == 0) {          if ($restore->restoreto == 0) {
218              $restore->deleting = true;              $restore->deleting = true;
# Line 228  Line 222 
222      }      }
223    
224      //If the user is a creator (or admin)      //If the user is a creator (or admin)
     //if (has_capability('moodle/course:create', get_context_instance(CONTEXT_SYSTEM, SITEID))) {  
225      if (user_can_create_courses()) {      if (user_can_create_courses()) {
226          //Set restore->deleting as needed          //Set restore->deleting as needed
227          if ($restore->restoreto == 0) {          if ($restore->restoreto == 0) {

Legend:
Removed from v.1.48.2.2  
changed lines
  Added in v.1.48.2.3

Moodle CVS Admin
ViewVC Help
Powered by ViewVC 1.0.7