original_string: public function get_course_overviewfiles() {
          global $CFG;
          if (empty($CFG->courseoverviewfileslimit)) {
              return array();
          }
          require_once($CFG->libdir. '/filestorage/file_storage.php');
          require_once($CFG->dirroot. '/course/lib.php');
          $fs = get_file_storage();
          $context = context_course::instance($this->id);
          $files = $fs->get_area_files($context->id, 'course', 'overviewfiles', false, 'filename', false);
          if (count($files)) {
              $overviewfilesoptions = course_overviewfiles_options($this->id);
              $acceptedtypes = $overviewfilesoptions['accepted_types'];
              if ($acceptedtypes !== '*') {
                  // Filter only files with allowed extensions.
                  require_once($CFG->libdir. '/filelib.php');
                  foreach ($files as $key => $file) {
                      if (!file_extension_in_typegroup($file->get_filename(), $acceptedtypes)) {
                          unset($files[$key]);
                      }
                  }
              }
              if (count($files) > $CFG->courseoverviewfileslimit) {
                  // Return no more than $CFG->courseoverviewfileslimit files.
                  $files = array_slice($files, 0, $CFG->courseoverviewfileslimit, true);
              }
          }
          return $files;
      }
code: public function get_course_overviewfiles() {
          global $CFG;
          if (empty($CFG->courseoverviewfileslimit)) {
              return array();
          }
          require_once($CFG->libdir. '/filestorage/file_storage.php');
          require_once($CFG->dirroot. '/course/lib.php');
          $fs = get_file_storage();
          $context = context_course::instance($this->id);
          $files = $fs->get_area_files($context->id, 'course', 'overviewfiles', false, 'filename', false);
          if (count($files)) {
              $overviewfilesoptions = course_overviewfiles_options($this->id);
              $acceptedtypes = $overviewfilesoptions['accepted_types'];
              if ($acceptedtypes !== '*') {
                  // Filter only files with allowed extensions.
                  require_once($CFG->libdir. '/filelib.php');
                  foreach ($files as $key => $file) {
                      if (!file_extension_in_typegroup($file->get_filename(), $acceptedtypes)) {
                          unset($files[$key]);
                      }
                  }
              }
              if (count($files) > $CFG->courseoverviewfileslimit) {
                  // Return no more than $CFG->courseoverviewfileslimit files.
                  $files = array_slice($files, 0, $CFG->courseoverviewfileslimit, true);
              }
          }
          return $files;
      }
code_tokens: public function get_course_overviewfiles ( ) { global $ CFG ; if ( empty ( $ CFG -> courseoverviewfileslimit ) ) { return array ( ) ; } require_once ( $ CFG -> libdir . '/filestorage/file_storage.php' ) ; require_once ( $ CFG -> dirroot . '/course/lib.php' ) ; $ fs = get_file_storage ( ) ; $ context = context_course :: instance ( $ this -> id ) ; $ files = $ fs -> get_area_files ( $ context -> id , 'course' , 'overviewfiles' , false , 'filename' , false ) ; if ( count ( $ files ) ) { $ overviewfilesoptions = course_overviewfiles_options ( $ this -> id ) ; $ acceptedtypes = $ overviewfilesoptions [ 'accepted_types' ] ; if ( $ acceptedtypes !== '*' ) { // Filter only files with allowed extensions. require_once ( $ CFG -> libdir . '/filelib.php' ) ; foreach ( $ files as $ key => $ file ) { if ( ! file_extension_in_typegroup ( $ file -> get_filename ( ) , $ acceptedtypes ) ) { unset ( $ files [ $ key ] ) ; } } } if ( count ( $ files ) > $ CFG -> courseoverviewfileslimit ) { // Return no more than $CFG->courseoverviewfileslimit files. $ files = array_slice ( $ files , 0 , $ CFG -> courseoverviewfileslimit , true ) ; } } return $ files ; }
docstring: Returns all course overview files
  
  @return array array of stored_file objects
docstring_tokens: Returns all course overview files