]> git.mjollnir.org Git - moodle.git/commitdiff
block_admin: add special cases for enrol/authorize -- might need more work for multienrol
authormartinlanghoff <martinlanghoff>
Fri, 10 Mar 2006 02:20:56 +0000 (02:20 +0000)
committermartinlanghoff <martinlanghoff>
Fri, 10 Mar 2006 02:20:56 +0000 (02:20 +0000)
blocks/admin/block_admin.php

index f9dfeb90adf354b2e6d96f57130178035ff7a6d8..cc9e66b3350111420aec308b5db2ff7966b5b4d2 100644 (file)
@@ -68,6 +68,17 @@ class block_admin extends block_list {
                 $this->content->items[] = '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/'.$CFG->dbtype.'/frame.php">'.get_string('managedatabase').'</a>';
                 $this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/db.gif" height="16" width="16" alt="" />';
             }
+
+            if ($CFG->enrol == 'authorize') {
+                require_once $CFG->dirroot.'/enrol/authorize/const.php';
+                $paymenturl = '<a href="'.$CFG->wwwroot.'/enrol/authorize/index.php">'.get_string('payments').'</a>';
+                if ($cnt = count_records('enrol_authorize', 'status', AN_STATUS_AUTH)) {
+                    $paymenturl .= '<a href="'.$CFG->wwwroot.'/enrol/authorize/index.php?status='.AN_STATUS_AUTH.'">(<b>'.$cnt.'</b> '.get_string('pending').')</a>';
+                }
+                $this->content->items[] = $paymenturl;
+                $this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/payment.gif" height="16" width="16" alt="" />';
+            }
+
             $this->content->footer = '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/">'.get_string('admin').'...</a>';
         }
     }
@@ -83,8 +94,6 @@ class block_admin extends block_list {
 
         $course = get_record('course', 'id', $this->instance->pageid);
 
-
-
         if (isteacher($this->instance->pageid)) {
 
             $isteacheredit = isteacheredit($this->instance->pageid);
@@ -166,6 +175,16 @@ class block_admin extends block_list {
                 $this->content->icons[]='<img src="'.$CFG->pixpath.'/i/files.gif" height="16" width="16" alt="" />';
             }
 
+            if ($CFG->enrol == 'authorize') {
+                require_once $CFG->dirroot.'/enrol/authorize/const.php';
+                $paymenturl = '<a href="'.$CFG->wwwroot.'/enrol/authorize/index.php?course='.$course->id.'">'.get_string('payments').'</a>';
+                if ($cnt = count_records('enrol_authorize', 'status', AN_STATUS_AUTH, 'courseid', $course->id)) {
+                    $paymenturl .= '<a href="'.$CFG->wwwroot.'/enrol/authorize/index.php?status='.AN_STATUS_AUTH.'&amp;course='.$course->id.'">(<b>'.$cnt.'</b> '.get_string('pending').')</a>';
+                }
+                $this->content->items[] = $paymenturl;
+                $this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/payment.gif" height="16" width="16" alt="" />';
+            }
+
             $this->content->items[]='<a href="'.$CFG->wwwroot.'/doc/view.php?id='.$this->instance->pageid.'&amp;file=teacher.html">'.get_string('help').'</a>';
             $this->content->icons[]='<img src="'.$CFG->modpixpath.'/resource/icon.gif" height="16" width="16" alt="" />';