original_string: public static function entry_content($course, $cm, $glossary, $entry, $aliases, $format) {
          global $OUTPUT, $DB;
          $entry = clone $entry;
          $context = context_module::instance($cm->id);
          $options = portfolio_format_text_options();
          $options->trusted = $entry->definitiontrust;
          $options->context = $context;
  
          $output = '<table class="glossarypost dictionary" cellspacing="0">' . "\n";
          $output .= '<tr valign="top">' . "\n";
          $output .= '<td class="entry">' . "\n";
  
          $output .= '<div class="concept">';
          $output .= format_text($OUTPUT->heading($entry->concept, 3), FORMAT_MOODLE, $options);
          $output .= '</div> ' . "\n";
  
          $entry->definition = format_text($entry->definition, $entry->definitionformat, $options);
          $output .= portfolio_rewrite_pluginfile_urls($entry->definition, $context->id, 'mod_glossary', 'entry', $entry->id, $format);
  
          if (isset($entry->footer)) {
              $output .= $entry->footer;
          }
  
          $output .= '</td></tr>' . "\n";
  
          if (!empty($aliases)) {
              $aliases = explode(',', $aliases->alias);
              $output .= '<tr valign="top"><td class="entrylowersection">';
              $key = (count($aliases) == 1) ? 'alias' : 'aliases';
              $output .= get_string($key, 'glossary') . ': ';
              foreach ($aliases as $alias) {
                  $output .= s($alias) . ',';
              }
              $output = substr($output, 0, -1);
              $output .= '</td></tr>' . "\n";
          }
  
          if ($entry->sourceglossaryid == $cm->instance) {
              if (!$maincm = get_coursemodule_from_instance('glossary', $entry->glossaryid)) {
                  return '';
              }
              $filecontext = context_module::instance($maincm->id);
  
          } else {
              $filecontext = $context;
          }
          $fs = get_file_storage();
          if ($files = $fs->get_area_files($filecontext->id, 'mod_glossary', 'attachment', $entry->id, "timemodified", false)) {
              $output .= '<table border="0" width="100%"><tr><td>' . "\n";
  
              foreach ($files as $file) {
                  $output .= $format->file_output($file);
              }
              $output .= '</td></tr></table>' . "\n";
          }
  
          $output .= '</table>' . "\n";
  
          return $output;
      }
code: public static function entry_content($course, $cm, $glossary, $entry, $aliases, $format) {
          global $OUTPUT, $DB;
          $entry = clone $entry;
          $context = context_module::instance($cm->id);
          $options = portfolio_format_text_options();
          $options->trusted = $entry->definitiontrust;
          $options->context = $context;
  
          $output = '<table class="glossarypost dictionary" cellspacing="0">' . "\n";
          $output .= '<tr valign="top">' . "\n";
          $output .= '<td class="entry">' . "\n";
  
          $output .= '<div class="concept">';
          $output .= format_text($OUTPUT->heading($entry->concept, 3), FORMAT_MOODLE, $options);
          $output .= '</div> ' . "\n";
  
          $entry->definition = format_text($entry->definition, $entry->definitionformat, $options);
          $output .= portfolio_rewrite_pluginfile_urls($entry->definition, $context->id, 'mod_glossary', 'entry', $entry->id, $format);
  
          if (isset($entry->footer)) {
              $output .= $entry->footer;
          }
  
          $output .= '</td></tr>' . "\n";
  
          if (!empty($aliases)) {
              $aliases = explode(',', $aliases->alias);
              $output .= '<tr valign="top"><td class="entrylowersection">';
              $key = (count($aliases) == 1) ? 'alias' : 'aliases';
              $output .= get_string($key, 'glossary') . ': ';
              foreach ($aliases as $alias) {
                  $output .= s($alias) . ',';
              }
              $output = substr($output, 0, -1);
              $output .= '</td></tr>' . "\n";
          }
  
          if ($entry->sourceglossaryid == $cm->instance) {
              if (!$maincm = get_coursemodule_from_instance('glossary', $entry->glossaryid)) {
                  return '';
              }
              $filecontext = context_module::instance($maincm->id);
  
          } else {
              $filecontext = $context;
          }
          $fs = get_file_storage();
          if ($files = $fs->get_area_files($filecontext->id, 'mod_glossary', 'attachment', $entry->id, "timemodified", false)) {
              $output .= '<table border="0" width="100%"><tr><td>' . "\n";
  
              foreach ($files as $file) {
                  $output .= $format->file_output($file);
              }
              $output .= '</td></tr></table>' . "\n";
          }
  
          $output .= '</table>' . "\n";
  
          return $output;
      }
