rebuild folder structure list
This commit is contained in:
@@ -16,11 +16,12 @@ class Emailinbox extends Renderer {
|
|||||||
protected function readEmailHeaders(): array {
|
protected function readEmailHeaders(): array {
|
||||||
$cleanedHeaders = [];
|
$cleanedHeaders = [];
|
||||||
try {
|
try {
|
||||||
$mailsIds = $this->mbox->searchMailbox('ALL');
|
$folders = $this->mbox->getListingFolders('ALL');
|
||||||
} catch(PhpImap\Exceptions\ConnectionException $ex) {
|
} catch(PhpImap\Exceptions\ConnectionException $ex) {
|
||||||
echo "IMAP connection failed: " . implode(",", $ex->getErrors('all'));
|
echo "IMAP connection failed: " . implode(",", $ex->getErrors('all'));
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
var_dump($folders);die;
|
||||||
if (!$mailsIds) {
|
if (!$mailsIds) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
@@ -72,8 +73,9 @@ class Emailinbox extends Renderer {
|
|||||||
$folders = $this->mbox->getMailboxes("*");
|
$folders = $this->mbox->getMailboxes("*");
|
||||||
$folderItems = [];
|
$folderItems = [];
|
||||||
foreach ($folders as $folder) {
|
foreach ($folders as $folder) {
|
||||||
|
$this->connectToImap();
|
||||||
$status = $this->mbox->statusMailbox($folder['fullpath']);
|
$status = $this->mbox->statusMailbox($folder['fullpath']);
|
||||||
// var_dump($status);
|
var_dump($status);
|
||||||
$item = '<li><a href="/emailinbox?folder=' . urlencode($folder['shortpath']) . '"' .
|
$item = '<li><a href="/emailinbox?folder=' . urlencode($folder['shortpath']) . '"' .
|
||||||
(utf8_encode($folder['shortpath']) === $this->folder ? ' class="active-folder"' : '') . '>' .
|
(utf8_encode($folder['shortpath']) === $this->folder ? ' class="active-folder"' : '') . '>' .
|
||||||
utf8_encode($folder['shortpath']) . '</a> (Neu: ' . $status->unseen . ')</li>';
|
utf8_encode($folder['shortpath']) . '</a> (Neu: ' . $status->unseen . ')</li>';
|
||||||
|
|||||||
Reference in New Issue
Block a user