本文整理匯總了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();
示例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