original_string: public function get_course_formatted_summary($course, $options = array()) {
          global $CFG;
          require_once($CFG->libdir. '/filelib.php');
          if (!$course->has_summary()) {
              return '';
          }
          $options = (array)$options;
          $context = context_course::instance($course->id);
          if (!isset($options['context'])) {
              // TODO see MDL-38521
              // option 1 (current), page context - no code required
              // option 2, system context
              // $options['context'] = context_system::instance();
              // option 3, course context:
              // $options['context'] = $context;
              // option 4, course category context:
              // $options['context'] = $context->get_parent_context();
          }
          $summary = file_rewrite_pluginfile_urls($course->summary, 'pluginfile.php', $context->id, 'course', 'summary', null);
          $summary = format_text($summary, $course->summaryformat, $options, $course->id);
          if (!empty($this->searchcriteria['search'])) {
              $summary = highlight($this->searchcriteria['search'], $summary);
          }
          return $summary;
      }
code: public function get_course_formatted_summary($course, $options = array()) {
          global $CFG;
          require_once($CFG->libdir. '/filelib.php');
          if (!$course->has_summary()) {
              return '';
          }
          $options = (array)$options;
          $context = context_course::instance($course->id);
          if (!isset($options['context'])) {
              // TODO see MDL-38521
              // option 1 (current), page context - no code required
              // option 2, system context
              // $options['context'] = context_system::instance();
              // option 3, course context:
              // $options['context'] = $context;
              // option 4, course category context:
              // $options['context'] = $context->get_parent_context();
          }
          $summary = file_rewrite_pluginfile_urls($course->summary, 'pluginfile.php', $context->id, 'course', 'summary', null);
          $summary = format_text($summary, $course->summaryformat, $options, $course->id);
          if (!empty($this->searchcriteria['search'])) {
              $summary = highlight($this->searchcriteria['search'], $summary);
          }
          return $summary;
      }
code_tokens: public function get_course_formatted_summary ( $ course , $ options = array ( ) ) { global $ CFG ; require_once ( $ CFG -> libdir . '/filelib.php' ) ; if ( ! $ course -> has_summary ( ) ) { return '' ; } $ options = ( array ) $ options ; $ context = context_course :: instance ( $ course -> id ) ; if ( ! isset ( $ options [ 'context' ] ) ) { // TODO see MDL-38521 // option 1 (current), page context - no code required // option 2, system context // $options['context'] = context_system::instance(); // option 3, course context: // $options['context'] = $context; // option 4, course category context: // $options['context'] = $context->get_parent_context(); } $ summary = file_rewrite_pluginfile_urls ( $ course -> summary , 'pluginfile.php' , $ context -> id , 'course' , 'summary' , null ) ; $ summary = format_text ( $ summary , $ course -> summaryformat , $ options , $ course -> id ) ; if ( ! empty ( $ this -> searchcriteria [ 'search' ] ) ) { $ summary = highlight ( $ this -> searchcriteria [ 'search' ] , $ summary ) ; } return $ summary ; }
docstring: Returns given course's summary with proper embedded files urls and formatted
  
  @param core_course_list_element $course
  @param array|stdClass $options additional formatting options
  @return string
docstring_tokens: Returns given course s summary with proper embedded files urls and formatted