1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 21:02:41 +01:00

Open "Help" menu links in a new window

Summary: Fixes T11243. Seems reasonable to open this stuff in a new window so you don't put any application state in Herald, etc., at risk -- looking in this menu for help with a currently-executing workflow is reasonable and normal.

Test Plan: Clicked a help menu link, saw it open in a new page.

Reviewers: avivey, chad

Reviewed By: chad

Maniphest Tasks: T11243

Differential Revision: https://secure.phabricator.com/D16230
This commit is contained in:
epriestley 2016-07-04 10:38:37 -07:00
parent 2a1393c008
commit c7e7f113fd
2 changed files with 16 additions and 3 deletions

View file

@ -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;
}
}

View file

@ -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,