2012-08-14 00:28:41 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorApplicationDiviner extends PhabricatorApplication {
|
|
|
|
|
2012-10-01 21:56:51 +02:00
|
|
|
public function getBaseURI() {
|
|
|
|
return '/diviner/';
|
|
|
|
}
|
|
|
|
|
Use application icons for "Eye" menu and Crumbs
Summary:
Issues here:
- Need an application-sized "eye", or a "home" icon for "Phabricator Home".
- Some of the "apps_lb_2x" sliced images are the "_dark_" versions, not the light versions.
- If you slice an application-sized "logout" (power off) icon and application-sized "help" (questionmark in circle) icon I can replace the current menu icons and nearly get rid of "autosprite".
- To replace the icons on /applications/, the non-retina size is "4x", so we'd need "8x" for retina. Alternatively I can reduce the icon sizes by 50%.
- The "Help", "Settings" and "Logout" items currently have a "glowing" hover state, which needs a variant (or we can drop it).
- The /applications/ icons have a white hover state (or we can drop it).
- The 1x application (14x14) icons aren't used anywhere right now, should they be? Maybe in the feed in the future, etc?
- The "apps-2x" and "apps-large" sheets are the same image, but getting them to actually use the same file is a bit tricky, so I just left them separate for now.
Test Plan:
{F26698}
{F26699}
Reviewers: chad
Reviewed By: chad
CC: aran
Maniphest Tasks: T1960
Differential Revision: https://secure.phabricator.com/D4108
2012-12-07 22:37:28 +01:00
|
|
|
public function getIconName() {
|
2012-10-01 21:56:51 +02:00
|
|
|
return 'diviner';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getShortDescription() {
|
|
|
|
return 'Documentation';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getTitleGlyph() {
|
|
|
|
return "\xE2\x97\x89";
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getRoutes() {
|
|
|
|
return array(
|
2013-05-31 19:52:25 +02:00
|
|
|
'/diviner/' => array(
|
|
|
|
'' => 'DivinerLegacyController',
|
|
|
|
'query/((?<key>[^/]+)/)?' => 'DivinerAtomListController',
|
|
|
|
),
|
2013-06-01 00:14:39 +02:00
|
|
|
'/docs/(?P<keyword>[^/]+)/' => 'DivinerJumpController',
|
2013-06-04 20:15:34 +02:00
|
|
|
'/book/(?P<book>[^/]+)/' => 'DivinerBookController',
|
2013-06-01 00:14:39 +02:00
|
|
|
'/book/'.
|
|
|
|
'(?P<book>[^/]+)/'.
|
|
|
|
'(?P<type>[^/]+)/'.
|
|
|
|
'(?:(?P<context>[^/]+)/)?'.
|
|
|
|
'(?P<name>[^/]+)/'.
|
|
|
|
'(?:(?P<index>\d+)/)?' => 'DivinerAtomController',
|
2012-10-01 21:56:51 +02:00
|
|
|
);
|
2012-08-14 00:28:41 +02:00
|
|
|
}
|
|
|
|
|
2012-10-04 00:46:19 +02:00
|
|
|
public function getApplicationGroup() {
|
|
|
|
return self::GROUP_COMMUNICATION;
|
|
|
|
}
|
|
|
|
|
2012-08-14 00:28:41 +02:00
|
|
|
public function buildMainMenuItems(
|
|
|
|
PhabricatorUser $user,
|
|
|
|
PhabricatorController $controller = null) {
|
|
|
|
|
|
|
|
$items = array();
|
2012-08-14 15:04:19 +02:00
|
|
|
|
|
|
|
$application = null;
|
|
|
|
if ($controller) {
|
|
|
|
$application = $controller->getCurrentApplication();
|
|
|
|
}
|
|
|
|
|
2012-08-14 00:28:41 +02:00
|
|
|
if ($application && $application->getHelpURI()) {
|
2012-12-07 22:33:03 +01:00
|
|
|
$item = new PhabricatorMenuItemView();
|
2012-08-14 00:28:41 +02:00
|
|
|
$item->setName(pht('%s Help', $application->getName()));
|
2012-12-07 22:33:03 +01:00
|
|
|
$item->setIcon('help');
|
2012-08-14 00:28:41 +02:00
|
|
|
$item->setHref($application->getHelpURI());
|
|
|
|
$items[] = $item;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $items;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|