Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/markup/PhabricatorMentionRemarkupRule.php
| Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | public function didMarkupText() { | ||||
| } | } | ||||
| foreach ($metadata as $username => $tokens) { | foreach ($metadata as $username => $tokens) { | ||||
| $exists = isset($actual_users[$username]); | $exists = isset($actual_users[$username]); | ||||
| $user_can_not_view = false; | $user_can_not_view = false; | ||||
| if ($exists) { | if ($exists) { | ||||
| $user = $actual_users[$username]; | $user = $actual_users[$username]; | ||||
| Javelin::initBehavior('phui-hovercards'); | |||||
| // Check if the user has view access to the object she was mentioned in | // Check if the user has view access to the object she was mentioned in | ||||
| if ($policy_object) { | if ($policy_object) { | ||||
| $user_can_not_view = !$policy_set->hasCapability( | $user_can_not_view = !$policy_set->hasCapability( | ||||
| $user, | $user, | ||||
| $policy_object, | $policy_object, | ||||
| PhabricatorPolicyCapability::CAN_VIEW); | PhabricatorPolicyCapability::CAN_VIEW); | ||||
| } | } | ||||
| Show All 32 Lines | foreach ($metadata as $username => $tokens) { | ||||
| } | } | ||||
| $tag = id(new PHUITagView()) | $tag = id(new PHUITagView()) | ||||
| ->setType(PHUITagView::TYPE_PERSON) | ->setType(PHUITagView::TYPE_PERSON) | ||||
| ->setPHID($user->getPHID()) | ->setPHID($user->getPHID()) | ||||
| ->setName('@'.$user->getUserName()) | ->setName('@'.$user->getUserName()) | ||||
| ->setHref($user_href); | ->setHref($user_href); | ||||
| if ($context_object) { | |||||
| $tag->setContextObject($context_object); | |||||
| } | |||||
| if ($user_can_not_view) { | if ($user_can_not_view) { | ||||
| $tag->addClass('phabricator-remarkup-mention-nopermission'); | $tag->setIcon('fa-eye-slash red'); | ||||
| $tag->setIsExiled(true); | |||||
| } | } | ||||
| if ($user->getIsDisabled()) { | if ($user->getIsDisabled()) { | ||||
| $tag->setDotColor(PHUITagView::COLOR_GREY); | $tag->setDotColor(PHUITagView::COLOR_GREY); | ||||
| } else if (!$user->isResponsive()) { | } else if (!$user->isResponsive()) { | ||||
| $tag->setDotColor(PHUITagView::COLOR_VIOLET); | $tag->setDotColor(PHUITagView::COLOR_VIOLET); | ||||
| } else { | } else { | ||||
| if ($user->getAwayUntil()) { | if ($user->getAwayUntil()) { | ||||
| Show All 34 Lines | |||||