本文整理汇总了PHP中Get::b方法的典型用法代码示例。如果您正苦于以下问题:PHP Get::b方法的具体用法?PHP Get::b怎么用?PHP Get::b使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Get
的用法示例。
在下文中一共展示了Get::b方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handler_map
function handler_map($page)
{
if (Get::b('ajax')) {
self::assign_json_to_map($page);
return PL_JSON;
} else {
self::prepare_map($page);
}
}
示例2: handler_index
function handler_index($page, $action = null)
{
require_once 'emails.inc.php';
require_once 'googleapps.inc.php';
$page->changeTpl('googleapps/index.tpl');
$page->setTitle('Compte Google Apps');
$user = S::user();
$account = new GoogleAppsAccount($user);
// Fills up the 'is Google Apps redirection active' variable.
$redirect_active = false;
$redirect_unique = true;
$gapps_email = '';
if ($account->active()) {
$redirect = new Redirect($user);
foreach ($redirect->emails as $email) {
if ($email->type == 'googleapps') {
$gapps_email = $email->email;
$redirect_active = $email->active;
$redirect_unique = !$redirect->other_active($email->email);
}
}
}
$page->assign('redirect_active', $redirect_active);
$page->assign('redirect_unique', $redirect_unique);
// Updates the Google Apps account as required.
if ($action) {
if ($action == 'password' && Post::has('pwsync')) {
S::assert_xsrf_token();
if (Post::v('pwsync') == 'sync') {
$account->set_password_sync(true);
$account->set_password($user->password());
} else {
$account->set_password_sync(false);
}
} elseif ($action == 'password' && Post::has('pwhash') && Post::t('pwhash') && !$account->sync_password) {
S::assert_xsrf_token();
$account->set_password(Post::t('pwhash'));
}
if ($action == 'suspend' && Post::has('suspend') && $account->active()) {
S::assert_xsrf_token();
if ($account->pending_update_suspension) {
$page->trigWarning("Ton compte est déjà en cours de désactivation.");
} else {
if (!$redirect_active || $redirect->modify_one_email($gapps_email, false) == SUCCESS) {
$account->suspend();
$page->trigSuccess("Ton compte Google Apps est dorénavant désactivé.");
} else {
$page->trigError("Ton compte Google Apps est ta seule adresse de redirection. Ton compte ne peux pas être désactivé.");
}
}
} elseif ($action == 'unsuspend' && Post::has('unsuspend') && $account->suspended()) {
$account->unsuspend(Post::b('redirect_mails', true));
$page->trigSuccess("Ta demande de réactivation a bien été prise en compte.");
}
if ($action == 'create') {
$page->assign('has_password_sync', Get::has('password_sync'));
$page->assign('password_sync', Get::b('password_sync', true));
}
if ($action == 'create' && Post::has('password_sync') && Post::has('redirect_mails')) {
S::assert_xsrf_token();
$password_sync = Post::b('password_sync');
$redirect_mails = Post::b('redirect_mails');
if ($password_sync) {
$password = $user->password();
} else {
$password = Post::t('pwhash');
}
$account->create($password_sync, $password, $redirect_mails);
$page->trigSuccess("La demande de création de ton compte Google Apps a bien été enregistrée.");
}
}
$page->assign('account', $account);
}
示例3: apply
public function apply(PlPage $page)
{
Platal::load('geoloc');
if (Get::b('ajax')) {
$uids = $this->set->getIds(new PlLimit());
$pids = Profile::getPIDsFromUIDs($uids);
GeolocModule::assign_json_to_map($page, $pids);
$page->runJSON();
exit;
} else {
GeolocModule::prepare_map($page);
return 'geoloc/index.tpl';
}
}