當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CAppUI::loadPrefs方法代碼示例

本文整理匯總了PHP中CAppUI::loadPrefs方法的典型用法代碼示例。如果您正苦於以下問題:PHP CAppUI::loadPrefs方法的具體用法?PHP CAppUI::loadPrefs怎麽用?PHP CAppUI::loadPrefs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CAppUI的用法示例。


在下文中一共展示了CAppUI::loadPrefs方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: register_shutdown_function

// Shutdown function
register_shutdown_function(array("CApp", "checkPeace"));
if (!@CSQLDataSource::get("std")) {
    CApp::goOffline("db-access");
}
CMbPerformance::mark("init");
require __DIR__ . "/includes/session.php";
CMbPerformance::mark("session");
// Start chrono (after session_start as it may be locked by another request)
CApp::$chrono = new Chronometer();
CApp::$chrono->main = true;
CApp::$chrono->start();
$do_login = false;
// Load default preferences if not logged in
if (!CAppUI::$instance->user_id) {
    CAppUI::loadPrefs();
    try {
        CApp::notify("UserAuthentication", true);
    } catch (CUserAuthenticationFailure $e) {
        CApp::rip();
    } catch (CUserAuthenticationSuccess $e) {
        CAppUI::$auth_info = $e;
        $do_login = true;
    }
}
// Update session lifetime
CSessionHandler::setUserDefinedLifetime();
/*
try {
  include __DIR__."/classes/CAuth.class.php";
  //CAuth::login();
開發者ID:OpenXtrem,項目名稱:mediboard-test,代碼行數:31,代碼來源:index.php

示例2: CAppUI

<?php

require_once 'base.php';
require_once W2P_BASE_DIR . '/includes/config.php';
require_once W2P_BASE_DIR . '/includes/main_functions.php';
require_once W2P_BASE_DIR . '/includes/db_adodb.php';
require_once W2P_BASE_DIR . '/classes/ui.class.php';
$AppUI = new CAppUI();
$token = w2PgetParam($_GET, 'token', '');
$format = w2PgetParam($_GET, 'format', 'ical');
$userId = CUser::getUserIdByToken($token);
$AppUI->loadPrefs($userId);
$AppUI->user_id = $userId;
$AppUI->setUserLocale();
@(include_once W2P_BASE_DIR . '/locales/' . $AppUI->user_locale . '/locales.php');
include_once W2P_BASE_DIR . '/locales/core.php';
switch ($format) {
    //TODO: We only output in vCal, are there others we need to consider?
    case 'vcal':
    default:
        $format = 'vcal';
        header('Content-Type: text/calendar');
        header('Content-disposition: attachment; filename="calendar.ics"');
        break;
}
if ($userId > 0) {
    $moduleList = $AppUI->getLoadableModuleList();
    $myTimezoneName = date('e');
    $calendarHeader = "BEGIN:VCALENDAR\nPRODID:-//web2project//EN\nVERSION:2.0\nCALSCALE:GREGORIAN\nMETHOD:PUBLISH\nX-WR-TIMEZONE:{$myTimezoneName}\n";
    $calendarFooter = "END:VCALENDAR";
    //TODO: get the users' timezone for display processes
開發者ID:joly,項目名稱:web2project,代碼行數:31,代碼來源:calendar.php


注:本文中的CAppUI::loadPrefs方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。