本文整理汇总了PHP中IMP_Mailbox::prefFrom方法的典型用法代码示例。如果您正苦于以下问题:PHP IMP_Mailbox::prefFrom方法的具体用法?PHP IMP_Mailbox::prefFrom怎么用?PHP IMP_Mailbox::prefFrom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMP_Mailbox
的用法示例。
在下文中一共展示了IMP_Mailbox::prefFrom方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _init
/**
*/
protected function _init()
{
global $conf, $injector, $notification, $page_output, $prefs, $registry, $session;
$mailbox = $this->indices->mailbox;
$imp_imap = $mailbox->imp_imap;
/* We know we are going to be exclusively dealing with this mailbox,
* so select it on the IMAP server (saves some STATUS calls). Open R/W
* to clear the RECENT flag. */
$imp_imap->openMailbox($mailbox, Horde_Imap_Client::OPEN_READWRITE);
/* Make sure we have a valid index. */
$imp_mailbox = $mailbox->list_ob;
$imp_mailbox->setIndex($this->indices);
if (!$imp_mailbox->isValidIndex()) {
$this->_returnToMailbox(null, 'message_missing');
return;
}
$imp_flags = $injector->getInstance('IMP_Flags');
$imp_identity = $injector->getInstance('IMP_Identity');
$imp_message = $injector->getInstance('IMP_Message');
$imp_ui = $injector->getInstance('IMP_Message_Ui');
/* Run through action handlers. */
if ($this->vars->actionID) {
try {
$session->getToken($this->vars->token);
} catch (Horde_Exception $e) {
$notification->push($e);
$this->vars->actionID = null;
}
}
$readonly = $mailbox->readonly;
$peek = false;
switch ($this->vars->actionID) {
case 'blacklist':
case 'whitelist':
if ($this->vars->actionID == 'blacklist') {
$injector->getInstance('IMP_Filter')->blacklistMessage($this->indices);
} else {
$injector->getInstance('IMP_Filter')->whitelistMessage($this->indices);
}
break;
case 'delete_message':
$imp_message->delete($this->indices, array('mailboxob' => $imp_mailbox));
if ($prefs->getValue('mailbox_return')) {
$this->_returnToMailbox($imp_mailbox->getIndex());
return;
}
if ($imp_ui->moveAfterAction($mailbox)) {
$imp_mailbox->setIndex(1);
}
break;
case 'undelete_message':
$imp_message->undelete($this->indices);
break;
case 'move_message':
case 'copy_message':
if (isset($this->vars->targetMbox) && (!$readonly || $this->vars->actionID == 'copy_message')) {
if ($this->vars->newMbox) {
$targetMbox = IMP_Mailbox::prefFrom($this->vars->targetMbox);
$newMbox = true;
} else {
$targetMbox = IMP_Mailbox::formFrom($this->vars->targetMbox);
$newMbox = false;
}
$imp_message->copy($targetMbox, $this->vars->actionID == 'move_message' ? 'move' : 'copy', $this->indices, array('create' => $newMbox, 'mailboxob' => $imp_mailbox));
if ($prefs->getValue('mailbox_return')) {
$this->_returnToMailbox($imp_mailbox->getIndex());
return;
}
}
break;
case 'innocent_report':
case 'spam_report':
$res = $injector->getInstance('IMP_Factory_Spam')->create($this->vars->actionID == 'spam_report' ? IMP_Spam::SPAM : IMP_Spam::INNOCENT)->report($this->indices, array('mailbox' => $imp_mailbox));
switch ($res) {
case 1:
if ($imp_ui->moveAfterAction($mailbox)) {
$imp_mailbox->setIndex(1);
}
break;
}
if ($prefs->getValue('mailbox_return')) {
$this->_returnToMailbox($imp_mailbox->getIndex());
return;
}
break;
case 'flag_message':
if (!$readonly && isset($this->vars->flag) && count($this->indices)) {
$peek = true;
$flag = $imp_flags->parseFormId($this->vars->flag);
$imp_message->flag(array($flag['set'] ? 'add' : 'remove' => array($flag['flag'])), $this->indices);
if ($prefs->getValue('mailbox_return')) {
$this->_returnToMailbox($imp_mailbox->getIndex());
return;
}
}
break;
case 'add_address':
try {
//.........这里部分代码省略.........
示例2: getValue
/**
* Returns a property from one of the identities.
*
* @see getValue()
*/
public function getValue($key, $identity = null)
{
$val = parent::getValue($key, $identity);
switch ($key) {
case IMP_Mailbox::MBOX_SENT:
return is_string($val) && strlen($val) ? IMP_Mailbox::get(IMP_Mailbox::prefFrom($val)) : null;
default:
return $val;
}
}
示例3: copyMessages
/**
* AJAX action: Copy messages.
*
* See the list of variables needed for
* IMP_Ajax_Application#_checkUidvalidity(). Mailbox/indices form
* parameters needed. Additional variables used:
* - mboxto: (string) Mailbox to copy the message to (base64url
* encoded).
*
* @return boolean True on success, false on failure.
*/
public function copyMessages()
{
if (!isset($this->vars->mboxto) && !isset($this->vars->newmbox) || !count($this->_base->indices)) {
return false;
}
if (isset($this->vars->newmbox)) {
$mbox = IMP_Mailbox::prefFrom($this->vars->newmbox);
$newMbox = true;
} else {
$mbox = IMP_Mailbox::formFrom($this->vars->mboxto);
$newMbox = false;
}
$result = $this->_base->indices->copy($mbox, 'copy', array('create' => $newMbox));
if ($result) {
$this->_base->queue->poll($mbox);
return true;
}
$this->_base->checkUidvalidity();
return false;
}