core MDL-19786 Cleaned up a couple of minor deprecated calls
authorSam Hemelryk <sam@moodle.com>
Wed, 22 Sep 2010 07:48:35 +0000 (07:48 +0000)
committerSam Hemelryk <sam@moodle.com>
Wed, 22 Sep 2010 07:48:35 +0000 (07:48 +0000)
admin/report/unsuproles/index.php
admin/uploadpicture.php
backup/lib.php
backup/restorelib.php

index 7dfc731..fc2a318 100644 (file)
@@ -92,7 +92,7 @@ foreach ($rs as $problem) {
 $rs->close();
 
 if (!$problems) {
-    notify(get_string('noprolbems', 'report_unsuproles'), 'notifysuccess');
+    echo $OUTPUT->notification(get_string('noprolbems', 'report_unsuproles'), 'notifysuccess');
 } else {
     $roles = get_all_roles();
     $data = array();
index f7ce658..e7f2ed0 100644 (file)
@@ -82,7 +82,9 @@ if ($formdata = $mform->get_data()) {
             echo $OUTPUT->notification(get_string('uploadpicture_cannotmovezip','admin'));
             @remove_dir($zipdir);
         } else {
-            if (!unzip_file($dstfile, $zipdir, false)) {
+            $fp = get_file_packer('application/zip');
+            $unzipresult = $fp->extract_to_pathname($dstfile, $zipdir);
+            if (!$unzipresult) {
                 echo $OUTPUT->notification(get_string('uploadpicture_cannotunzip','admin'));
                 @remove_dir($zipdir);
             } else {
index a256b66..f3fee77 100644 (file)
         $restore->rolesmapping = array();
         if (isset($info->roles) && is_array($info->roles)) {
             foreach ($info->roles as $id => $info) {
-                if ($newroleid = get_field('role', 'id', 'shortname', $info->shortname)) {
+                if ($newroleid = $DB->get_field('role', 'id', array('shortname' => $info->shortname))) {
                     $restore->rolesmapping[$id] = $newroleid;
                 }
             }
index cd4209f..fd5781e 100644 (file)
@@ -2000,8 +2000,8 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
             }
             else {
                 if (empty($noredirect)) {
-                    print_continue($CFG->wwwroot.'/backup/restore.php?backup_unique_code='.$backup_unique_code.'&launch=form&file='.$file.'&id='.$id.'&sesskey='.sesskey());
-                    print_footer();
+                    echo $OUTPUT->continue_button(new moodle_url('/backup/restore.php', array('backup_unique_code'=>$backup_unique_code, 'launch'=>'form', 'file'=>$file, 'id'=>$id, 'sesskey'=>sesskey())));
+                    echo $OUTPUT->footer();
                     die;
 
                 } else {