code_tokens: public static function entry_content ( $ course , $ cm , $ glossary , $ entry , $ aliases , $ format ) { global $ OUTPUT , $ DB ; $ entry = clone $ entry ; $ context = context_module :: instance ( $ cm -> id ) ; $ options = portfolio_format_text_options ( ) ; $ options -> trusted = $ entry -> definitiontrust ; $ options -> context = $ context ; $ output = '<table class="glossarypost dictionary" cellspacing="0">' . "\n" ; $ output .= '<tr valign="top">' . "\n" ; $ output .= '<td class="entry">' . "\n" ; $ output .= '<div class="concept">' ; $ output .= format_text ( $ OUTPUT -> heading ( $ entry -> concept , 3 ) , FORMAT_MOODLE , $ options ) ; $ output .= '</div> ' . "\n" ; $ entry -> definition = format_text ( $ entry -> definition , $ entry -> definitionformat , $ options ) ; $ output .= portfolio_rewrite_pluginfile_urls ( $ entry -> definition , $ context -> id , 'mod_glossary' , 'entry' , $ entry -> id , $ format ) ; if ( isset ( $ entry -> footer ) ) { $ output .= $ entry -> footer ; } $ output .= '</td></tr>' . "\n" ; if ( ! empty ( $ aliases ) ) { $ aliases = explode ( ',' , $ aliases -> alias ) ; $ output .= '<tr valign="top"><td class="entrylowersection">' ; $ key = ( count ( $ aliases ) == 1 ) ? 'alias' : 'aliases' ; $ output .= get_string ( $ key , 'glossary' ) . ': ' ; foreach ( $ aliases as $ alias ) { $ output .= s ( $ alias ) . ',' ; } $ output = substr ( $ output , 0 , - 1 ) ; $ output .= '</td></tr>' . "\n" ; } if ( $ entry -> sourceglossaryid == $ cm -> instance ) { if ( ! $ maincm = get_coursemodule_from_instance ( 'glossary' , $ entry -> glossaryid ) ) { return '' ; } $ filecontext = context_module :: instance ( $ maincm -> id ) ; } else { $ filecontext = $ context ; } $ fs = get_file_storage ( ) ; if ( $ files = $ fs -> get_area_files ( $ filecontext -> id , 'mod_glossary' , 'attachment' , $ entry -> id , "timemodified" , false ) ) { $ output .= '<table border="0" width="100%"><tr><td>' . "\n" ; foreach ( $ files as $ file ) { $ output .= $ format -> file_output ( $ file ) ; } $ output .= '</td></tr></table>' . "\n" ; } $ output .= '</table>' . "\n" ; return $ output ; }
docstring: helper function to get the html content of an entry
  for both this class and the full glossary exporter
  this is a very simplified version of the dictionary format output,
  but with its 500 levels of indirection removed
  and file rewriting handled by the portfolio export format.
  
  @param stdclass $course
  @param stdclass $cm
  @param stdclass $glossary
  @param stdclass $entry
  
  @return string
docstring_tokens: helper function to get the html content of an entry for both this class and the full glossary exporter this is a very simplified version of the dictionary format output but with its 500 levels of indirection removed and file rewriting handled by the portfolio export format .