IMP::getInitialPage PHP 메소드

getInitialPage() 공개 정적인 메소드

Returns the initial page for IMP.
public static getInitialPage ( ) : object
리턴 object Object with the following properties: - mbox (IMP_Mailbox) - url (Horde_Url)
    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:
            case Horde_Registry::VIEW_DYNAMIC:
                $result->url = IMP_Dynamic_Mailbox::url(array('mailbox' => is_null($mbox) ? 'INBOX' : $mbox));
                break;
            case Horde_Registry::VIEW_MINIMAL:
            case Horde_Registry::VIEW_SMARTMOBILE:
                $result->url = is_null($mbox) ? Horde::url('smartmobile.php', true) : $mbox->url('mailbox');
                break;
        }
        return $result;
    }

Usage Example

예제 #1
0
파일: index.php 프로젝트: DSNS-LAB/Dmail
<?php

/**
 * Base redirection page for IMP.
 *
 * Copyright 1999-2015 Horde LLC (http://www.horde.org/)
 *
 * See the enclosed file COPYING for license information (GPL). If you
 * did not receive this file, see http://www.horde.org/licenses/gpl.
 *
 * @author    Chuck Hagenbuch <*****@*****.**>
 * @category  Horde
 * @copyright 1999-2015 Horde LLC
 * @license   http://www.horde.org/licenses/gpl GPL
 * @package   IMP
 */
// Will redirect to login page if not authenticated.
require_once __DIR__ . '/lib/Application.php';
Horde_Registry::appInit('imp');
IMP::getInitialPage()->url->redirect();
All Usage Examples Of IMP::getInitialPage