MDL-18229 grade report: coding style fixes
authorDan Poltawski <dan@moodle.com>
Thu, 16 Oct 2014 12:49:44 +0000 (13:49 +0100)
committerDan Poltawski <dan@moodle.com>
Thu, 16 Oct 2014 12:49:44 +0000 (13:49 +0100)
global definitions must be at the top of functions.

grade/report/singleview/classes/local/screen/user.php

index ba2f59b..cdd56d9 100644 (file)
@@ -211,14 +211,14 @@ class user extends tablelike implements selectable_items {
      * @return grade_category
      */
     private function category($item) {
+        global $DB;
+
         if (empty($item->categoryid)) {
 
             if ($item->itemtype == 'course') {
                 return $this->course->fullname;
             }
 
-            global $DB;
-
             $params = array('id' => $item->iteminstance);
             $elem = $DB->get_record('grade_categories', $params);
 
@@ -249,12 +249,12 @@ class user extends tablelike implements selectable_items {
      * @return string
      */
     public function pager() {
+        global $OUTPUT;
+
         if (!$this->supports_paging()) {
             return '';
         }
 
-        global $OUTPUT;
-
         return $OUTPUT->paging_bar(
             count($this->items), $this->page, $this->perpage,
             new moodle_url('/grade/report/singleview/index.php', array(