当前位置: 首页>>代码示例>>PHP>>正文


PHP Navigation::mainPageUrl方法代码示例

本文整理汇总了PHP中Navigation::mainPageUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Navigation::mainPageUrl方法的具体用法?PHP Navigation::mainPageUrl怎么用?PHP Navigation::mainPageUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Navigation的用法示例。


在下文中一共展示了Navigation::mainPageUrl方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PageAdminPanel

 /**
  * Constructor
  * 
  * init superclass, create navigation
  */
 function PageAdminPanel()
 {
     // MANDATORY SECURITY CHECK IN CONSTRUCTOR OF EACH PAGE
     $rightsManager = RightsManager::getSingleton();
     if (!$rightsManager->currentUserIsAllowedTo('administrate')) {
         ErrorHandler::getSingleton()->standardError('PERMISSION_DENIED', basename($_SERVER['SCRIPT_NAME']));
     }
     $this->Page('Admin Panel');
     $this->nav = new Navigation('admin-menu');
     $this->nav->addEntry('return', 'return', Navigation::mainPageUrl());
 }
开发者ID:netiul,项目名称:cgkutrechtwest-gadgets,代码行数:16,代码来源:PageAdminPanel.class.php

示例2: PageProjectSearchList

 /**
  * Constructor: ONLY TO BE CALLED by factory method of Page::newPage(...)! 
  *
  * init {@link $contactList}, and menu
  * @param string $search DUMMY
  * @param string $searchtype $_GET['type'] may be 'export' for CSV export of the result
  * @param boolean $expand whether to expand entries or not
  * @param integer $maxEntriesPerPage limit of entries (default = 0 which means unlimited) 
  */
 function PageProjectSearchList($search, $searchtype, $expand = false, $maxEntriesPerPage = 0)
 {
     $this->Page('Search List');
     $this->expand = $expand;
     $this->type = $searchtype;
     $this->nav = new Navigation('options-menu');
     //$this->nav->addEntry('expand','expand','../contact/searchlist.php?search=' . $search .
     //        '&type=' . $searchtype . '&expand=1');
     $this->nav->addEntry('return', 'return', Navigation::mainPageUrl());
     $this->contactList = new ContactList($this->createQuery());
     $this->contactList->setEntriesPerPage($maxEntriesPerPage);
 }
开发者ID:netiul,项目名称:cgkutrechtwest-gadgets,代码行数:21,代码来源:PageProjectSearchList.class.php

示例3: previousPageUrl

 /** Returns previous page from the page stack or the mainPageUrl() (does not pop the stack) */
 function previousPageUrl()
 {
     if (isset($_SESSION['pageUrlStack'])) {
         $c = count($_SESSION['pageUrlStack']) - 2;
         if ($c >= 0) {
             $t = $_SESSION['pageUrlStack'][$c];
             if ($t !== null) {
                 return $t;
             }
         }
     }
     return Navigation::mainPageUrl();
 }
开发者ID:netiul,项目名称:cgkutrechtwest-gadgets,代码行数:14,代码来源:Navigation.class.php

示例4: innerCreate

    /**
     * create the content of login page
     * @return string html-content
     * @global Options used to determine login message and whether to display register link
     * @global ErrorHandler used for error handling
     */
    function innerCreate()
    {
        global $options, $errorHandler, $CONFIG_TAB_SERVER_ROOT;
        //$cont ='<div class="login-form"><img src="'.$CONFIG_TAB_SERVER_ROOT.'images/banner.png" class="tab-title" alt="The Address Book" />';
        $cont = '<div class="login-form">';
        if ($options->getOption('msgLogin') != '') {
            $cont .= '<div class="login-message">' . $options->getOption('msgLogin') . '</div>';
        }
        $err = $errorHandler->getLastError('login');
        if ($err) {
            $cont .= '<div class="login-error">' . $err['cause'] . '</div>';
        }
        $redirect = !empty($this->redirect) ? '?redirect=' . $this->redirect : '';
        $cont .= '<form method="post" action="' . $CONFIG_TAB_SERVER_ROOT . 'user/authorize.php' . $redirect . '">';
        $cont .= <<<EOC
        <div><label for="user_email">E-Mail</label></div>
        <div><input type="text" name="user_email" id="user_email" size="40" /></div>
        <br/>
        <div><label for="user_password">Password</label></div>
        <div><input type="password" name="user_password" id="user_password" size="40" /></div>
        <br/>
        <div><button type="submit">login</button></div>
        </form>
        <br/>
EOC;
        if ($options->getOption('defaultloginaddress') != '') {
            $cont .= '<script>document.getElementById(\'user_email\').value = "' . $options->getOption('defaultloginaddress') . '";document.getElementById(\'user_password\').focus();</script>';
        }
        $redirect = !empty($this->redirect) ? '&redirect=' . $this->redirect : '';
        if ($options->getOption('lostpassword') != 0) {
            $cont .= '<div class="login-register"><a href="' . $CONFIG_TAB_SERVER_ROOT . 'user/register.php?mode=lostpasswd' . $redirect . '">lost password</a></div>';
        }
        if ($options->getOption('allowUserReg') != 'no') {
            $cont .= '<br/><div class="login-register"><a href="' . $CONFIG_TAB_SERVER_ROOT . 'user/register.php?mode=register">register</a></div>';
        }
        if ($options->getOption('requireLogin') != 1) {
            $cont .= '<br/><div class="login-guest"><a href="' . Navigation::mainPageUrl() . '">enter as a guest</a></div>';
        }
        $cont .= '</div>';
        return $cont;
    }
