Merge branch 'master' into blender-tweaks
This commit is contained in:
@@ -7,15 +7,44 @@ final class PhabricatorHomeProfileMenuEngine
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function getItemURI($path) {
|
||||
$object = $this->getProfileObject();
|
||||
$custom = $this->getCustomPHID();
|
||||
public function getItemURI($path) {
|
||||
return "/home/menu/{$path}";
|
||||
}
|
||||
|
||||
if ($custom) {
|
||||
return "/home/menu/personal/item/{$path}";
|
||||
} else {
|
||||
return "/home/menu/global/item/{$path}";
|
||||
private function buildWelcomePanelFromFile() {
|
||||
$webroot = dirname(phutil_get_library_root('phabricator')).'/webroot/';
|
||||
$panel = new PHUIObjectBoxView();
|
||||
$panel->setHeaderText('Welcome');
|
||||
$panel->appendChild(
|
||||
phutil_safe_html(
|
||||
FileSystem::readFile($webroot .
|
||||
PhabricatorEnv::getEnvConfig('welcome.file'))));
|
||||
|
||||
require_celerity_resource('phabricator-welcome-page');
|
||||
return $panel;
|
||||
}
|
||||
|
||||
protected function buildItemViewContent(
|
||||
PhabricatorProfileMenuItemConfiguration $item) {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
// Add content to the document so that you can drag-and-drop files onto
|
||||
// the home page or any home dashboard to upload them.
|
||||
|
||||
$upload = id(new PhabricatorGlobalUploadTargetView())
|
||||
->setUser($viewer);
|
||||
|
||||
$content = parent::buildItemViewContent($item);
|
||||
|
||||
if (PhabricatorEnv::getEnvConfig('welcome.file') !== null) {
|
||||
$content = array($this->buildWelcomePanelFromFile(),
|
||||
$content);
|
||||
}
|
||||
|
||||
return array(
|
||||
$content,
|
||||
$upload,
|
||||
);
|
||||
}
|
||||
|
||||
protected function getBuiltinProfileItems($object) {
|
||||
@@ -30,13 +59,23 @@ final class PhabricatorHomeProfileMenuEngine
|
||||
->withLaunchable(true)
|
||||
->execute();
|
||||
|
||||
// Default Home Dashboard
|
||||
$items[] = $this->newItem()
|
||||
->setBuiltinKey(PhabricatorHomeConstants::ITEM_HOME)
|
||||
->setMenuItemKey(PhabricatorHomeProfileMenuItem::MENUITEMKEY);
|
||||
|
||||
$items[] = $this->newItem()
|
||||
->setBuiltinKey(PhabricatorHomeConstants::ITEM_APPS_LABEL)
|
||||
->setMenuItemKey(PhabricatorLabelProfileMenuItem::MENUITEMKEY)
|
||||
->setMenuItemProperties(array('name' => pht('Applications')));
|
||||
|
||||
foreach ($applications as $application) {
|
||||
if (!$application->isPinnedByDefault($viewer)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$properties = array(
|
||||
'name' => $application->getName(),
|
||||
'name' => '',
|
||||
'application' => $application->getPHID(),
|
||||
);
|
||||
|
||||
@@ -46,11 +85,12 @@ final class PhabricatorHomeProfileMenuEngine
|
||||
->setMenuItemProperties($properties);
|
||||
}
|
||||
|
||||
// Single Manage Item, switches URI based on admin/user
|
||||
// Hotlink to More Applications Launcher...
|
||||
$items[] = $this->newItem()
|
||||
->setBuiltinKey(PhabricatorHomeConstants::ITEM_MANAGE)
|
||||
->setMenuItemKey(
|
||||
PhabricatorHomeManageProfileMenuItem::MENUITEMKEY);
|
||||
->setBuiltinKey(PhabricatorHomeConstants::ITEM_LAUNCHER)
|
||||
->setMenuItemKey(PhabricatorHomeLauncherProfileMenuItem::MENUITEMKEY);
|
||||
|
||||
$items[] = $this->newManageItem();
|
||||
|
||||
return $items;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user