GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/nginx/html/Student/JimMartinson/Lab12/drupal/core/modules/contact/src/ |
Upload File : |
<?php namespace Drupal\contact; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityViewBuilder; use Drupal\Core\Mail\MailFormatHelper; use Drupal\Core\Render\Element; /** * Render controller for contact messages. */ class MessageViewBuilder extends EntityViewBuilder { /** * {@inheritdoc} */ protected function getBuildDefaults(EntityInterface $entity, $view_mode) { $build = parent::getBuildDefaults($entity, $view_mode); // The message fields are individually rendered into email templates, so // the entity has no template itself. unset($build['#theme']); return $build; } /** * {@inheritdoc} */ public function view(EntityInterface $entity, $view_mode = 'full', $langcode = NULL) { $build = parent::view($entity, $view_mode, $langcode); if ($view_mode == 'mail') { // Convert field labels into headings. // @todo Improve \Drupal\Core\Mail\MailFormatHelper::htmlToText() to // convert DIVs correctly. foreach (Element::children($build) as $key) { if (isset($build[$key]['#label_display']) && $build[$key]['#label_display'] == 'above') { $build[$key] += ['#prefix' => '']; $build[$key]['#prefix'] = $build[$key]['#title'] . ":\n"; $build[$key]['#label_display'] = 'hidden'; } } $build['#post_render'][] = function ($html, array $elements) { return MailFormatHelper::htmlToText($html); }; } return $build; } }