fromName, FILTER_SANITIZE_SPECIAL_CHARS) ?> - fromAddress, FILTER_SANITIZE_SPECIAL_CHARS) ?> - date) ?> -
-- subject, FILTER_SANITIZE_SPECIAL_CHARS); ?> -
-The mailbox is empty. Checking for new emails automatically.
-diff --git a/src/controller.php b/src/controller.php index 377258b..aedbcd9 100644 --- a/src/controller.php +++ b/src/controller.php @@ -27,8 +27,8 @@ class DisplayEmailsController { } public static function render($emails, $config, $user) { - // variables that have to be defined here for frontend template: $emails, $config - require "frontend.template.php"; + // variables that have to be defined here for frontend template: $emails, $config, $user + require "templates/inbox.php"; } } diff --git a/src/frontend.template.php b/src/frontend.template.php deleted file mode 100644 index 6a2f970..0000000 --- a/src/frontend.template.php +++ /dev/null @@ -1,366 +0,0 @@ -set('HTML.Nofollow', true); -$purifier_config->set('HTML.ForbiddenElements', array("img")); -$purifier = new HTMLPurifier($purifier_config); - -\Moment\Moment::setLocale($config['locale']); - -$mailIds = array_map(function ($mail) { - return $mail->id; -}, $emails); -$mailIdsJoinedString = filter_var(join('|', $mailIds), FILTER_SANITIZE_SPECIAL_CHARS); - -// define bigger renderings here to keep the php sections within the html short. -function niceDate($date) { - $m = new \Moment\Moment($date, date_default_timezone_get()); - return $m->calendar(); -} - -function printMessageBody($email, $purifier) { - global $config; - - // To avoid showing empty mails, first purify the html and plaintext - // before checking if they are empty. - $safeHtml = $purifier->purify($email->textHtml); - - $safeText = htmlspecialchars($email->textPlain); - $safeText = nl2br($safeText); - $safeText = \AutoLinkExtension::auto_link_text($safeText); - - $hasHtml = strlen(trim($safeHtml)) > 0; - $hasText = strlen(trim($safeText)) > 0; - - if ($config['prefer_plaintext']) { - if ($hasText) { - echo $safeText; - } else { - echo $safeHtml; - } - } else { - if ($hasHtml) { - echo $safeHtml; - } else { - echo $safeText; - } - } -} - -?> - - - - -
- - - - - - -- Your disposable mailbox is ready. -
-- subject, FILTER_SANITIZE_SPECIAL_CHARS); ?> -
-The mailbox is empty. Checking for new emails automatically.
-The mailbox is empty. Checking for new emails automatically.
++ subject, FILTER_SANITIZE_SPECIAL_CHARS); ?> +
+