public static function can_approve_course_requests() {
        global $CFG, $DB;
        if (empty($CFG->enablecourserequests)) {
            return false;
        }
        $context = context_system::instance();
        if (!has_capability('moodle/site:approvecourse', $context)) {
            return false;
        }
        if (!$DB->record_exists('course_request', array())) {
            return false;
        }
        return true;
    }
public static function can_approve_course_requests() {
        global $CFG, $DB;
        if (empty($CFG->enablecourserequests)) {
            return false;
        }
        $context = context_system::instance();
        if (!has_capability('moodle/site:approvecourse', $context)) {
            return false;
        }
        if (!$DB->record_exists('course_request', array())) {
            return false;
        }
        return true;
    }
public static function can_approve_course_requests ( ) { global $ CFG , $ DB ; if ( empty ( $ CFG -> enablecourserequests ) ) { return false ; } $ context = context_system :: instance ( ) ; if ( ! has_capability ( 'moodle/site:approvecourse' , $ context ) ) { return false ; } if ( ! $ DB -> record_exists ( 'course_request' , array ( ) ) ) { return false ; } return true ; }
Returns true if the user can approve course requests.
@return bool
Returns true if the user can approve course requests .