开发者ID:netiul,项目名称:cgkutrechtwest-gadgets,代码行数:47,代码来源:PageLoginScreen.class.php

示例5: PageProjectContactEdit

 /**
  * Constructor: ONLY TO BE CALLED like this: Page::newPage(classname,$id,$add) factory method!! 
  * 
  * @param $idOrContact integer|Contact the id of the contact, or the contact that is to be edited
  * @param $add boolean whether the contact is to be added or not (cannot be detected through {@link $id}, because a contact can be passed if an error occurs to preserve already inserted information)
  * @global Options admin options
  */
 function PageProjectContactEdit($idOrContact, $add = false)
 {
     global $options;
     $this->counters = array();
     $this->add = $add;
     if ($idOrContact === null) {
         $this->contact = Contact::newContact();
         $this->add = TRUE;
     } elseif (is_numeric($idOrContact)) {
         $this->contact = Contact::newContact($idOrContact);
     } else {
         $this->contact =& $idOrContact;
     }
     if ($add) {
         $this->Page('Add new entry');
     } else {
         $this->Page('Edit entry for <span>' . $this->contact->contact['firstname'] . ' ' . $this->contact->contact['lastname'] . '</span>');
     }
     $this->menu = new Navigation('edit-menu');
     $this->menu->addEntry('save', 'save', 'javascript:saveEntry();');
     if (isset($this->contact->contact['id'])) {
         $this->menu->addEntry('cancel', 'cancel', '?id=' . $this->contact->contact['id']);
     } else {
         $this->menu->addEntry('cancel', 'cancel', Navigation::mainPageUrl());
     }
     if (!$this->add) {
         $rightsManager = RightsManager::getSingleton();
         if ($rightsManager->mayDeleteContact($this->contact)) {
             $this->menu->addEntry('delete', 'delete', 'javascript:deleteEntry(' . $this->contact->contact['id'] . ');');
             if ($_SESSION['user']->isAtLeast('admin') && $options->getOption('deleteTrashMode')) {
                 $this->menu->addEntry('trash', 'trash', '?mode=trash&amp;id=' . $this->contact->contact['id']);
             }
         }
     }
     if ($_SESSION['user']->isAtLeast('admin')) {
         // no putting on changed list
         $this->menu->addEntry('adminsave', 'adminsave', 'javascript:adminsaveEntry();');
     }
 }
开发者ID:netiul,项目名称:cgkutrechtwest-gadgets,代码行数:46,代码来源:PageProjectContactEdit.class.php

