Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2894802
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
4 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/applications/project/menuitem/PhabricatorProjectSubprojectsProfileMenuItem.php b/src/applications/project/menuitem/PhabricatorProjectSubprojectsProfileMenuItem.php
index dfcb164f45..6b43210274 100644
--- a/src/applications/project/menuitem/PhabricatorProjectSubprojectsProfileMenuItem.php
+++ b/src/applications/project/menuitem/PhabricatorProjectSubprojectsProfileMenuItem.php
@@ -1,71 +1,66 @@
<?php
final class PhabricatorProjectSubprojectsProfileMenuItem
extends PhabricatorProfileMenuItem {
const MENUITEMKEY = 'project.subprojects';
public function getMenuItemTypeName() {
return pht('Project Subprojects');
}
private function getDefaultName() {
return pht('Subprojects');
}
public function shouldEnableForObject($object) {
if ($object->isMilestone()) {
return false;
}
return true;
}
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) {
$project = $config->getProfileObject();
-
- $has_children = ($project->getHasSubprojects()) ||
- ($project->getHasMilestones());
-
$id = $project->getID();
$name = $this->getDisplayName($config);
$icon = 'fa-sitemap';
$href = "/project/subprojects/{$id}/";
$item = $this->newItem()
->setHref($href)
->setName($name)
- ->setDisabled(!$has_children)
->setIcon($icon);
return array(
$item,
);
}
}
diff --git a/src/applications/project/menuitem/PhabricatorProjectWorkboardProfileMenuItem.php b/src/applications/project/menuitem/PhabricatorProjectWorkboardProfileMenuItem.php
index 6305bb4b13..80ec0d835a 100644
--- a/src/applications/project/menuitem/PhabricatorProjectWorkboardProfileMenuItem.php
+++ b/src/applications/project/menuitem/PhabricatorProjectWorkboardProfileMenuItem.php
@@ -1,76 +1,73 @@
<?php
final class PhabricatorProjectWorkboardProfileMenuItem
extends PhabricatorProfileMenuItem {
const MENUITEMKEY = 'project.workboard';
public function getMenuItemTypeName() {
return pht('Project Workboard');
}
private function getDefaultName() {
return pht('Workboard');
}
public function canMakeDefault(
PhabricatorProfileMenuItemConfiguration $config) {
return true;
}
public function shouldEnableForObject($object) {
$viewer = $this->getViewer();
// Workboards are only available if Maniphest is installed.
$class = 'PhabricatorManiphestApplication';
if (!PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) {
return false;
}
return true;
}
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) {
$project = $config->getProfileObject();
- $has_workboard = $project->getHasWorkboard();
-
$id = $project->getID();
$href = "/project/board/{$id}/";
$name = $this->getDisplayName($config);
$item = $this->newItem()
->setHref($href)
->setName($name)
- ->setDisabled(!$has_workboard)
->setIcon('fa-columns');
return array(
$item,
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Jan 19, 20:30 (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1128457
Default Alt Text
(4 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment