diff --git a/src/applications/base/PhabricatorApplication.php b/src/applications/base/PhabricatorApplication.php index e010d4491f..82b094c311 100644 --- a/src/applications/base/PhabricatorApplication.php +++ b/src/applications/base/PhabricatorApplication.php @@ -183,7 +183,8 @@ abstract class PhabricatorApplication $item = id(new PHUIListItemView()) ->setName($article['name']) ->setIcon('fa-book') - ->setHref($article['href']); + ->setHref($article['href']) + ->setOpenInNewWindow(true); $items[] = $item; } @@ -203,7 +204,8 @@ abstract class PhabricatorApplication $item = id(new PHUIListItemView()) ->setName($spec['name']) ->setIcon('fa-envelope-o') - ->setHref($href); + ->setHref($href) + ->setOpenInNewWindow(true); $items[] = $item; } } diff --git a/src/view/phui/PHUIListItemView.php b/src/view/phui/PHUIListItemView.php index 4af02e572e..3a4909a1ee 100644 --- a/src/view/phui/PHUIListItemView.php +++ b/src/view/phui/PHUIListItemView.php @@ -29,8 +29,18 @@ final class PHUIListItemView extends AphrontTagView { private $indented; private $hideInApplicationMenu; private $icons = array(); + private $openInNewWindow = false; - public function setHideInApplicationMenu($hide) { + public function setOpenInNewWindow($open_in_new_window) { + $this->openInNewWindow = $open_in_new_window; + return $this; + } + + public function getOpenInNewWindow() { + return $this->openInNewWindow; + } + + public function setHideInApplicationMenu($hide) { $this->hideInApplicationMenu = $hide; return $this; } @@ -294,6 +304,7 @@ final class PHUIListItemView extends AphrontTagView { 'class' => implode(' ', $classes), 'meta' => $meta, 'sigil' => $sigil, + 'target' => $this->getOpenInNewWindow() ? '_blank' : null, ), array( $aural,