MDL-32768: Remove unused function count_files from mod_assign
authorDamyon Wiese <damyon.wiese@netspot.com.au>
Tue, 8 May 2012 03:02:25 +0000 (11:02 +0800)
committerDamyon Wiese <damyon.wiese@netspot.com.au>
Tue, 8 May 2012 03:02:25 +0000 (11:02 +0800)
This is implemented in the plugins and is not used in the base assign class.
This was also using a constant from the assignsubmission_file plugin which is
bad form.

mod/assign/locallib.php

index a193b56..b622426 100644 (file)
@@ -2366,25 +2366,6 @@ class assign {
         return false;
     }
 
-    /**
-     * count the number of files in the file area
-     *
-     * @param int $userid
-     * @param string $area
-     * @return int
-     */
-    private function count_files($userid = 0, $area = ASSIGN_FILEAREA_SUBMISSION_FILES) {
-        global $USER;
-
-        if (!$userid) {
-            $userid = $USER->id;
-        }
-
-        $fs = get_file_storage();
-        $files = $fs->get_area_files($this->context->id, 'mod_assign', $area, $userid, "id", false);
-
-        return count($files);
-    }
 
     /**
      * Determine if this users grade is locked or overridden