1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-29 02:02:41 +01:00
phorge-phorge/src/applications/settings/application/PhabricatorApplicationSettings.php
epriestley 6df1a02413 (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-03 15:47:27 -07:00

61 lines
1.3 KiB
PHP

<?php
final class PhabricatorApplicationSettings extends PhabricatorApplication {
public function getBaseURI() {
return '/settings/';
}
public function getShortDescription() {
return pht('User Preferences');
}
public function getIconName() {
return 'settings';
}
public function canUninstall() {
return false;
}
public function isLaunchable() {
return false;
}
public function getRoutes() {
return array(
'/settings/' => array(
'(?:(?P<id>\d+)/)?(?:panel/(?P<key>[^/]+)/)?'
=> 'PhabricatorSettingsMainController',
'adjust/' => 'PhabricatorSettingsAdjustController',
),
);
}
public function getApplicationGroup() {
return self::GROUP_UTILITIES;
}
public function buildMainMenuItems(
PhabricatorUser $user,
PhabricatorController $controller = null) {
$items = array();
if ($user->isLoggedIn() && $user->isUserActivated()) {
$selected = ($controller instanceof PhabricatorSettingsMainController);
$item = id(new PHUIListItemView())
->setName(pht('Settings'))
->setIcon('settings-sm')
->addClass('core-menu-item')
->setSelected($selected)
->setHref('/settings/')
->setAural(pht('Settings'))
->setOrder(400);
$items[] = $item;
}
return $items;
}
}