original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Returns true if the user can approve course requests.
  @return bool
docstring_tokens: Returns true if the user can approve course requests .