本文整理匯總了PHP中FWUser::parseLoggedInOutBlocks方法的典型用法代碼示例。如果您正苦於以下問題:PHP FWUser::parseLoggedInOutBlocks方法的具體用法?PHP FWUser::parseLoggedInOutBlocks怎麽用?PHP FWUser::parseLoggedInOutBlocks使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FWUser
的用法示例。
在下文中一共展示了FWUser::parseLoggedInOutBlocks方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: postContentLoad
/**
* Do something after content is loaded from DB
*
* @param \Cx\Core\ContentManager\Model\Entity\Page $page The resolved page
*/
public function postContentLoad(\Cx\Core\ContentManager\Model\Entity\Page $page)
{
switch ($this->cx->getMode()) {
case \Cx\Core\Core\Controller\Cx::MODE_FRONTEND:
$objTemplate = $this->cx->getTemplate();
// ACCESS: parse access_logged_in[1-9] and access_logged_out[1-9] blocks
\FWUser::parseLoggedInOutBlocks($objTemplate);
// currently online users
$objAccessBlocks = false;
if ($objTemplate->blockExists('access_currently_online_member_list')) {
if (\FWUser::showCurrentlyOnlineUsers() && ($objTemplate->blockExists('access_currently_online_female_members') || $objTemplate->blockExists('access_currently_online_male_members') || $objTemplate->blockExists('access_currently_online_members'))) {
$objAccessBlocks = new AccessBlocks();
if ($objTemplate->blockExists('access_currently_online_female_members')) {
$objAccessBlocks->setCurrentlyOnlineUsers('female');
}
if ($objTemplate->blockExists('access_currently_online_male_members')) {
$objAccessBlocks->setCurrentlyOnlineUsers('male');
}
if ($objTemplate->blockExists('access_currently_online_members')) {
$objAccessBlocks->setCurrentlyOnlineUsers();
}
} else {
$objTemplate->hideBlock('access_currently_online_member_list');
}
}
// last active users
if ($objTemplate->blockExists('access_last_active_member_list')) {
if (\FWUser::showLastActivUsers() && ($objTemplate->blockExists('access_last_active_female_members') || $objTemplate->blockExists('access_last_active_male_members') || $objTemplate->blockExists('access_last_active_members'))) {
if (!$objAccessBlocks) {
$objAccessBlocks = new AccessBlocks();
}
if ($objTemplate->blockExists('access_last_active_female_members')) {
$objAccessBlocks->setLastActiveUsers('female');
}
if ($objTemplate->blockExists('access_last_active_male_members')) {
$objAccessBlocks->setLastActiveUsers('male');
}
if ($objTemplate->blockExists('access_last_active_members')) {
$objAccessBlocks->setLastActiveUsers();
}
} else {
$objTemplate->hideBlock('access_last_active_member_list');
}
}
// latest registered users
if ($objTemplate->blockExists('access_latest_registered_member_list')) {
if (\FWUser::showLatestRegisteredUsers() && ($objTemplate->blockExists('access_latest_registered_female_members') || $objTemplate->blockExists('access_latest_registered_male_members') || $objTemplate->blockExists('access_latest_registered_members'))) {
if (!$objAccessBlocks) {
$objAccessBlocks = new AccessBlocks();
}
if ($objTemplate->blockExists('access_latest_registered_female_members')) {
$objAccessBlocks->setLatestRegisteredUsers('female');
}
if ($objTemplate->blockExists('access_latest_registered_male_members')) {
$objAccessBlocks->setLatestRegisteredUsers('male');
}
if ($objTemplate->blockExists('access_latest_registered_members')) {
$objAccessBlocks->setLatestRegisteredUsers();
}
} else {
$objTemplate->hideBlock('access_latest_registered_member_list');
}
}
// birthday users
if ($objTemplate->blockExists('access_birthday_member_list')) {
if (\FWUser::showBirthdayUsers() && ($objTemplate->blockExists('access_birthday_female_members') || $objTemplate->blockExists('access_birthday_male_members') || $objTemplate->blockExists('access_birthday_members'))) {
if (!$objAccessBlocks) {
$objAccessBlocks = new AccessBlocks();
}
if ($objAccessBlocks->isSomeonesBirthdayToday()) {
if ($objTemplate->blockExists('access_birthday_female_members')) {
$objAccessBlocks->setBirthdayUsers('female');
}
if ($objTemplate->blockExists('access_birthday_male_members')) {
$objAccessBlocks->setBirthdayUsers('male');
}
if ($objTemplate->blockExists('access_birthday_members')) {
$objAccessBlocks->setBirthdayUsers();
}
$objTemplate->touchBlock('access_birthday_member_list');
} else {
$objTemplate->hideBlock('access_birthday_member_list');
}
} else {
$objTemplate->hideBlock('access_birthday_member_list');
}
}
break;
default:
break;
}
}