1
0
mirror of https://github.com/nerzhul/ocsms.git synced 2025-06-09 08:56:10 +00:00

Improve mailbox management for navigation

This commit is contained in:
Loïc Blot (@U-Exp) 2014-09-16 20:54:47 +02:00
parent d456178c18
commit 0a7e6f09f8
3 changed files with 27 additions and 19 deletions

View File

@ -35,8 +35,20 @@ class SmsController extends Controller {
* @NoCSRFRequired * @NoCSRFRequired
*/ */
public function index () { public function index () {
$mboxes = array(
'PNLConversations' => array(
'label' => 'Conversations',
'phoneNumbers' => $this->smsMapper->getAllPeersPhoneNumbers($this->userId),
'url' => \OCP\Util::linkToAbsolute('ocsms', 'index.php', array('feed' => 'conversations'))
),
'PNLDrafts' => array(
'label' => 'Drafts',
'phoneNumbers' => array(),
'url' => \OCP\Util::linkToAbsolute('ocsms', 'index.php', array('feed' => 'drafts'))
)
)
$params = array('user' => $this->userId, $params = array('user' => $this->userId,
"PNLConversations" => $this->smsMapper->getAllPeersPhoneNumbers($this->userId) 'mailboxes' => $mboxes
); );
return new TemplateResponse($this->appName, 'main', $params); return new TemplateResponse($this->appName, 'main', $params);
} }

View File

@ -6,7 +6,10 @@
<div id="app"> <div id="app">
<div id="app-navigation"> <div id="app-navigation">
<?php print_unescaped($this->inc('part.navigation')); ?> <?php print_unescaped($this->inc('part.navigation')); ?>
<?php print_unescaped($this->inc('part.settings')); ?> <?php /*print_unescaped($this->inc('part.settings'));*/ ?>
</div>
<div id="app-mailbox-content">
</div> </div>
<div id="app-content"> <div id="app-content">

View File

@ -1,19 +1,12 @@
<ul> <ul>
<?php if (count($_["PNLConversations"]) > 0) { ?> <?php foreach ($_['mailboxes'] as $mboxName => $mailbox) { ?>
<li><a href="#">Conversations</a> <?php if (count($mailbox['phoneNumbers']) > 0) { ?>
<ul> <li><a href="<?php p($mailbox['url']); ?>"><?php p($mailbox['label']); ?></a>
<?php foreach ($_["PNLConversations"] as $number) { ?> <ul>
<li><?php p($number); ?></li> <?php foreach ($mailbox['phoneNumbers'] as $number) { ?>
<?php } ?> <li><?php p($number); ?></li>
</ul></li> <?php } ?>
<?php } ?> </ul></li>
<?php }
<?php if (count($_["PNLDrafts"]) > 0) { ?> } ?>
<li><a href="#">Drafts</a>
<ul>
<?php foreach ($_["PNLDrafts"] as $number) { ?>
<li><?php p($number); ?></li>
<?php } ?>
</ul></li>
<?php } ?>
</ul> </ul>