original_string: protected function render_event_message(event_message $eventmessage) {
          global $CFG;
  
          if (file_exists($CFG->dirroot . '/mod/chat/gui_ajax/theme/'.$eventmessage->theme.'/config.php')) {
              include($CFG->dirroot . '/mod/chat/gui_ajax/theme/'.$eventmessage->theme.'/config.php');
          }
  
          $patterns = array();
          $patterns[] = '___senderprofile___';
          $patterns[] = '___sender___';
          $patterns[] = '___time___';
          $patterns[] = '___event___';
  
          $replacements = array();
          $replacements[] = $eventmessage->senderprofile;
          $replacements[] = $eventmessage->sendername;
          $replacements[] = $eventmessage->time;
          $replacements[] = $eventmessage->event;
  
          return str_replace($patterns, $replacements, $chattheme_cfg->event_message);
      }
code: protected function render_event_message(event_message $eventmessage) {
          global $CFG;
  
          if (file_exists($CFG->dirroot . '/mod/chat/gui_ajax/theme/'.$eventmessage->theme.'/config.php')) {
              include($CFG->dirroot . '/mod/chat/gui_ajax/theme/'.$eventmessage->theme.'/config.php');
          }
  
          $patterns = array();
          $patterns[] = '___senderprofile___';
          $patterns[] = '___sender___';
          $patterns[] = '___time___';
          $patterns[] = '___event___';
  
          $replacements = array();
          $replacements[] = $eventmessage->senderprofile;
          $replacements[] = $eventmessage->sendername;
          $replacements[] = $eventmessage->time;
          $replacements[] = $eventmessage->event;
  
          return str_replace($patterns, $replacements, $chattheme_cfg->event_message);
      }
code_tokens: protected function render_event_message ( event_message $ eventmessage ) { global $ CFG ; if ( file_exists ( $ CFG -> dirroot . '/mod/chat/gui_ajax/theme/' . $ eventmessage -> theme . '/config.php' ) ) { include ( $ CFG -> dirroot . '/mod/chat/gui_ajax/theme/' . $ eventmessage -> theme . '/config.php' ) ; } $ patterns = array ( ) ; $ patterns [ ] = '___senderprofile___' ; $ patterns [ ] = '___sender___' ; $ patterns [ ] = '___time___' ; $ patterns [ ] = '___event___' ; $ replacements = array ( ) ; $ replacements [ ] = $ eventmessage -> senderprofile ; $ replacements [ ] = $ eventmessage -> sendername ; $ replacements [ ] = $ eventmessage -> time ; $ replacements [ ] = $ eventmessage -> event ; return str_replace ( $ patterns , $ replacements , $ chattheme_cfg -> event_message ) ; }
docstring: Render and event_message instance
  
  @param event_message $eventmessage The event_message instance to render
  @return string HTML representing the event_message instance
docstring_tokens: Render and event_message instance