Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/home/controller/PhabricatorHomeMenuItemController.php b/src/applications/home/controller/PhabricatorHomeMenuItemController.php
index f0e436ddd9..39e9faadee 100644
--- a/src/applications/home/controller/PhabricatorHomeMenuItemController.php
+++ b/src/applications/home/controller/PhabricatorHomeMenuItemController.php
@@ -1,38 +1,32 @@
<?php
final class PhabricatorHomeMenuItemController
extends PhabricatorHomeController {
public function shouldAllowPublic() {
return true;
}
public function isGlobalDragAndDropUploadEnabled() {
return true;
}
public function handleRequest(AphrontRequest $request) {
$viewer = $this->getViewer();
- if ($viewer->getPHID()) {
- $custom_phid = $viewer->getPHID();
- } else {
- $custom_phid = null;
- }
-
$application = 'PhabricatorHomeApplication';
$home_app = id(new PhabricatorApplicationQuery())
->setViewer($viewer)
->withClasses(array($application))
->withInstalled(true)
->executeOne();
$engine = id(new PhabricatorHomeProfileMenuEngine())
->setProfileObject($home_app)
- ->setCustomPHID($custom_phid)
+ ->setCustomPHID($viewer->getPHID())
->setController($this);
return $engine->buildResponse();
}
}
diff --git a/src/applications/home/menuitem/PhabricatorHomeLauncherProfileMenuItem.php b/src/applications/home/menuitem/PhabricatorHomeLauncherProfileMenuItem.php
index c4c93f06ff..a727fbced6 100644
--- a/src/applications/home/menuitem/PhabricatorHomeLauncherProfileMenuItem.php
+++ b/src/applications/home/menuitem/PhabricatorHomeLauncherProfileMenuItem.php
@@ -1,68 +1,66 @@
<?php
final class PhabricatorHomeLauncherProfileMenuItem
extends PhabricatorProfileMenuItem {
const MENUITEMKEY = 'home.launcher.menu';
public function getMenuItemTypeName() {
return pht('More Applications');
}
private function getDefaultName() {
return pht('More Applications');
}
public function canHideMenuItem(
PhabricatorProfileMenuItemConfiguration $config) {
return false;
}
public function canMakeDefault(
PhabricatorProfileMenuItemConfiguration $config) {
return false;
}
public function getDisplayName(
PhabricatorProfileMenuItemConfiguration $config) {
$name = $config->getMenuItemProperty('name');
if (strlen($name)) {
return $name;
}
return $this->getDefaultName();
}
public function buildEditEngineFields(
PhabricatorProfileMenuItemConfiguration $config) {
return array(
id(new PhabricatorTextEditField())
->setKey('name')
->setLabel(pht('Name'))
->setPlaceholder($this->getDefaultName())
->setValue($config->getMenuItemProperty('name')),
);
}
protected function newNavigationMenuItems(
PhabricatorProfileMenuItemConfiguration $config) {
$viewer = $this->getViewer();
- if ($viewer->isLoggedIn()) {
- $name = $this->getDisplayName($config);
- $icon = 'fa-globe';
- $href = '/applications/';
+ $name = $this->getDisplayName($config);
+ $icon = 'fa-globe';
+ $href = '/applications/';
- $item = $this->newItem()
- ->setHref($href)
- ->setName($name)
- ->setIcon($icon);
- }
+ $item = $this->newItem()
+ ->setHref($href)
+ ->setName($name)
+ ->setIcon($icon);
return array(
$item,
);
}
}
diff --git a/src/applications/home/menuitem/PhabricatorHomeProfileMenuItem.php b/src/applications/home/menuitem/PhabricatorHomeProfileMenuItem.php
index ab77fa9098..40dd2dd41e 100644
--- a/src/applications/home/menuitem/PhabricatorHomeProfileMenuItem.php
+++ b/src/applications/home/menuitem/PhabricatorHomeProfileMenuItem.php
@@ -1,75 +1,77 @@
<?php
final class PhabricatorHomeProfileMenuItem
extends PhabricatorProfileMenuItem {
const MENUITEMKEY = 'home.dashboard';
public function getMenuItemTypeName() {
return pht('Home');
}
private function getDefaultName() {
return pht('Home');
}
public function canHideMenuItem(
PhabricatorProfileMenuItemConfiguration $config) {
return false;
}
public function canMakeDefault(
PhabricatorProfileMenuItemConfiguration $config) {
return true;
}
public function getDisplayName(
PhabricatorProfileMenuItemConfiguration $config) {
$name = $config->getMenuItemProperty('name');
if (strlen($name)) {
return $name;
}
return $this->getDefaultName();
}
public function newPageContent() {
$viewer = $this->getViewer();
return id(new PHUIHomeView())
->setViewer($viewer);
}
public function buildEditEngineFields(
PhabricatorProfileMenuItemConfiguration $config) {
return array(
id(new PhabricatorTextEditField())
->setKey('name')
->setLabel(pht('Name'))
->setPlaceholder($this->getDefaultName())
->setValue($config->getMenuItemProperty('name')),
);
}
protected function newNavigationMenuItems(
PhabricatorProfileMenuItemConfiguration $config) {
$viewer = $this->getViewer();
- if ($viewer->isLoggedIn()) {
- $name = $this->getDisplayName($config);
- $icon = 'fa-home';
- $href = $this->getItemViewURI($config);
-
- $item = $this->newItem()
- ->setHref($href)
- ->setName($name)
- ->setIcon($icon);
+ if (!$viewer->isLoggedIn()) {
+ return array();
}
+ $name = $this->getDisplayName($config);
+ $icon = 'fa-home';
+ $href = $this->getItemViewURI($config);
+
+ $item = $this->newItem()
+ ->setHref($href)
+ ->setName($name)
+ ->setIcon($icon);
+
return array(
$item,
);
}
}

File Metadata

Mime Type
text/x-diff
Expires
Tue, Jul 29, 1:46 AM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
187760
Default Alt Text
(5 KB)

Event Timeline