rebuild read out email

This commit is contained in:
Torsten Schulz
2023-07-03 12:50:58 +02:00
parent 4e85f8c881
commit 7abdd5940d
3 changed files with 6 additions and 3 deletions

View File

@@ -55,7 +55,7 @@ class Emailinbox extends Renderer {
array_walk($headers, function(&$item, $key) { array_walk($headers, function(&$item, $key) {
$newItem = '<tr>'; $newItem = '<tr>';
$newItem .= '<td style="white-space:nowrap">' . ($item['date'] === false ? '' : $item['date']->format('d.m.Y H:i:s')) . '</td>'; $newItem .= '<td style="white-space:nowrap">' . ($item['date'] === false ? '' : $item['date']->format('d.m.Y H:i:s')) . '</td>';
$newItem .= '<td><a href="mail?uid=' . $key . '">' . ($item['unread'] === 'U' ? '<b>' : '') . $item['title'] . ($item['unread'] === 'u' ? '</b>' : '') . '</td>'; $newItem .= '<td><a href="mail?folder=' . $this->folder . '&uid=' . $key . '">' . ($item['unread'] === 'U' ? '<b>' : '') . $item['title'] . ($item['unread'] === 'u' ? '</b>' : '') . '</td>';
$newItem .= '<td>' . $item['from'] . '</td>'; $newItem .= '<td>' . $item['from'] . '</td>';
$newItem .= '</tr>'; $newItem .= '</tr>';
$item = $newItem; $item = $newItem;

View File

@@ -4,6 +4,7 @@ require 'mailhandling.php';
class Mail extends Mailhandling { class Mail extends Mailhandling {
// protected $mbox = null; // protected $mbox = null;
protected $folder = '';
protected $uid = 0; protected $uid = 0;
public function __construct(?string $templateName = null) { public function __construct(?string $templateName = null) {
@@ -12,7 +13,9 @@ class Mail extends Mailhandling {
$this->templateName = 'imaperror'; $this->templateName = 'imaperror';
return; return;
} }
$this->uid = $this->getUriParams()['uid']; $params = $this->getUriParams();
$this->uid = $params['uid'];
$this->folder = $params['folder'];
$this->content['uid'] = $this->uid; $this->content['uid'] = $this->uid;
} }

View File

@@ -5,7 +5,7 @@ class Mailhandling extends Renderer {
public function __construct() { public function __construct() {
parent::__construct(); parent::__construct();
if (!$this->connectToImap()) { if (!$this->connectToImap($this->folder)) {
$this->templateName = 'imaperror'; $this->templateName = 'imaperror';
return; return;
} }