2012-08-05 23:12:43 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorApplicationSettings extends PhabricatorApplication {
|
|
|
|
|
|
|
|
public function getBaseURI() {
|
|
|
|
return '/settings/';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getShortDescription() {
|
2014-05-29 21:17:54 +02:00
|
|
|
return pht('User Preferences');
|
2012-08-05 23:12:43 +02:00
|
|
|
}
|
|
|
|
|
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-08-14 23:23:55 +02:00
|
|
|
return 'settings';
|
2012-08-05 23:12:43 +02:00
|
|
|
}
|
|
|
|
|
2013-01-29 18:14:03 +01:00
|
|
|
public function canUninstall() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
(Redesign) Clean up older "Tile" code
Summary:
This does some backend cleanup of the tile stuff, and some general cleanup of other application things:
- Users who haven't customized preferences get a small, specific set of pinned applications: Differential, Maniphest, Diffusion, Audit, Phriction, Projects (and, for administrators, Auth, Config and People).
- Old tile size methods are replaced with `isPinnnedByDefault()`.
- Shortened some short descriptions.
- `shouldAppearInLaunchView()` replaced by less ambiguous `isLaunchable()`.
- Added a marker for third-party / extension applications.
Test Plan: Faked away my preferences and viewed the home page, saw a smaller set of default pins.
Reviewers: chad
Reviewed By: chad
Subscribers: epriestley
Differential Revision: https://secure.phabricator.com/D9358
2014-06-04 00:47:27 +02:00
|
|
|
public function isLaunchable() {
|
2014-05-29 21:17:54 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-08-05 23:12:43 +02:00
|
|
|
public function getRoutes() {
|
|
|
|
return array(
|
|
|
|
'/settings/' => array(
|
2014-04-02 21:06:05 +02:00
|
|
|
'(?:(?P<id>\d+)/)?(?:panel/(?P<key>[^/]+)/)?'
|
|
|
|
=> 'PhabricatorSettingsMainController',
|
2012-08-13 21:37:18 +02:00
|
|
|
'adjust/' => 'PhabricatorSettingsAdjustController',
|
2012-08-05 23:12:43 +02:00
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2012-10-04 00:46:19 +02:00
|
|
|
public function getApplicationGroup() {
|
|
|
|
return self::GROUP_UTILITIES;
|
|
|
|
}
|
|
|
|
|
2012-08-05 23:12:43 +02:00
|
|
|
public function buildMainMenuItems(
|
|
|
|
PhabricatorUser $user,
|
2012-08-06 21:46:51 +02:00
|
|
|
PhabricatorController $controller = null) {
|
2012-08-05 23:12:43 +02:00
|
|
|
|
|
|
|
$items = array();
|
|
|
|
|
2013-11-13 20:24:38 +01:00
|
|
|
if ($user->isLoggedIn() && $user->isUserActivated()) {
|
2012-12-07 22:33:03 +01:00
|
|
|
$selected = ($controller instanceof PhabricatorSettingsMainController);
|
2014-01-29 05:18:01 +01:00
|
|
|
$item = id(new PHUIListItemView())
|
|
|
|
->setName(pht('Settings'))
|
2014-01-31 18:10:32 +01:00
|
|
|
->setIcon('settings-sm')
|
2014-01-29 05:18:01 +01:00
|
|
|
->addClass('core-menu-item')
|
|
|
|
->setSelected($selected)
|
|
|
|
->setHref('/settings/')
|
Add support for aural-only and visual-only elements
Summary:
Ref T4843. This adds support to `javelin_tag()` for an `aural` attribute. When specified, `true` values mean "this content is aural-only", while `false` values mean "this content is not aural".
- I've attempted to find the best modern approaches for marking this content, but the `aural` attribute should let us change the mechanism later.
- Make the "beta" markers on application navigation visual only (see T4843). This information is of very low importance, the application navigation is accessed frequently, and the information is available on the application list.
- Partially convert the main navigation. This is mostly to test things, since I want to get more concrete feedback about approaches here.
- Add a `?__aural__=1` attribute, which renders the page with aural-only elements visible and visual-only elements colored.
Test Plan: {F146476}
Reviewers: btrahan, scp, chad
Reviewed By: chad
Subscribers: aklapper, qgil, epriestley
Maniphest Tasks: T4843
Differential Revision: https://secure.phabricator.com/D8830
2014-05-01 16:18:18 +02:00
|
|
|
->setAural(pht('Settings'))
|
2014-01-29 05:18:01 +01:00
|
|
|
->setOrder(400);
|
2012-08-05 23:12:43 +02:00
|
|
|
$items[] = $item;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $items;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|