本文整理汇总了PHP中PFUser::isLoggedIn方法的典型用法代码示例。如果您正苦于以下问题:PHP PFUser::isLoggedIn方法的具体用法?PHP PFUser::isLoggedIn怎么用?PHP PFUser::isLoggedIn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PFUser
的用法示例。
在下文中一共展示了PFUser::isLoggedIn方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($id, $is_active, PFUser $user, array $projects)
{
parent::__construct($id, $is_active);
$this->projects = $projects;
$this->has_projects = count($projects) > 0;
$this->label = $GLOBALS['Language']->getText('include_menu', 'projects');
$this->filter_project = $GLOBALS['Language']->getText('include_menu', 'filter_project');
$this->menu_projects_text = $GLOBALS['Language']->getText('include_menu', 'projects');
$this->browse_projects_text = $GLOBALS['Language']->getText('include_menu', 'browse_projects');
$this->register_new_proj = $GLOBALS['Language']->getText('include_menu', 'register_new_proj');
$this->is_trove_cat_enabled = ForgeConfig::get('sys_use_trove');
$this->is_project_registration_enabled = ForgeConfig::get('sys_use_project_registration', true);
$this->display_only_trovemap = $this->is_trove_cat_enabled && !$this->is_project_registration_enabled && !$this->projects;
$this->display_dropdown = !$this->display_only_trovemap && $user->isLoggedIn();
}
示例2: container
private function container(array $params, ProjectManager $project_manager, PFUser $current_user)
{
$project_tabs = null;
$project_name = null;
$project_link = null;
$project_is_public = null;
$project_privacy = null;
$sidebar_collapsable = false;
if (!empty($params['group'])) {
$this->show_sidebar = true;
$project = ProjectManager::instance()->getProject($params['group']);
$project_tabs = $this->getProjectTabs($params, $project);
$project_name = $project->getPublicName();
$project_link = $this->getProjectLink($project);
$project_is_public = $project->isPublic();
$project_privacy = $this->getProjectPrivacy($project);
$sidebar_collapsable = !$current_user->isAnonymous() && $current_user->isLoggedIn() ? true : false;
}
$this->render('container', new FlamingParrot_ContainerPresenter($this->breadcrumbs, $this->force_breadcrumbs, $this->toolbar, $project_name, $project_link, $project_is_public, $project_privacy, $project_tabs, $this->_feedback, $this->_getFeedback(), $this->getForgeVersion(), $sidebar_collapsable));
$this->keyboardModal();
}
示例3: user_is_logged_in
public function user_is_logged_in()
{
return $this->user->isLoggedIn();
}
示例4: addMyItem
private function addMyItem(FlamingParrot_NavBarItemPresentersCollection $collection)
{
if ($this->user->isLoggedIn()) {
$collection->addItem(new FlamingParrot_NavBarItemLinkPresenter('my', $this->isNavBarItemActive(array('/my/', '/widgets/')), '/my/', $GLOBALS['Language']->getText('menu', 'my_personal_page')));
}
}
示例5: shouldBeDisplayed
/**
* Returns true if the toggler should be displayed
*
* @param PFUser $user The user
* @param string $id the id of the toggler
* @param bool $default if we don't know, return $default
*
* @return bool
*/
public static function shouldBeDisplayed(PFUser $user, $id, $default)
{
if ($user->isLoggedIn()) {
$should_be_displayed = $user->getPreference('toggle_' . $id);
//TODO: DRY 'toggle_'. $id
if ($should_be_displayed !== false) {
return $should_be_displayed;
}
}
return $default;
}