/** * Returns a link to edit a given search query. * * @param string $id The search query id. * * @return Horde_Url The URL to the search page. */ public function editUrl($id) { $mbox = IMP_Mailbox::get($this->createSearchId($id)); return IMP_Dynamic_Mailbox::url()->setAnchor('search:' . json_encode(array('edit_query' => 1, 'mailbox' => $mbox->form_to))); }
/** * Returns the initial page for IMP. * * @return object Object with the following properties: * <pre> * - mbox (IMP_Mailbox) * - url (Horde_Url) * </pre> */ public static function getInitialPage() { global $injector, $prefs, $registry; $init_url = $prefs->getValue('initial_page'); if (!$init_url || !$injector->getInstance('IMP_Factory_Imap')->create()->access(IMP_Imap::ACCESS_FOLDERS)) { $init_url = 'INBOX'; } if ($init_url == IMP::INITIAL_FOLDERS) { $mbox = null; } else { $mbox = IMP_Mailbox::get($init_url); if (!$mbox->exists) { $mbox = IMP_Mailbox::get('INBOX'); } } $result = new stdClass(); $result->mbox = $mbox; switch ($registry->getView()) { case Horde_Registry::VIEW_BASIC: $result->url = is_null($mbox) ? IMP_Basic_Folders::url() : $mbox->url('mailbox'); break; case Horde_Registry::VIEW_DYNAMIC: $result->url = IMP_Dynamic_Mailbox::url(array('mailbox' => is_null($mbox) ? 'INBOX' : $mbox)); break; case Horde_Registry::VIEW_MINIMAL: $result->url = is_null($mbox) ? IMP_Minimal_Folders::url() : IMP_Minimal_Mailbox::url(array('mailbox' => $mbox)); break; case Horde_Registry::VIEW_SMARTMOBILE: $result->url = is_null($mbox) ? Horde::url('smartmobile.php', true) : $mbox->url('mailbox'); break; } return $result; }
/** * Returns a link to edit a given search query. * * @param string $id The search query id. * * @return Horde_Url The URL to the search page. */ public function editUrl($id) { global $registry; $mbox = IMP_Mailbox::get($this->createSearchId($id)); switch ($registry->getView()) { case $registry::VIEW_BASIC: return $mbox->url(IMP_Basic_Search::url())->add(array('edit_query' => 1)); case $registry::VIEW_DYNAMIC: return IMP_Dynamic_Mailbox::url()->setAnchor('search:' . json_encode(array('edit_query' => 1, 'mailbox' => $mbox->form_to))); } }