/**
*/
protected function _initPages()
{
global $injector, $registry, $session;
$imp_imap = $injector->getInstance('IMP_Factory_Imap')->create();
$this->view->allowFolders = $imp_imap->access(IMP_Imap::ACCESS_FOLDERS);
$this->view->canInnocent = !empty($imp_imap->config->innocent_params);
$this->view->canSearch = $imp_imap->access(IMP_Imap::ACCESS_SEARCH);
$this->view->canSpam = !empty($imp_imap->config->spam_params);
if ($this->view->canCompose = IMP_Compose::canCompose()) {
/* Setting up identities. */
$identity = $injector->getInstance('IMP_Identity');
$this->view->identities = array();
foreach ($identity->getSelectList() as $id => $from) {
$this->view->identities[] = array('label' => $from, 'sel' => $id == $identity->getDefault(), 'val' => $id);
}
$this->view->user = $registry->getAuth();
$this->view->draft = $imp_imap->access(IMP_Imap::ACCESS_DRAFTS) && ($draft = IMP_Mailbox::getPref(IMP_Mailbox::MBOX_DRAFTS)) && !$draft->readonly;
if (IMP_Compose::canUploadAttachment()) {
$this->view->attach = true;
$this->view->max_size = $session->get('imp', 'file_upload');
}
}
}