MDL-18229 grade report: coding style fixes

global definitions must be at the top of functions.
This commit is contained in:
Dan Poltawski 2014-10-16 13:49:44 +01:00
parent d65eefdbf1
commit 992159f450

View file

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