本文整理汇总了PHP中PhabricatorUser::loadProfileImageURI方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorUser::loadProfileImageURI方法的具体用法?PHP PhabricatorUser::loadProfileImageURI怎么用?PHP PhabricatorUser::loadProfileImageURI使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhabricatorUser
的用法示例。
在下文中一共展示了PhabricatorUser::loadProfileImageURI方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildUserInformationDictionary
protected function buildUserInformationDictionary(PhabricatorUser $user, PhabricatorUserStatus $current_status = null)
{
$roles = array();
if ($user->getIsDisabled()) {
$roles[] = 'disabled';
}
if ($user->getIsSystemAgent()) {
$roles[] = 'agent';
}
if ($user->getIsAdmin()) {
$roles[] = 'admin';
}
$primary = $user->loadPrimaryEmail();
if ($primary && $primary->getIsVerified()) {
$roles[] = 'verified';
} else {
$roles[] = 'unverified';
}
$return = array('phid' => $user->getPHID(), 'userName' => $user->getUserName(), 'realName' => $user->getRealName(), 'image' => $user->loadProfileImageURI(), 'uri' => PhabricatorEnv::getURI('/p/' . $user->getUsername() . '/'), 'roles' => $roles);
if ($current_status) {
$return['currentStatus'] = $current_status->getTextStatus();
$return['currentStatusUntil'] = $current_status->getDateTo();
}
return $return;
}
示例2: buildMainMenuItems
public function buildMainMenuItems(PhabricatorUser $user, PhabricatorController $controller = null)
{
$items = array();
if ($user->isLoggedIn() && $user->isUserActivated()) {
$image = $user->loadProfileImageURI();
$item = id(new PHUIListItemView())->setName($user->getUsername())->setHref('/p/' . $user->getUsername() . '/')->addClass('core-menu-item')->setAural(pht('Profile'))->setOrder(100);
$classes = array('phabricator-core-menu-icon', 'phabricator-core-menu-profile-image');
$item->appendChild(phutil_tag('span', array('class' => implode(' ', $classes), 'style' => 'background-image: url(' . $image . ')'), ''));
$items[] = $item;
}
return $items;
}
示例3: buildMainMenuItems
public function buildMainMenuItems(PhabricatorUser $user, PhabricatorController $controller = null)
{
$items = array();
if ($controller instanceof PhabricatorPeopleProfileController && $controller->getProfileUser() && $controller->getProfileUser()->getPHID() == $user->getPHID()) {
$class = 'main-menu-item-icon-profile-selected';
} else {
$class = 'main-menu-item-icon-profile-not-selected';
}
if ($user->isLoggedIn()) {
$image = $user->loadProfileImageURI();
$item = new PhabricatorMainMenuIconView();
$item->setName($user->getUsername());
$item->addClass('main-menu-item-icon-profile ' . $class);
$item->addStyle('background-image: url(' . $image . ')');
$item->setHref('/p/' . $user->getUsername() . '/');
$item->setSortOrder(0.0);
$items[] = $item;
}
return $items;
}