示例6: PageRegister

                    $flag = 'created';
                }
                $page = new PageRegister('confirm', $flag, isset($_GET['redirect']) ? $_GET['redirect'] : '');
                echo $page->create();
                exit;
            } else {
                // User#136 has set an error message; redisplay login page
                $page = new PageLoginScreen(isset($_GET['redirect']) ? $_GET['redirect'] : '');
                echo $page->create();
                exit;
            }
        }
        // DONE WE ARE LOGGED IN - REDIRECT TO REQUESTED PAGE
        // we loose the session cookie here (not sent reliably), but it is unchanged from last time,
        // so the browser will restore it with the next request automatically (if the redirect is to THIS site)
        if (isset($_GET['redirect'])) {
            header('Location: ' . $_GET['redirect']);
        } else {
            header('Location: ' . Navigation::mainPageUrl());
        }
        exit;
    }
    // FAILED LOGIN ... clear session variables
    $f = 1 + $_SESSION['failedLoginAttempts'];
    session_unset();
    $_SESSION = array();
    $_SESSION['failedLoginAttempts'] = $f;
}
// FAILED LOGIN redisplay login page
$page = new PageLoginScreen(isset($_GET['redirect']) ? $_GET['redirect'] : '');
echo $page->create();
开发者ID:netiul,项目名称:cgkutrechtwest-gadgets,代码行数:31,代码来源:authorize.php

示例7: postEmail

 function postEmail($eUser)
 {
     global $errorHandler;
     if (isset($_POST['email'])) {
         $eUser->setEmail(StringHelper::cleanGPC($_POST['email']));
         if (($err = $errorHandler->getLastError('register')) || ($err = $errorHandler->getLastError('mail'))) {
             break;
         }
         if ($eUser->id == $_SESSION['user']->id) {
             $_SESSION['user'] = null;
             header('Location:' . Navigation::mainPageUrl());
         }
     }
 }
开发者ID:netiul,项目名称:cgkutrechtwest-gadgets,代码行数:14,代码来源:PageOptions.class.php

示例8: createConfirm

 /**
  * create page to show user, that his contact has been confirmed
  * also show link to contact page
  * @global ErrorHandler used to catch errors that occured
  * @return string html-content
  */
 function createConfirm()
 {
     global $errorHandler;
     $cont = '<div class="login-form">';
     $cont .= '<img class="tab-title" src="../images/banner.png" />';
     switch ($this->flag) {
         case 'found':
             $cont .= '<div>Your contact-entry has already been found in the address book.</div>';
             $cont .= '<div>Please check, if all data is correct by following this link:</div>';
             $cont .= '<br/><div><a href="../contact/contact.php?id=' . $_SESSION['user']->contact['id'] . '">open my address-card</a></div>';
             break;
         case 'created':
             $cont .= '<div>A contact-entry has been created for you.</div>';
             $cont .= '<div>Please enter, all contact data: <a href="../contact/contact.php?id=' . $_SESSION['user']->contact['id'] . '&amp;mode=edit">open my address-card</a></div>';
             break;
         case 'error':
             ($err = $errorHandler->getLastError('register')) || ($err = $errorHandler->getLastError('login'));
             $cont .= '<div class="login-error">' . $err['cause'] . '</div>';
             break;
         case 'ok':
             $cont .= '<div>Your email has been successfully confirmed.</div>';
             $cont .= '<div>You can <a href="' . Navigation::mainPageUrl() . '">use</a> the application now.</div>';
             break;
         default:
             $cont .= '<div class="login-message">Email verified. Please log in to confirm your account.</div>';
             $cont .= '<form action="../user/register.php?mode=confirm" method="post">';
             $cont .= '<input class="register-input" type="hidden" name="userid" value="' . $_GET['userid'] . '" />';
             $cont .= '<input class="register-input" type="hidden" name="hash" value="' . $_GET['hash'] . '" />';
             $cont .= '<br/><div><label class="register-label" for="email">email</label>';
             $cont .= '<input class="register-input" type="text" name="email" id="email" size="40"/></div>';
             $cont .= '<br/><div><label class="register-label" for="password">password</label>';
             $cont .= '<input class="register-input" type="password" name="password" id="password" /></div>';
             $cont .= '<br/><div><input class="register-input" type="submit" value="confirm" /></div>';
             $cont .= '</form>';
             break;
     }
     $cont .= '</div>';
     return $cont;
 }
开发者ID:netiul,项目名称:cgkutrechtwest-gadgets,代码行数:45,代码来源:PageRegister.class.php

