Mailbox update
This commit is contained in:
@@ -69,10 +69,11 @@ class Emailinbox extends Renderer {
|
|||||||
|
|
||||||
protected function generateFolders(): void {
|
protected function generateFolders(): void {
|
||||||
$this->connectToImap();
|
$this->connectToImap();
|
||||||
$folders = $this->mbox->getListingFolders("*");
|
$folders = $this->mbox->getMailboxes("*");
|
||||||
var_dump($folders);die;
|
|
||||||
$folderItems = [];
|
$folderItems = [];
|
||||||
foreach ($folders as $folder) {
|
foreach ($folders as $folder) {
|
||||||
|
$status = $this->mbox->statusMailbox($folder);
|
||||||
|
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></li>';
|
utf8_encode($folder['shortpath']) . '</a></li>';
|
||||||
@@ -81,4 +82,3 @@ class Emailinbox extends Renderer {
|
|||||||
$this->content['folders'] = implode('', $folderItems);
|
$this->content['folders'] = implode('', $folderItems);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -612,9 +612,9 @@ class Mailbox
|
|||||||
* This function returns an object containing status information.
|
* This function returns an object containing status information.
|
||||||
* The object has the following properties: messages, recent, unseen, uidnext, and uidvalidity.
|
* The object has the following properties: messages, recent, unseen, uidnext, and uidvalidity.
|
||||||
*/
|
*/
|
||||||
public function statusMailbox(): stdClass
|
public function statusMailbox(?string $mailbox = null): stdClass
|
||||||
{
|
{
|
||||||
return Imap::status($this->getImapStream(), $this->imapPath, SA_ALL);
|
return Imap::status($this->getImapStream(), $mailbox ?: $this->imapPath, SA_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user