本文整理匯總了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;
}