示例9: innerCreate

    /**
     * create error page according to error that occured
     * @return string html-content
     */
    function innerCreate()
    {
        global $CONFIG_TAB_ROOT;
        $cont = <<<EOC
        <div class="error-box">
EOC;
        switch ($this->error['type']) {
            case 'db':
                $cont .= '<div class="error-title">An error in the database occured:</div>';
                $cont .= '<div class="error-body">' . $this->errorHandler->errorString() . '</div>';
                $cont .= '<div class="error-body">NOTE: Developers (SVN repository users) will see development DB upgrades that run the same upgrade file multiple times. This may result in an error (Duplicate column name or similar) as soon as MySQL attempts a change that is already in the DB from the previous upgrade. This error should be ignored. The database should be at the newest version.</div>';
                break;
            case 'noLogin':
                // DISABLED - REDIRECTS IMMEDIATELY TO LOGIN PAGE IN ErrorHandler
            // DISABLED - REDIRECTS IMMEDIATELY TO LOGIN PAGE IN ErrorHandler
            case 'denied':
                // permission denied error
                $cont .= '<div class="error-title">An error with your login occured:</div>';
                $cont .= '<div class="error-body">' . $this->errorHandler->errorString() . '</div>';
                break;
            case 'adminLock':
                $cont .= '<div class="error-title">Administrative Lock Active</div>';
                $cont .= '<div class="error-body">This application is currently locked by an administrator because of database maintainance. You may not edit or delete any entries. Please retry later.</div>';
                break;
            case 'install':
                $cont .= '<div class="error-title">During installation the following error occurred:</div>';
                $cont .= '<div class="error-body">' . $this->errorHandler->errorString() . '</div>';
                break;
            case 'noFile':
                $cont .= '<div class="error-title">File not found:</div>';
                $cont .= '<div class="error-body">The file ' . $this->errorHandler->errorString() . ' could not be found.</div>';
                break;
            default:
                $cont .= '<div class="error-title">The following error occurred:</div>';
                $cont .= '<div class="error-body">' . $this->errorHandler->errorString() . '</div>';
                break;
        }
        $cont .= '<div class="error-footer">If necessary, please press the BACK button on your browser to return to the previous screen and correct any possible mistakes. You can also try the following actions that might solve your problem:<ul>';
        // not sure if we need this ...
        // $cont .= '<li><a style="font-size:larger;" href="'.$_SERVER['PHP_SELF'].'">go back</a></li>';
        $cont .= '<li><a style="font-size:larger;" href="' . Navigation::mainPageUrl() . '">default page</a></li>';
        $cont .= '<li><a href="' . $CONFIG_TAB_ROOT . 'user/login.php?redirect=' . Navigation::mainPageUrl() . '">login</a></li>';
        $cont .= '<li><a href="' . $CONFIG_TAB_ROOT . 'user/logout.php">logout</a></li>';
        $cont .= '<li id="em0"><a href="#" onclick="Effect.SlideUp(\'em0\'); Effect.SlideDown(\'em1\'); Effect.SlideDown(\'em2\'); Effect.SlideDown(\'em3\'); Effect.SlideDown(\'em4\'); return false;">advanced</a></li>';
        $cont .= '<li style="display:none" id="em1"><a href="' . $CONFIG_TAB_ROOT . 'lib/support/destroysession.php">destroy session (force logout)</a></li>';
        // Cannot be moved to admin section. Authozization does not work.
        $cont .= '<li style="display:none" id="em3"><a href="' . $CONFIG_TAB_ROOT . 'admin/upgrade.php">[upgrade database]</a></li>';
        $cont .= '<li style="display:none" id="em2"><a href="' . $CONFIG_TAB_ROOT . 'admin/install.php">[install database]</a></li>';
        // Avoid recursion from rightsManager if 'no user error' occurs!
        if (isset($_SESSION['user'])) {
            $rightsManager = RightsManager::getSingleton();
            if ($rightsManager->currentUserIsAllowedTo('administrate')) {
                $cont .= '<li style="display:none" id="em4"><a href="' . $CONFIG_TAB_ROOT . 'lib/support/phpinfo.php">[php info]</a></li>';
            }
        }
        $cont .= '</ul><br/>If you still need help, or you believe this to be a bug, copy the calling URL from the browser <b>NOW</b> and then please notify ';
        global $CONFIG_BUG_TRACK_LINK;
        $cont .= isset($CONFIG_BUG_TRACK_LINK) ? $CONFIG_BUG_TRACK_LINK : '<a href="http://sourceforge.net/tracker/?atid=861161&group_id=172286&func=browse" target="_blank">Bug Tracker</a>.';
        $cont .= '</div></div>';
        return $cont;
    }
开发者ID:netiul,项目名称:cgkutrechtwest-gadgets,代码行数:65,代码来源:PageError.class.php


注:本文中的Navigation::mainPageUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。