Changeset View
Changeset View
Standalone View
Standalone View
src/applications/policy/storage/PhabricatorPolicy.php
Show First 20 Lines • Show All 270 Lines • ▼ Show 20 Lines | switch ($this->getType()) { | ||||
return pht('Other: %s', $this->getName()); | return pht('Other: %s', $this->getName()); | ||||
case PhabricatorPolicyType::TYPE_USER: | case PhabricatorPolicyType::TYPE_USER: | ||||
return pht('Only User: %s', $this->getName()); | return pht('Only User: %s', $this->getName()); | ||||
default: | default: | ||||
return $this->getName(); | return $this->getName(); | ||||
} | } | ||||
} | } | ||||
public function renderDescription($icon = false) { | public function renderDescription() { | ||||
$img = null; | |||||
if ($icon) { | |||||
$img = id(new PHUIIconView()) | |||||
->setIcon($this->getIcon()); | |||||
} | |||||
if ($this->getHref()) { | if ($this->getHref()) { | ||||
$desc = javelin_tag( | $desc = javelin_tag( | ||||
'a', | 'a', | ||||
array( | array( | ||||
'href' => $this->getHref(), | 'href' => $this->getHref(), | ||||
'class' => 'policy-link', | 'class' => 'policy-link', | ||||
'sigil' => $this->getWorkflow() ? 'workflow' : null, | 'sigil' => $this->getWorkflow() ? 'workflow' : null, | ||||
), | ), | ||||
array( | $this->getName()); | ||||
$img, | |||||
$this->getName(), | |||||
)); | |||||
} else { | |||||
if ($img) { | |||||
$desc = array($img, $this->getName()); | |||||
} else { | } else { | ||||
$desc = $this->getName(); | $desc = $this->getName(); | ||||
} | } | ||||
} | |||||
switch ($this->getType()) { | switch ($this->getType()) { | ||||
case PhabricatorPolicyType::TYPE_PROJECT: | case PhabricatorPolicyType::TYPE_PROJECT: | ||||
return pht('%s (Project)', $desc); | return pht('%s (Project)', $desc); | ||||
case PhabricatorPolicyType::TYPE_CUSTOM: | case PhabricatorPolicyType::TYPE_CUSTOM: | ||||
return $desc; | return $desc; | ||||
case PhabricatorPolicyType::TYPE_MASKED: | case PhabricatorPolicyType::TYPE_MASKED: | ||||
return pht( | return pht( | ||||
▲ Show 20 Lines • Show All 205 Lines • Show Last 20 Lines |