original_string: public static function template_viewed($id) {
          $params = self::validate_parameters(self::view_book_parameters(), array(
              'id' => $id
          ));
  
          $template = api::read_template($params['id']);
          self::validate_context($template->get_context());
  
          return api::template_viewed($params['id']);
      }
code: public static function template_viewed($id) {
          $params = self::validate_parameters(self::view_book_parameters(), array(
              'id' => $id
          ));
  
          $template = api::read_template($params['id']);
          self::validate_context($template->get_context());
  
          return api::template_viewed($params['id']);
      }
code_tokens: public static function template_viewed ( $ id ) { $ params = self :: validate_parameters ( self :: view_book_parameters ( ) , array ( 'id' => $ id ) ) ; $ template = api :: read_template ( $ params [ 'id' ] ) ; self :: validate_context ( $ template -> get_context ( ) ) ; return api :: template_viewed ( $ params [ 'id' ] ) ; }
docstring: Log the template viewed event.
  
  @param int $id the template id
  @return array of warnings and status result
  @throws moodle_exception
docstring_tokens: Log the template viewed event .