MDL-27156 repositories: switched some spots over to using get_user_max_upload_file_si...
authorAndrew Davis <andrew@moodle.com>
Fri, 8 Jun 2012 10:23:47 +0000 (17:23 +0700)
committerAndrew Davis <andrew@moodle.com>
Thu, 14 Jun 2012 02:19:25 +0000 (09:19 +0700)
grade/grading/form/rubric/lib.php
lib/moodlelib.php
mod/lesson/locallib.php

index 98aeaf9..71b38ec 100644 (file)
@@ -453,7 +453,7 @@ class gradingform_rubric_controller extends gradingform_controller {
         global $CFG;
         return array(
             'maxfiles' => -1,
-            'maxbytes' => get_max_upload_file_size($CFG->maxbytes),
+            'maxbytes' => get_user_max_upload_file_size($context, $CFG->maxbytes),
             'context'  => $context,
         );
     }
index 388c4e2..708c613 100644 (file)
@@ -5844,7 +5844,7 @@ function get_max_upload_file_size($sitebytes=0, $coursebytes=0, $modulebytes=0)
 /**
  * Returns the maximum size for uploading files for the current user
  *
- * This function calls @see:get_max_upload_file_size() then considers the user's capabilities
+ * This function takes in account @see:get_max_upload_file_size() the user's capabilities
  *
  * @param context $context The context in which to check user capabilities
  * @param int $sizebytes Set maximum size
index ea453a6..11d8e78 100644 (file)
@@ -2114,7 +2114,7 @@ abstract class lesson_page extends lesson_base {
             $context = $PAGE->context;
         }
         if ($maxbytes === null) {
-            $maxbytes =get_max_upload_file_size();
+            $maxbytes = get_user_max_upload_file_size($context);
         }
         $properties = file_postupdate_standard_editor($properties, 'contents', array('noclean'=>true, 'maxfiles'=>EDITOR_UNLIMITED_FILES, 'maxbytes'=>$maxbytes), $context, 'mod_lesson', 'page_contents', $properties->id);
         $DB->update_record("lesson_pages", $properties);