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() {
|
2013-09-10 16:26:00 +02:00
|
|
|
return pht('Documentation');
|
2012-10-01 21:56:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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-07-28 22:07:30 +02:00
|
|
|
'find/' => 'DivinerFindController',
|
2013-05-31 19:52:25 +02:00
|
|
|
),
|
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;
|
|
|
|
}
|
|
|
|
|
2013-07-10 01:23:33 +02:00
|
|
|
public function getRemarkupRules() {
|
|
|
|
return array(
|
|
|
|
new DivinerRemarkupRuleSymbol(),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
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()) {
|
2014-01-29 05:18:01 +01:00
|
|
|
$item = id(new PHUIListItemView())
|
|
|
|
->setName(pht('%s Help', $application->getName()))
|
|
|
|
->addClass('core-menu-item')
|
2014-01-31 18:10:32 +01:00
|
|
|
->setIcon('info-sm')
|
|
|
|
->setOrder(200)
|
2014-01-29 05:18:01 +01:00
|
|
|
->setHref($application->getHelpURI());
|
2012-08-14 00:28:41 +02:00
|
|
|
$items[] = $item;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $items;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|