1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 00:32:42 +01:00

Fix empty titles on pages without application names

Summary: Fixes T3195. Currently, we show `[] Phabricator` on the homepage with unicode glyphs off.

Test Plan:
Viewed home page and application pages with glyphs on and off. Saw:

|              | Unicode | No Unicode     |
|              | ------- | ----------     |
| Home         | Empty   | Empty          |
| ----         |         |                |
| Differential | Gear    | Differential   |
| ----         |         |                |

Reviewers: btrahan, chad

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3195

Differential Revision: https://secure.phabricator.com/D5932
This commit is contained in:
epriestley 2013-05-15 08:38:56 -07:00
parent 571d191a90
commit a94eee694b

View file

@ -85,6 +85,7 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView {
public function getTitle() {
$use_glyph = true;
$request = $this->getRequest();
if ($request) {
$user = $request->getUser();
@ -94,9 +95,23 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView {
}
}
return ($use_glyph ?
$this->getGlyph() : '['.$this->getApplicationName().']').
' '.parent::getTitle();
$title = parent::getTitle();
$prefix = null;
if ($use_glyph) {
$prefix = $this->getGlyph();
} else {
$application_name = $this->getApplicationName();
if (strlen($application_name)) {
$prefix = '['.$application_name.']';
}
}
if (strlen($prefix)) {
$title = $prefix.' '.$title;
}
return $title;
}