Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2892915
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
118 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/applications/base/PhabricatorApplication.php b/src/applications/base/PhabricatorApplication.php
index 9e1ea7d5ba..67294db263 100644
--- a/src/applications/base/PhabricatorApplication.php
+++ b/src/applications/base/PhabricatorApplication.php
@@ -1,660 +1,675 @@
<?php
/**
* @task info Application Information
* @task ui UI Integration
* @task uri URI Routing
* @task mail Email integration
* @task fact Fact Integration
* @task meta Application Management
*/
abstract class PhabricatorApplication
extends PhabricatorLiskDAO
implements
PhabricatorPolicyInterface,
PhabricatorApplicationTransactionInterface {
const GROUP_CORE = 'core';
const GROUP_UTILITIES = 'util';
const GROUP_ADMIN = 'admin';
const GROUP_DEVELOPER = 'developer';
final public static function getApplicationGroups() {
return array(
self::GROUP_CORE => pht('Core Applications'),
self::GROUP_UTILITIES => pht('Utilities'),
self::GROUP_ADMIN => pht('Administration'),
self::GROUP_DEVELOPER => pht('Developer Tools'),
);
}
final public function getApplicationName() {
return 'application';
}
final public function getTableName() {
return 'application_application';
}
final protected function getConfiguration() {
return array(
self::CONFIG_AUX_PHID => true,
) + parent::getConfiguration();
}
final public function generatePHID() {
return $this->getPHID();
}
final public function save() {
// When "save()" is called on applications, we just return without
// actually writing anything to the database.
return $this;
}
/* -( Application Information )-------------------------------------------- */
abstract public function getName();
public function getShortDescription() {
return pht('%s Application', $this->getName());
}
+ /**
+ * Extensions are allowed to register multi-character monograms.
+ * The name "Monogram" is actually a bit of a misnomer,
+ * but we're keeping it due to the history.
+ *
+ * @return array
+ */
+ public function getMonograms() {
+ return array();
+ }
+
+ public function isDeprecated() {
+ return false;
+ }
+
final public function isInstalled() {
if (!$this->canUninstall()) {
return true;
}
$prototypes = PhabricatorEnv::getEnvConfig('phabricator.show-prototypes');
if (!$prototypes && $this->isPrototype()) {
return false;
}
$uninstalled = PhabricatorEnv::getEnvConfig(
'phabricator.uninstalled-applications');
return empty($uninstalled[get_class($this)]);
}
public function isPrototype() {
return false;
}
/**
* Return `true` if this application should never appear in application lists
* in the UI. Primarily intended for unit test applications or other
* pseudo-applications.
*
* Few applications should be unlisted. For most applications, use
* @{method:isLaunchable} to hide them from main launch views instead.
*
* @return bool True to remove application from UI lists.
*/
public function isUnlisted() {
return false;
}
/**
* Return `true` if this application is a normal application with a base
* URI and a web interface.
*
* Launchable applications can be pinned to the home page, and show up in the
* "Launcher" view of the Applications application. Making an application
* unlaunchable prevents pinning and hides it from this view.
*
* Usually, an application should be marked unlaunchable if:
*
* - it is available on every page anyway (like search); or
* - it does not have a web interface (like subscriptions); or
* - it is still pre-release and being intentionally buried.
*
* To hide applications more completely, use @{method:isUnlisted}.
*
* @return bool True if the application is launchable.
*/
public function isLaunchable() {
return true;
}
/**
* Return `true` if this application should be pinned by default.
*
* Users who have not yet set preferences see a default list of applications.
*
* @param PhabricatorUser User viewing the pinned application list.
* @return bool True if this application should be pinned by default.
*/
public function isPinnedByDefault(PhabricatorUser $viewer) {
return false;
}
/**
* Returns true if an application is first-party and false otherwise.
*
* @return bool True if this application is first-party.
*/
final public function isFirstParty() {
$where = id(new ReflectionClass($this))->getFileName();
$root = phutil_get_library_root('phabricator');
if (!Filesystem::isDescendant($where, $root)) {
return false;
}
if (Filesystem::isDescendant($where, $root.'/extensions')) {
return false;
}
return true;
}
public function canUninstall() {
return true;
}
final public function getPHID() {
return 'PHID-APPS-'.get_class($this);
}
public function getTypeaheadURI() {
return $this->isLaunchable() ? $this->getBaseURI() : null;
}
public function getBaseURI() {
return null;
}
final public function getApplicationURI($path = '') {
return $this->getBaseURI().ltrim($path, '/');
}
public function getIcon() {
return 'fa-puzzle-piece';
}
public function getApplicationOrder() {
return PHP_INT_MAX;
}
public function getApplicationGroup() {
return self::GROUP_CORE;
}
public function getTitleGlyph() {
return null;
}
final public function getHelpMenuItems(PhabricatorUser $viewer) {
$items = array();
$articles = $this->getHelpDocumentationArticles($viewer);
if ($articles) {
foreach ($articles as $article) {
$item = id(new PhabricatorActionView())
->setName($article['name'])
->setHref($article['href'])
->addSigil('help-item')
->setOpenInNewWindow(true);
$items[] = $item;
}
}
$command_specs = $this->getMailCommandObjects();
if ($command_specs) {
foreach ($command_specs as $key => $spec) {
$object = $spec['object'];
$class = get_class($this);
$href = '/applications/mailcommands/'.$class.'/'.$key.'/';
$item = id(new PhabricatorActionView())
->setName($spec['name'])
->setHref($href)
->addSigil('help-item')
->setOpenInNewWindow(true);
$items[] = $item;
}
}
if ($items) {
$divider = id(new PhabricatorActionView())
->addSigil('help-item')
->setType(PhabricatorActionView::TYPE_DIVIDER);
array_unshift($items, $divider);
}
return array_values($items);
}
public function getHelpDocumentationArticles(PhabricatorUser $viewer) {
return array();
}
/**
* Get the Application Overview in raw Remarkup
*
* @return string|null
*/
public function getOverview() {
return null;
}
public function getEventListeners() {
return array();
}
public function getRemarkupRules() {
return array();
}
public function getQuicksandURIPatternBlacklist() {
return array();
}
public function getMailCommandObjects() {
return array();
}
/* -( URI Routing )-------------------------------------------------------- */
public function getRoutes() {
return array();
}
public function getResourceRoutes() {
return array();
}
/* -( Email Integration )-------------------------------------------------- */
public function supportsEmailIntegration() {
return false;
}
final protected function getInboundEmailSupportLink() {
return PhabricatorEnv::getDoclink('Configuring Inbound Email');
}
public function getAppEmailBlurb() {
throw new PhutilMethodNotImplementedException();
}
/* -( Fact Integration )--------------------------------------------------- */
public function getFactObjectsForAnalysis() {
return array();
}
/* -( UI Integration )----------------------------------------------------- */
/**
* You can provide an optional piece of flavor text for the application. This
* is currently rendered in application launch views if the application has no
* status elements.
*
* @return string|null Flavor text.
* @task ui
*/
public function getFlavorText() {
return null;
}
/**
* Build items for the main menu.
*
* @param PhabricatorUser The viewing user.
* @param AphrontController The current controller. May be null for special
* pages like 404, exception handlers, etc.
* @return list<PHUIListItemView> List of menu items.
* @task ui
*/
public function buildMainMenuItems(
PhabricatorUser $user,
PhabricatorController $controller = null) {
return array();
}
/* -( Application Management )--------------------------------------------- */
final public static function getByClass($class_name) {
$selected = null;
$applications = self::getAllApplications();
foreach ($applications as $application) {
if (get_class($application) == $class_name) {
$selected = $application;
break;
}
}
if (!$selected) {
throw new Exception(pht("No application '%s'!", $class_name));
}
return $selected;
}
final public static function getAllApplications() {
static $applications;
if ($applications === null) {
$apps = id(new PhutilClassMapQuery())
->setAncestorClass(__CLASS__)
->setSortMethod('getApplicationOrder')
->execute();
// Reorder the applications into "application order". Notably, this
// ensures their event handlers register in application order.
$apps = mgroup($apps, 'getApplicationGroup');
$group_order = array_keys(self::getApplicationGroups());
$apps = array_select_keys($apps, $group_order) + $apps;
$apps = array_mergev($apps);
$applications = $apps;
}
return $applications;
}
final public static function getAllInstalledApplications() {
$all_applications = self::getAllApplications();
$apps = array();
foreach ($all_applications as $app) {
if (!$app->isInstalled()) {
continue;
}
$apps[] = $app;
}
return $apps;
}
/**
* Determine if an application is installed, by application class name.
*
* To check if an application is installed //and// available to a particular
* viewer, user @{method:isClassInstalledForViewer}.
*
* @param string Application class name.
* @return bool True if the class is installed.
* @task meta
*/
final public static function isClassInstalled($class) {
return self::getByClass($class)->isInstalled();
}
/**
* Determine if an application is installed and available to a viewer, by
* application class name.
*
* To check if an application is installed at all, use
* @{method:isClassInstalled}.
*
* @param string Application class name.
* @param PhabricatorUser Viewing user.
* @return bool True if the class is installed for the viewer.
* @task meta
*/
final public static function isClassInstalledForViewer(
$class,
PhabricatorUser $viewer) {
if ($viewer->isOmnipotent()) {
return true;
}
$cache = PhabricatorCaches::getRequestCache();
$viewer_fragment = $viewer->getCacheFragment();
$key = 'app.'.$class.'.installed.'.$viewer_fragment;
$result = $cache->getKey($key);
if ($result === null) {
if (!self::isClassInstalled($class)) {
$result = false;
} else {
$application = self::getByClass($class);
if (!$application->canUninstall()) {
// If the application can not be uninstalled, always allow viewers
// to see it. In particular, this allows logged-out viewers to see
// Settings and load global default settings even if the install
// does not allow public viewers.
$result = true;
} else {
$result = PhabricatorPolicyFilter::hasCapability(
$viewer,
self::getByClass($class),
PhabricatorPolicyCapability::CAN_VIEW);
}
}
$cache->setKey($key, $result);
}
return $result;
}
/* -( PhabricatorPolicyInterface )----------------------------------------- */
public function getCapabilities() {
return array_merge(
array(
PhabricatorPolicyCapability::CAN_VIEW,
PhabricatorPolicyCapability::CAN_EDIT,
),
array_keys($this->getCustomCapabilities()));
}
public function getPolicy($capability) {
$default = $this->getCustomPolicySetting($capability);
if ($default) {
return $default;
}
switch ($capability) {
case PhabricatorPolicyCapability::CAN_VIEW:
return PhabricatorPolicies::getMostOpenPolicy();
case PhabricatorPolicyCapability::CAN_EDIT:
return PhabricatorPolicies::POLICY_ADMIN;
default:
$spec = $this->getCustomCapabilitySpecification($capability);
return idx($spec, 'default', PhabricatorPolicies::POLICY_USER);
}
}
public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
return false;
}
/* -( Policies )----------------------------------------------------------- */
protected function getCustomCapabilities() {
return array();
}
private function getCustomPolicySetting($capability) {
if (!$this->isCapabilityEditable($capability)) {
return null;
}
$policy_locked = PhabricatorEnv::getEnvConfig('policy.locked');
if (isset($policy_locked[$capability])) {
return $policy_locked[$capability];
}
$config = PhabricatorEnv::getEnvConfig('phabricator.application-settings');
$app = idx($config, $this->getPHID());
if (!$app) {
return null;
}
$policy = idx($app, 'policy');
if (!$policy) {
return null;
}
return idx($policy, $capability);
}
private function getCustomCapabilitySpecification($capability) {
$custom = $this->getCustomCapabilities();
if (!isset($custom[$capability])) {
throw new Exception(pht("Unknown capability '%s'!", $capability));
}
return $custom[$capability];
}
final public function getCapabilityLabel($capability) {
switch ($capability) {
case PhabricatorPolicyCapability::CAN_VIEW:
return pht('Can Use Application');
case PhabricatorPolicyCapability::CAN_EDIT:
return pht('Can Configure Application');
}
$capobj = PhabricatorPolicyCapability::getCapabilityByKey($capability);
if ($capobj) {
return $capobj->getCapabilityName();
}
return null;
}
final public function isCapabilityEditable($capability) {
switch ($capability) {
case PhabricatorPolicyCapability::CAN_VIEW:
return $this->canUninstall();
case PhabricatorPolicyCapability::CAN_EDIT:
return true;
default:
$spec = $this->getCustomCapabilitySpecification($capability);
return idx($spec, 'edit', true);
}
}
final public function getCapabilityCaption($capability) {
switch ($capability) {
case PhabricatorPolicyCapability::CAN_VIEW:
if (!$this->canUninstall()) {
return pht(
'This application is required, so all '.
'users must have access to it.');
} else {
return null;
}
case PhabricatorPolicyCapability::CAN_EDIT:
return null;
default:
$spec = $this->getCustomCapabilitySpecification($capability);
return idx($spec, 'caption');
}
}
final public function getCapabilityTemplatePHIDType($capability) {
switch ($capability) {
case PhabricatorPolicyCapability::CAN_VIEW:
case PhabricatorPolicyCapability::CAN_EDIT:
return null;
}
$spec = $this->getCustomCapabilitySpecification($capability);
return idx($spec, 'template');
}
final public function getDefaultObjectTypePolicyMap() {
$map = array();
foreach ($this->getCustomCapabilities() as $capability => $spec) {
if (empty($spec['template'])) {
continue;
}
if (empty($spec['capability'])) {
continue;
}
$default = $this->getPolicy($capability);
$map[$spec['template']][$spec['capability']] = $default;
}
return $map;
}
public function getApplicationSearchDocumentTypes() {
return array();
}
protected function getEditRoutePattern($base = null) {
return $base.'(?:'.
'(?P<id>[0-9]\d*)/)?'.
'(?:'.
'(?:'.
'(?P<editAction>parameters|nodefault|nocreate|nomanage|comment)/'.
'|'.
'(?:form/(?P<formKey>[^/]+)/)?(?:page/(?P<pageKey>[^/]+)/)?'.
')'.
')?';
}
protected function getBulkRoutePattern($base = null) {
return $base.'(?:query/(?P<queryKey>[^/]+)/)?';
}
protected function getQueryRoutePattern($base = null) {
return $base.'(?:query/(?P<queryKey>[^/]+)/(?:(?P<queryAction>[^/]+)/)?)?';
}
protected function getProfileMenuRouting($controller) {
$edit_route = $this->getEditRoutePattern();
$mode_route = '(?P<itemEditMode>global|custom)/';
return array(
'(?P<itemAction>view)/(?P<itemID>[^/]+)/' => $controller,
'(?P<itemAction>hide)/(?P<itemID>[^/]+)/' => $controller,
'(?P<itemAction>default)/(?P<itemID>[^/]+)/' => $controller,
'(?P<itemAction>configure)/' => $controller,
'(?P<itemAction>configure)/'.$mode_route => $controller,
'(?P<itemAction>reorder)/'.$mode_route => $controller,
'(?P<itemAction>edit)/'.$edit_route => $controller,
'(?P<itemAction>new)/'.$mode_route.'(?<itemKey>[^/]+)/'.$edit_route
=> $controller,
'(?P<itemAction>builtin)/(?<itemID>[^/]+)/'.$edit_route
=> $controller,
);
}
/* -( PhabricatorApplicationTransactionInterface )------------------------- */
public function getApplicationTransactionEditor() {
return new PhabricatorApplicationEditor();
}
public function getApplicationTransactionTemplate() {
return new PhabricatorApplicationApplicationTransaction();
}
}
diff --git a/src/applications/calendar/application/PhabricatorCalendarApplication.php b/src/applications/calendar/application/PhabricatorCalendarApplication.php
index fa534280a0..c9ff3ac9d3 100644
--- a/src/applications/calendar/application/PhabricatorCalendarApplication.php
+++ b/src/applications/calendar/application/PhabricatorCalendarApplication.php
@@ -1,151 +1,155 @@
<?php
final class PhabricatorCalendarApplication extends PhabricatorApplication {
public function getName() {
return pht('Calendar');
}
public function getShortDescription() {
return pht('Upcoming Events');
}
public function getFlavorText() {
return pht('Never miss an episode ever again.');
}
public function getBaseURI() {
return '/calendar/';
}
public function getIcon() {
return 'fa-calendar';
}
public function getTitleGlyph() {
// Unicode has a calendar character but it's in some distant code plane,
// use "keyboard" since it looks vaguely similar.
return "\xE2\x8C\xA8";
}
+ public function getMonograms() {
+ return array('E');
+ }
+
public function getApplicationGroup() {
return self::GROUP_UTILITIES;
}
public function isPrototype() {
return true;
}
public function getRemarkupRules() {
return array(
new PhabricatorCalendarRemarkupRule(),
);
}
public function getRoutes() {
return array(
'/E(?P<id>[1-9]\d*)(?:/(?P<sequence>\d+)/)?'
=> 'PhabricatorCalendarEventViewController',
'/calendar/' => array(
'(?:query/(?P<queryKey>[^/]+)/(?:(?P<year>\d+)/'.
'(?P<month>\d+)/)?(?:(?P<day>\d+)/)?)?'
=> 'PhabricatorCalendarEventListController',
'event/' => array(
$this->getEditRoutePattern('edit/')
=> 'PhabricatorCalendarEventEditController',
'drag/(?P<id>[1-9]\d*)/'
=> 'PhabricatorCalendarEventDragController',
'cancel/(?P<id>[1-9]\d*)/'
=> 'PhabricatorCalendarEventCancelController',
'(?P<action>join|decline|accept)/(?P<id>[1-9]\d*)/'
=> 'PhabricatorCalendarEventJoinController',
'export/(?P<id>[1-9]\d*)/(?P<filename>[^/]*)'
=> 'PhabricatorCalendarEventExportController',
'availability/(?P<id>[1-9]\d*)/(?P<availability>[^/]+)/'
=> 'PhabricatorCalendarEventAvailabilityController',
),
'export/' => array(
$this->getQueryRoutePattern()
=> 'PhabricatorCalendarExportListController',
$this->getEditRoutePattern('edit/')
=> 'PhabricatorCalendarExportEditController',
'(?P<id>[1-9]\d*)/'
=> 'PhabricatorCalendarExportViewController',
'ics/(?P<secretKey>[^/]+)/(?P<filename>[^/]*)'
=> 'PhabricatorCalendarExportICSController',
'disable/(?P<id>[1-9]\d*)/'
=> 'PhabricatorCalendarExportDisableController',
),
'import/' => array(
$this->getQueryRoutePattern()
=> 'PhabricatorCalendarImportListController',
$this->getEditRoutePattern('edit/')
=> 'PhabricatorCalendarImportEditController',
'(?P<id>[1-9]\d*)/'
=> 'PhabricatorCalendarImportViewController',
'disable/(?P<id>[1-9]\d*)/'
=> 'PhabricatorCalendarImportDisableController',
'delete/(?P<id>[1-9]\d*)/'
=> 'PhabricatorCalendarImportDeleteController',
'reload/(?P<id>[1-9]\d*)/'
=> 'PhabricatorCalendarImportReloadController',
'drop/'
=> 'PhabricatorCalendarImportDropController',
'log/' => array(
$this->getQueryRoutePattern()
=> 'PhabricatorCalendarImportLogListController',
),
),
),
);
}
public function getHelpDocumentationArticles(PhabricatorUser $viewer) {
return array(
array(
'name' => pht('Calendar User Guide'),
'href' => PhabricatorEnv::getDoclink('Calendar User Guide'),
),
array(
'name' => pht('Importing Events'),
'href' => PhabricatorEnv::getDoclink(
'Calendar User Guide: Importing Events'),
),
array(
'name' => pht('Exporting Events'),
'href' => PhabricatorEnv::getDoclink(
'Calendar User Guide: Exporting Events'),
),
);
}
public function getMailCommandObjects() {
return array(
'event' => array(
'name' => pht('Email Commands: Events'),
'header' => pht('Interacting with Calendar Events'),
'object' => new PhabricatorCalendarEvent(),
'summary' => pht(
'This page documents the commands you can use to interact with '.
'events in Calendar. These commands work when creating new tasks '.
'via email and when replying to existing tasks.'),
),
);
}
protected function getCustomCapabilities() {
return array(
PhabricatorCalendarEventDefaultViewCapability::CAPABILITY => array(
'caption' => pht('Default view policy for newly created events.'),
'template' => PhabricatorCalendarEventPHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_VIEW,
),
PhabricatorCalendarEventDefaultEditCapability::CAPABILITY => array(
'caption' => pht('Default edit policy for newly created events.'),
'template' => PhabricatorCalendarEventPHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_EDIT,
),
);
}
}
diff --git a/src/applications/chatlog/application/PhabricatorChatLogApplication.php b/src/applications/chatlog/application/PhabricatorChatLogApplication.php
index 912ddd9b6b..ab5eb1960f 100644
--- a/src/applications/chatlog/application/PhabricatorChatLogApplication.php
+++ b/src/applications/chatlog/application/PhabricatorChatLogApplication.php
@@ -1,43 +1,47 @@
<?php
final class PhabricatorChatLogApplication extends PhabricatorApplication {
public function getBaseURI() {
return '/chatlog/';
}
public function getName() {
return pht('ChatLog');
}
public function getShortDescription() {
- return pht('(Deprecated)');
+ return pht('IRC Logs');
}
public function getIcon() {
return 'fa-coffee';
}
public function isPrototype() {
return true;
}
+ public function isDeprecated() {
+ return true;
+ }
+
public function getTitleGlyph() {
return "\xE0\xBC\x84";
}
public function getApplicationGroup() {
return self::GROUP_UTILITIES;
}
- public function getRoutes() {
+ public function getRoutes() {
return array(
'/chatlog/' => array(
'' => 'PhabricatorChatLogChannelListController',
'channel/(?P<channelID>[^/]+)/'
=> 'PhabricatorChatLogChannelLogController',
),
);
}
}
diff --git a/src/applications/conpherence/application/PhabricatorConpherenceApplication.php b/src/applications/conpherence/application/PhabricatorConpherenceApplication.php
index a0c21bd33a..f3118be9bf 100644
--- a/src/applications/conpherence/application/PhabricatorConpherenceApplication.php
+++ b/src/applications/conpherence/application/PhabricatorConpherenceApplication.php
@@ -1,85 +1,89 @@
<?php
final class PhabricatorConpherenceApplication extends PhabricatorApplication {
public function getBaseURI() {
return '/conpherence/';
}
public function getName() {
return pht('Conpherence');
}
public function getShortDescription() {
return pht('Chat with Others');
}
public function getIcon() {
return 'fa-comments';
}
public function getTitleGlyph() {
return "\xE2\x9C\x86";
}
public function getRemarkupRules() {
return array(
new ConpherenceThreadRemarkupRule(),
);
}
+ public function getMonograms() {
+ return array('Z');
+ }
+
public function getRoutes() {
return array(
'/Z(?P<id>[1-9]\d*)'
=> 'ConpherenceViewController',
'/conpherence/' => array(
''
=> 'ConpherenceListController',
'thread/(?P<id>[1-9]\d*)/'
=> 'ConpherenceListController',
'threadsearch/(?P<id>[1-9]\d*)/'
=> 'ConpherenceThreadSearchController',
'(?P<id>[1-9]\d*)/'
=> 'ConpherenceViewController',
'(?P<id>[1-9]\d*)/(?P<messageID>[1-9]\d*)/'
=> 'ConpherenceViewController',
'columnview/'
=> 'ConpherenceColumnViewController',
$this->getEditRoutePattern('new/')
=> 'ConpherenceRoomEditController',
$this->getEditRoutePattern('edit/')
=> 'ConpherenceRoomEditController',
'picture/(?P<id>[1-9]\d*)/'
=> 'ConpherenceRoomPictureController',
'search/(?:query/(?P<queryKey>[^/]+)/)?'
=> 'ConpherenceRoomListController',
'panel/'
=> 'ConpherenceNotificationPanelController',
'participant/(?P<id>[1-9]\d*)/'
=> 'ConpherenceParticipantController',
'preferences/(?P<id>[1-9]\d*)/'
=> 'ConpherenceRoomPreferencesController',
'update/(?P<id>[1-9]\d*)/'
=> 'ConpherenceUpdateController',
),
);
}
public function getQuicksandURIPatternBlacklist() {
return array(
'/conpherence/.*',
'/Z\d+',
);
}
public function getMailCommandObjects() {
// TODO: Conpherence threads don't currently support any commands directly,
// so the documentation page we end up generating is empty and funny
// looking. Add support here once we support "!add", "!leave", "!topic",
// or whatever else.
return array();
}
}
diff --git a/src/applications/countdown/application/PhabricatorCountdownApplication.php b/src/applications/countdown/application/PhabricatorCountdownApplication.php
index e205ba64c3..5f06e6ef9f 100644
--- a/src/applications/countdown/application/PhabricatorCountdownApplication.php
+++ b/src/applications/countdown/application/PhabricatorCountdownApplication.php
@@ -1,70 +1,74 @@
<?php
final class PhabricatorCountdownApplication extends PhabricatorApplication {
public function getBaseURI() {
return '/countdown/';
}
public function getIcon() {
return 'fa-rocket';
}
public function getName() {
return pht('Countdown');
}
public function getShortDescription() {
return pht('Countdown to Events');
}
public function getTitleGlyph() {
return "\xE2\x9A\xB2";
}
public function getFlavorText() {
return pht('Utilize the full capabilities of your ALU.');
}
public function getApplicationGroup() {
return self::GROUP_UTILITIES;
}
public function getRemarkupRules() {
return array(
new PhabricatorCountdownRemarkupRule(),
);
}
+ public function getMonograms() {
+ return array('C');
+ }
+
public function getRoutes() {
return array(
'/C(?P<id>[1-9]\d*)' => 'PhabricatorCountdownViewController',
'/countdown/' => array(
'(?:query/(?P<queryKey>[^/]+)/)?'
=> 'PhabricatorCountdownListController',
$this->getEditRoutePattern('edit/')
=> 'PhabricatorCountdownEditController',
),
);
}
protected function getCustomCapabilities() {
return array(
PhabricatorCountdownCreateCapability::CAPABILITY => array(
'default' => PhabricatorPolicies::POLICY_USER,
'caption' => pht('Default create policy for countdowns.'),
),
PhabricatorCountdownDefaultViewCapability::CAPABILITY => array(
'caption' => pht('Default view policy for new countdowns.'),
'template' => PhabricatorCountdownCountdownPHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_VIEW,
),
PhabricatorCountdownDefaultEditCapability::CAPABILITY => array(
'caption' => pht('Default edit policy for new countdowns.'),
'template' => PhabricatorCountdownCountdownPHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_EDIT,
),
);
}
}
diff --git a/src/applications/dashboard/application/PhabricatorDashboardApplication.php b/src/applications/dashboard/application/PhabricatorDashboardApplication.php
index 3cdb932514..aeb2f43195 100644
--- a/src/applications/dashboard/application/PhabricatorDashboardApplication.php
+++ b/src/applications/dashboard/application/PhabricatorDashboardApplication.php
@@ -1,94 +1,98 @@
<?php
final class PhabricatorDashboardApplication extends PhabricatorApplication {
public function getName() {
return pht('Dashboards');
}
public function getBaseURI() {
return '/dashboard/';
}
public function getTypeaheadURI() {
return '/dashboard/console/';
}
public function getShortDescription() {
return pht('Create Custom Pages');
}
public function getIcon() {
return 'fa-dashboard';
}
public function isPinnedByDefault(PhabricatorUser $viewer) {
return true;
}
public function getApplicationOrder() {
return 0.160;
}
+ public function getMonograms() {
+ return array('W');
+ }
+
public function getRoutes() {
$menu_rules = $this->getProfileMenuRouting(
'PhabricatorDashboardPortalViewController');
return array(
'/W(?P<id>\d+)' => 'PhabricatorDashboardPanelViewController',
'/dashboard/' => array(
'(?:query/(?P<queryKey>[^/]+)/)?'
=> 'PhabricatorDashboardListController',
'view/(?P<id>\d+)/' => 'PhabricatorDashboardViewController',
'archive/(?P<id>\d+)/' => 'PhabricatorDashboardArchiveController',
$this->getEditRoutePattern('edit/') =>
'PhabricatorDashboardEditController',
'install/(?P<id>\d+)/'.
'(?:(?P<workflowKey>[^/]+)/'.
'(?:(?P<modeKey>[^/]+)/)?)?' =>
'PhabricatorDashboardInstallController',
'console/' => 'PhabricatorDashboardConsoleController',
'adjust/(?P<op>remove|add|move)/'
=> 'PhabricatorDashboardAdjustController',
'panel/' => array(
'install/(?P<engineKey>[^/]+)/(?:(?P<queryKey>[^/]+)/)?' =>
'PhabricatorDashboardQueryPanelInstallController',
'(?:query/(?P<queryKey>[^/]+)/)?'
=> 'PhabricatorDashboardPanelListController',
$this->getEditRoutePattern('edit/')
=> 'PhabricatorDashboardPanelEditController',
'render/(?P<id>\d+)/' => 'PhabricatorDashboardPanelRenderController',
'archive/(?P<id>\d+)/'
=> 'PhabricatorDashboardPanelArchiveController',
'tabs/(?P<id>\d+)/(?P<op>add|move|remove|rename)/'
=> 'PhabricatorDashboardPanelTabsController',
),
),
'/portal/' => array(
$this->getQueryRoutePattern() =>
'PhabricatorDashboardPortalListController',
$this->getEditRoutePattern('edit/') =>
'PhabricatorDashboardPortalEditController',
'view/(?P<portalID>\d+)/' => array(
'' => 'PhabricatorDashboardPortalViewController',
) + $menu_rules,
),
);
}
public function getRemarkupRules() {
return array(
new PhabricatorDashboardRemarkupRule(),
);
}
protected function getCustomCapabilities() {
return array(
PhabricatorDashboardCreateCapability::CAPABILITY => array(
'default' => PhabricatorPolicies::POLICY_USER,
'caption' => pht('Default create policy for Dashboards.'),
),
);
}
}
diff --git a/src/applications/differential/application/PhabricatorDifferentialApplication.php b/src/applications/differential/application/PhabricatorDifferentialApplication.php
index 5980f738b0..16b3193dac 100644
--- a/src/applications/differential/application/PhabricatorDifferentialApplication.php
+++ b/src/applications/differential/application/PhabricatorDifferentialApplication.php
@@ -1,147 +1,151 @@
<?php
final class PhabricatorDifferentialApplication
extends PhabricatorApplication {
public function getBaseURI() {
return '/differential/';
}
public function getName() {
return pht('Differential');
}
public function getShortDescription() {
return pht('Pre-Commit Review');
}
public function getIcon() {
return 'fa-cog';
}
public function isPinnedByDefault(PhabricatorUser $viewer) {
return true;
}
public function getHelpDocumentationArticles(PhabricatorUser $viewer) {
return array(
array(
'name' => pht('Differential User Guide'),
'href' => PhabricatorEnv::getDoclink('Differential User Guide'),
),
);
}
public function getTitleGlyph() {
return "\xE2\x9A\x99";
}
public function getOverview() {
return pht(
'Differential is a **code review application** which allows '.
'engineers to review, discuss and approve changes to software.');
}
+ public function getMonograms() {
+ return array('D');
+ }
+
public function getRoutes() {
return array(
'/D(?P<id>[1-9]\d*)' => array(
'' => 'DifferentialRevisionViewController',
'/(?P<filter>new)/' => 'DifferentialRevisionViewController',
),
'/differential/' => array(
$this->getQueryRoutePattern() => 'DifferentialRevisionListController',
'diff/' => array(
'(?P<id>[1-9]\d*)/' => array(
'' => 'DifferentialDiffViewController',
'changesets/' => array(
$this->getQueryRoutePattern()
=> 'DifferentialChangesetListController',
),
),
'create/' => 'DifferentialDiffCreateController',
),
'changeset/' => 'DifferentialChangesetViewController',
'revision/' => array(
$this->getEditRoutePattern('edit/')
=> 'DifferentialRevisionEditController',
$this->getEditRoutePattern('attach/(?P<diffID>[^/]+)/to/')
=> 'DifferentialRevisionEditController',
'closedetails/(?P<phid>[^/]+)/'
=> 'DifferentialRevisionCloseDetailsController',
'update/(?P<revisionID>[1-9]\d*)/'
=> 'DifferentialDiffCreateController',
'operation/(?P<id>[1-9]\d*)/'
=> 'DifferentialRevisionOperationController',
'inlines/(?P<id>[1-9]\d*)/'
=> 'DifferentialRevisionInlinesController',
'paths/(?P<id>[1-9]\d*)/'
=> 'DifferentialRevisionAffectedPathsController',
),
'comment/' => array(
'inline/' => array(
'edit/(?P<id>[1-9]\d*)/'
=> 'DifferentialInlineCommentEditController',
),
),
'preview/' => 'PhabricatorMarkupPreviewController',
),
);
}
public function getApplicationOrder() {
return 0.100;
}
public function getRemarkupRules() {
return array(
new DifferentialRemarkupRule(),
);
}
public function supportsEmailIntegration() {
return true;
}
public function getAppEmailBlurb() {
return pht(
'Send email to these addresses to create revisions. The body of the '.
'message and / or one or more attachments should be the output of a '.
'"diff" command. %s',
phutil_tag(
'a',
array(
'href' => $this->getInboundEmailSupportLink(),
),
pht('Learn More')));
}
protected function getCustomCapabilities() {
return array(
DifferentialDefaultViewCapability::CAPABILITY => array(
'caption' => pht('Default view policy for newly created revisions.'),
'template' => DifferentialRevisionPHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_VIEW,
),
);
}
public function getMailCommandObjects() {
return array(
'revision' => array(
'name' => pht('Email Commands: Revisions'),
'header' => pht('Interacting with Differential Revisions'),
'object' => new DifferentialRevision(),
'summary' => pht(
'This page documents the commands you can use to interact with '.
'revisions in Differential.'),
),
);
}
public function getApplicationSearchDocumentTypes() {
return array(
DifferentialRevisionPHIDType::TYPECONST,
);
}
}
diff --git a/src/applications/diffusion/application/PhabricatorDiffusionApplication.php b/src/applications/diffusion/application/PhabricatorDiffusionApplication.php
index ccd311fa7e..a2b9f81aee 100644
--- a/src/applications/diffusion/application/PhabricatorDiffusionApplication.php
+++ b/src/applications/diffusion/application/PhabricatorDiffusionApplication.php
@@ -1,211 +1,216 @@
<?php
final class PhabricatorDiffusionApplication extends PhabricatorApplication {
public function getName() {
return pht('Diffusion');
}
public function getShortDescription() {
return pht('Host and Browse Repositories');
}
public function getBaseURI() {
return '/diffusion/';
}
public function getIcon() {
return 'fa-code';
}
public function isPinnedByDefault(PhabricatorUser $viewer) {
return true;
}
public function getHelpDocumentationArticles(PhabricatorUser $viewer) {
return array(
array(
'name' => pht('Diffusion User Guide'),
'href' => PhabricatorEnv::getDoclink('Diffusion User Guide'),
),
array(
'name' => pht('Audit User Guide'),
'href' => PhabricatorEnv::getDoclink('Audit User Guide'),
),
);
}
public function getRemarkupRules() {
return array(
new DiffusionCommitRemarkupRule(),
new DiffusionRepositoryRemarkupRule(),
new DiffusionRepositoryByIDRemarkupRule(),
new DiffusionSourceLinkRemarkupRule(),
);
}
+ public function getMonograms() {
+ // This is a special case, as r and R mean different things.
+ return array('r', 'R');
+ }
+
public function getRoutes() {
$repository_routes = array(
'/' => array(
'' => 'DiffusionRepositoryController',
'repository/(?P<dblob>.*)' => 'DiffusionRepositoryController',
'change/(?P<dblob>.*)' => 'DiffusionChangeController',
'clone/' => 'DiffusionCloneController',
'history/(?P<dblob>.*)' => 'DiffusionHistoryController',
'browse/(?P<dblob>.*)' => 'DiffusionBrowseController',
'document/(?P<dblob>.*)'
=> 'DiffusionDocumentController',
'blame/(?P<dblob>.*)'
=> 'DiffusionBlameController',
'lastmodified/(?P<dblob>.*)' => 'DiffusionLastModifiedController',
'diff/' => 'DiffusionDiffController',
'tags/(?P<dblob>.*)' => 'DiffusionTagListController',
'branches/(?P<dblob>.*)' => 'DiffusionBranchTableController',
'refs/(?P<dblob>.*)' => 'DiffusionRefTableController',
'lint/(?P<dblob>.*)' => 'DiffusionLintController',
'commit/(?P<commit>[a-z0-9]+)' => array(
'/?' => 'DiffusionCommitController',
'/branches/' => 'DiffusionCommitBranchesController',
'/tags/' => 'DiffusionCommitTagsController',
),
'compare/' => 'DiffusionCompareController',
'manage/(?:(?P<panel>[^/]+)/)?'
=> 'DiffusionRepositoryManagePanelsController',
'uri/' => array(
'view/(?P<id>[0-9]\d*)/' => 'DiffusionRepositoryURIViewController',
'disable/(?P<id>[0-9]\d*)/'
=> 'DiffusionRepositoryURIDisableController',
$this->getEditRoutePattern('edit/')
=> 'DiffusionRepositoryURIEditController',
'credential/(?P<id>[0-9]\d*)/(?P<action>edit|remove)/'
=> 'DiffusionRepositoryURICredentialController',
),
'edit/' => array(
'activate/' => 'DiffusionRepositoryEditActivateController',
'dangerous/' => 'DiffusionRepositoryEditDangerousController',
'enormous/' => 'DiffusionRepositoryEditEnormousController',
'delete/' => 'DiffusionRepositoryEditDeleteController',
'update/' => 'DiffusionRepositoryEditUpdateController',
'publish/' => 'DiffusionRepositoryEditPublishingController',
'testautomation/' => 'DiffusionRepositoryTestAutomationController',
),
'pathtree/(?P<dblob>.*)' => 'DiffusionPathTreeController',
),
// NOTE: This must come after the rules above; it just gives us a
// catch-all for serving repositories over HTTP. We must accept requests
// without the trailing "/" because SVN commands don't necessarily
// include it.
'(?:/.*)?' => 'DiffusionRepositoryDefaultController',
);
return array(
'/(?:'.
'r(?P<repositoryCallsign>[A-Z]+)'.
'|'.
'R(?P<repositoryID>[1-9]\d*):'.
')(?P<commit>[a-f0-9]+)'
=> 'DiffusionCommitController',
'/source/(?P<repositoryShortName>[^/]+)'
=> $repository_routes,
'/diffusion/' => array(
$this->getQueryRoutePattern()
=> 'DiffusionRepositoryListController',
$this->getEditRoutePattern('edit/') =>
'DiffusionRepositoryEditController',
'pushlog/' => array(
$this->getQueryRoutePattern() => 'DiffusionPushLogListController',
'view/(?P<id>\d+)/' => 'DiffusionPushEventViewController',
),
'synclog/' => array(
$this->getQueryRoutePattern() => 'DiffusionSyncLogListController',
),
'pulllog/' => array(
$this->getQueryRoutePattern() => 'DiffusionPullLogListController',
),
'(?P<repositoryCallsign>[A-Z]+)' => $repository_routes,
'(?P<repositoryID>[1-9]\d*)' => $repository_routes,
'identity/' => array(
$this->getQueryRoutePattern() =>
'DiffusionIdentityListController',
$this->getEditRoutePattern('edit/') =>
'DiffusionIdentityEditController',
'view/(?P<id>[^/]+)/' =>
'DiffusionIdentityViewController',
),
'inline/' => array(
'edit/(?P<phid>[^/]+)/' => 'DiffusionInlineCommentController',
),
'services/' => array(
'path/' => array(
'complete/' => 'DiffusionPathCompleteController',
'validate/' => 'DiffusionPathValidateController',
),
),
'symbol/(?P<name>[^/]+)/' => 'DiffusionSymbolController',
'external/' => 'DiffusionExternalController',
'lint/' => 'DiffusionLintController',
'commit/' => array(
$this->getQueryRoutePattern() =>
'DiffusionCommitListController',
$this->getEditRoutePattern('edit/') =>
'DiffusionCommitEditController',
),
'picture/(?P<id>[0-9]\d*)/'
=> 'DiffusionRepositoryProfilePictureController',
),
);
}
public function getApplicationOrder() {
return 0.120;
}
protected function getCustomCapabilities() {
return array(
DiffusionDefaultViewCapability::CAPABILITY => array(
'template' => PhabricatorRepositoryRepositoryPHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_VIEW,
),
DiffusionDefaultEditCapability::CAPABILITY => array(
'default' => PhabricatorPolicies::POLICY_ADMIN,
'template' => PhabricatorRepositoryRepositoryPHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_EDIT,
),
DiffusionDefaultPushCapability::CAPABILITY => array(
'template' => PhabricatorRepositoryRepositoryPHIDType::TYPECONST,
),
DiffusionCreateRepositoriesCapability::CAPABILITY => array(
'default' => PhabricatorPolicies::POLICY_ADMIN,
),
PhabricatorRepositoryIdentityEditViewCapability::CAPABILITY => array(
'default' => PhabricatorPolicies::POLICY_USER,
),
);
}
public function getMailCommandObjects() {
return array(
'commit' => array(
'name' => pht('Email Commands: Commits'),
'header' => pht('Interacting with Commits'),
'object' => new PhabricatorRepositoryCommit(),
'summary' => pht(
'This page documents the commands you can use to interact with '.
'commits and audits in Diffusion.'),
),
);
}
public function getApplicationSearchDocumentTypes() {
return array(
PhabricatorRepositoryCommitPHIDType::TYPECONST,
);
}
}
diff --git a/src/applications/files/application/PhabricatorFilesApplication.php b/src/applications/files/application/PhabricatorFilesApplication.php
index e246d4c90c..4014a6ce62 100644
--- a/src/applications/files/application/PhabricatorFilesApplication.php
+++ b/src/applications/files/application/PhabricatorFilesApplication.php
@@ -1,155 +1,159 @@
<?php
final class PhabricatorFilesApplication extends PhabricatorApplication {
public function getBaseURI() {
return '/file/';
}
public function getName() {
return pht('Files');
}
public function getShortDescription() {
return pht('Store and Share Files');
}
public function getIcon() {
return 'fa-file';
}
public function getTitleGlyph() {
return "\xE2\x87\xAA";
}
public function getFlavorText() {
return pht('Blob store for Pokemon pictures.');
}
public function getApplicationGroup() {
return self::GROUP_UTILITIES;
}
public function canUninstall() {
return false;
}
public function getRemarkupRules() {
return array(
new PhabricatorEmbedFileRemarkupRule(),
new PhabricatorImageRemarkupRule(),
);
}
public function supportsEmailIntegration() {
return true;
}
public function getAppEmailBlurb() {
return pht(
'Send emails with file attachments to these addresses to upload '.
'files. %s',
phutil_tag(
'a',
array(
'href' => $this->getInboundEmailSupportLink(),
),
pht('Learn More')));
}
protected function getCustomCapabilities() {
return array(
FilesDefaultViewCapability::CAPABILITY => array(
'caption' => pht('Default view policy for newly created files.'),
'template' => PhabricatorFileFilePHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_VIEW,
),
);
}
+ public function getMonograms() {
+ return array('F');
+ }
+
public function getRoutes() {
return array(
'/F(?P<id>[1-9]\d*)(?:\$(?P<lines>\d+(?:-\d+)?))?'
=> 'PhabricatorFileViewController',
'/file/' => array(
'(query/(?P<queryKey>[^/]+)/)?' => 'PhabricatorFileListController',
'view/(?P<id>[1-9]\d*)/'.
'(?:(?P<engineKey>[^/]+)/)?'.
'(?:\$(?P<lines>\d+(?:-\d+)?))?'
=> 'PhabricatorFileViewController',
'info/(?P<phid>[^/]+)/' => 'PhabricatorFileViewController',
'upload/' => 'PhabricatorFileUploadController',
'dropupload/' => 'PhabricatorFileDropUploadController',
'compose/' => 'PhabricatorFileComposeController',
'thread/(?P<phid>[^/]+)/' => 'PhabricatorFileLightboxController',
'delete/(?P<id>[1-9]\d*)/' => 'PhabricatorFileDeleteController',
$this->getEditRoutePattern('edit/')
=> 'PhabricatorFileEditController',
'imageproxy/' => 'PhabricatorFileImageProxyController',
'transforms/(?P<id>[1-9]\d*)/' =>
'PhabricatorFileTransformListController',
'uploaddialog/(?P<single>single/)?'
=> 'PhabricatorFileUploadDialogController',
'iconset/(?P<key>[^/]+)/' => array(
'select/' => 'PhabricatorFileIconSetSelectController',
),
'document/(?P<engineKey>[^/]+)/(?P<phid>[^/]+)/'
=> 'PhabricatorFileDocumentController',
'ui/' => array(
'detach/(?P<objectPHID>[^/]+)/(?P<filePHID>[^/]+)/'
=> 'PhabricatorFileDetachController',
'curtain/' => array(
'list/(?P<phid>[^/]+)/'
=> 'PhabricatorFileUICurtainListController',
'attach/(?P<objectPHID>[^/]+)/(?P<filePHID>[^/]+)/'
=> 'PhabricatorFileUICurtainAttachController',
),
),
) + $this->getResourceSubroutes(),
);
}
public function getResourceRoutes() {
return array(
'/file/' => $this->getResourceSubroutes(),
);
}
private function getResourceSubroutes() {
return array(
'(?P<kind>data|download)/'.
'(?:@(?P<instance>[^/]+)/)?'.
'(?P<key>[^/]+)/'.
'(?P<phid>[^/]+)/'.
'(?:(?P<token>[^/]+)/)?'.
'.*'
=> 'PhabricatorFileDataController',
'xform/'.
'(?:@(?P<instance>[^/]+)/)?'.
'(?P<transform>[^/]+)/'.
'(?P<phid>[^/]+)/'.
'(?P<key>[^/]+)/'
=> 'PhabricatorFileTransformController',
);
}
public function getMailCommandObjects() {
return array(
'file' => array(
'name' => pht('Email Commands: Files'),
'header' => pht('Interacting with Files'),
'object' => new PhabricatorFile(),
'summary' => pht(
'This page documents the commands you can use to interact with '.
'files.'),
),
);
}
public function getQuicksandURIPatternBlacklist() {
return array(
'/file/(data|download)/.*',
);
}
}
diff --git a/src/applications/fund/application/PhabricatorFundApplication.php b/src/applications/fund/application/PhabricatorFundApplication.php
index 58ce4f8922..5e2d33c1a4 100644
--- a/src/applications/fund/application/PhabricatorFundApplication.php
+++ b/src/applications/fund/application/PhabricatorFundApplication.php
@@ -1,73 +1,77 @@
<?php
final class PhabricatorFundApplication extends PhabricatorApplication {
public function getName() {
return pht('Fund');
}
public function getBaseURI() {
return '/fund/';
}
public function getShortDescription() {
return pht('Donate');
}
public function getIcon() {
return 'fa-heart';
}
public function getTitleGlyph() {
return "\xE2\x99\xA5";
}
public function getApplicationGroup() {
return self::GROUP_UTILITIES;
}
public function isPrototype() {
return true;
}
public function getRemarkupRules() {
return array(
new FundInitiativeRemarkupRule(),
);
}
+ public function getMonograms() {
+ return array('I');
+ }
+
public function getRoutes() {
return array(
'/I(?P<id>[1-9]\d*)' => 'FundInitiativeViewController',
'/fund/' => array(
'(?:query/(?P<queryKey>[^/]+)/)?' => 'FundInitiativeListController',
'create/' => 'FundInitiativeEditController',
$this->getEditRoutePattern('edit/')
=> 'FundInitiativeEditController',
'close/(?P<id>\d+)/' => 'FundInitiativeCloseController',
'back/(?P<id>\d+)/' => 'FundInitiativeBackController',
'backers/(?:(?P<id>\d+)/)?(?:query/(?P<queryKey>[^/]+)/)?'
=> 'FundBackerListController',
),
);
}
protected function getCustomCapabilities() {
return array(
FundDefaultViewCapability::CAPABILITY => array(
'caption' => pht('Default view policy for newly created initiatives.'),
'template' => FundInitiativePHIDType::TYPECONST,
),
FundCreateInitiativesCapability::CAPABILITY => array(
'default' => PhabricatorPolicies::POLICY_ADMIN,
),
);
}
public function getApplicationSearchDocumentTypes() {
return array(
FundInitiativePHIDType::TYPECONST,
);
}
}
diff --git a/src/applications/harbormaster/application/PhabricatorHarbormasterApplication.php b/src/applications/harbormaster/application/PhabricatorHarbormasterApplication.php
index 6c499bf63a..7de2a658c2 100644
--- a/src/applications/harbormaster/application/PhabricatorHarbormasterApplication.php
+++ b/src/applications/harbormaster/application/PhabricatorHarbormasterApplication.php
@@ -1,126 +1,130 @@
<?php
final class PhabricatorHarbormasterApplication extends PhabricatorApplication {
public function getBaseURI() {
return '/harbormaster/';
}
public function getName() {
return pht('Harbormaster');
}
public function getShortDescription() {
return pht('Build/CI');
}
public function getIcon() {
return 'fa-ship';
}
public function getTitleGlyph() {
return "\xE2\x99\xBB";
}
public function getFlavorText() {
return pht('Ship Some Freight');
}
public function getApplicationGroup() {
return self::GROUP_UTILITIES;
}
public function getEventListeners() {
return array(
new HarbormasterUIEventListener(),
);
}
public function getRemarkupRules() {
return array(
new HarbormasterRemarkupRule(),
);
}
public function getHelpDocumentationArticles(PhabricatorUser $viewer) {
return array(
array(
'name' => pht('Harbormaster User Guide'),
'href' => PhabricatorEnv::getDoclink('Harbormaster User Guide'),
),
);
}
+ public function getMonograms() {
+ return array('B');
+ }
+
public function getRoutes() {
return array(
'/B(?P<id>[1-9]\d*)' => 'HarbormasterBuildableViewController',
'/harbormaster/' => array(
'(?:query/(?P<queryKey>[^/]+)/)?'
=> 'HarbormasterBuildableListController',
'step/' => array(
'add/(?:(?P<id>\d+)/)?' => 'HarbormasterStepAddController',
'new/(?P<plan>\d+)/(?P<class>[^/]+)/'
=> 'HarbormasterStepEditController',
'view/(?P<id>\d+)/' => 'HarbormasterStepViewController',
'edit/(?:(?P<id>\d+)/)?' => 'HarbormasterStepEditController',
'delete/(?:(?P<id>\d+)/)?' => 'HarbormasterStepDeleteController',
),
'buildable/' => array(
'(?P<id>\d+)/(?P<action>pause|resume|restart|abort)/'
=> 'HarbormasterBuildableActionController',
),
'build/' => array(
$this->getQueryRoutePattern() => 'HarbormasterBuildListController',
'(?P<id>\d+)/(?:(?P<generation>\d+)/)?'
=> 'HarbormasterBuildViewController',
'(?P<action>pause|resume|restart|abort)/'.
'(?P<id>\d+)/(?:(?P<via>[^/]+)/)?'
=> 'HarbormasterBuildActionController',
),
'plan/' => array(
$this->getQueryRoutePattern() => 'HarbormasterPlanListController',
$this->getEditRoutePattern('edit/')
=> 'HarbormasterPlanEditController',
'disable/(?P<id>\d+)/' => 'HarbormasterPlanDisableController',
'behavior/(?P<id>\d+)/(?P<behaviorKey>[^/]+)/' =>
'HarbormasterPlanBehaviorController',
'run/(?P<id>\d+)/' => 'HarbormasterPlanRunController',
'(?P<id>\d+)/' => 'HarbormasterPlanViewController',
),
'unit/' => array(
'(?P<id>\d+)/' => 'HarbormasterUnitMessageListController',
'view/(?P<id>\d+)/' => 'HarbormasterUnitMessageViewController',
),
'lint/' => array(
'(?P<id>\d+)/' => 'HarbormasterLintMessagesController',
),
'hook/(?P<handler>[^/]+)/' => 'HarbormasterHookController',
'log/' => array(
'view/(?P<id>\d+)/(?:\$(?P<lines>\d+(?:-\d+)?))?'
=> 'HarbormasterBuildLogViewController',
'render/(?P<id>\d+)/(?:\$(?P<lines>\d+(?:-\d+)?))?'
=> 'HarbormasterBuildLogRenderController',
'download/(?P<id>\d+)/' => 'HarbormasterBuildLogDownloadController',
),
),
);
}
protected function getCustomCapabilities() {
return array(
HarbormasterCreatePlansCapability::CAPABILITY => array(
'default' => PhabricatorPolicies::POLICY_ADMIN,
),
HarbormasterBuildPlanDefaultViewCapability::CAPABILITY => array(
'template' => HarbormasterBuildPlanPHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_VIEW,
),
HarbormasterBuildPlanDefaultEditCapability::CAPABILITY => array(
'template' => HarbormasterBuildPlanPHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_EDIT,
'default' => PhabricatorPolicies::POLICY_ADMIN,
),
);
}
}
diff --git a/src/applications/herald/application/PhabricatorHeraldApplication.php b/src/applications/herald/application/PhabricatorHeraldApplication.php
index 0de1c02737..7808820818 100644
--- a/src/applications/herald/application/PhabricatorHeraldApplication.php
+++ b/src/applications/herald/application/PhabricatorHeraldApplication.php
@@ -1,94 +1,98 @@
<?php
final class PhabricatorHeraldApplication extends PhabricatorApplication {
public function getBaseURI() {
return '/herald/';
}
public function getIcon() {
return 'fa-bullhorn';
}
public function getName() {
return pht('Herald');
}
public function getShortDescription() {
return pht('Create Notification Rules');
}
public function getTitleGlyph() {
return "\xE2\x98\xBF";
}
public function getHelpDocumentationArticles(PhabricatorUser $viewer) {
return array(
array(
'name' => pht('Herald User Guide'),
'href' => PhabricatorEnv::getDoclink('Herald User Guide'),
),
array(
'name' => pht('User Guide: Webhooks'),
'href' => PhabricatorEnv::getDoclink('User Guide: Webhooks'),
),
);
}
public function getFlavorText() {
return pht('Watch for danger!');
}
public function getApplicationGroup() {
return self::GROUP_UTILITIES;
}
public function getRemarkupRules() {
return array(
new HeraldRemarkupRule(),
);
}
+ public function getMonograms() {
+ return array('H');
+ }
+
public function getRoutes() {
return array(
'/H(?P<id>[1-9]\d*)' => 'HeraldRuleViewController',
'/herald/' => array(
'(?:query/(?P<queryKey>[^/]+)/)?' => 'HeraldRuleListController',
'new/' => 'HeraldNewController',
'create/' => 'HeraldNewController',
'edit/(?:(?P<id>[1-9]\d*)/)?' => 'HeraldRuleController',
'disable/(?P<id>[1-9]\d*)/(?P<action>[^/]+)/'
=> 'HeraldDisableController',
'test/' => 'HeraldTestConsoleController',
'transcript/' => array(
'' => 'HeraldTranscriptListController',
'(?:query/(?P<queryKey>[^/]+)/)?' => 'HeraldTranscriptListController',
'(?P<id>[1-9]\d*)/(?:(?P<view>[^/]+)/)?'
=> 'HeraldTranscriptController',
),
'webhook/' => array(
$this->getQueryRoutePattern() => 'HeraldWebhookListController',
'view/(?P<id>\d+)/(?:request/(?P<requestID>[^/]+)/)?' =>
'HeraldWebhookViewController',
$this->getEditRoutePattern('edit/') => 'HeraldWebhookEditController',
'test/(?P<id>\d+)/' => 'HeraldWebhookTestController',
'key/(?P<action>view|cycle)/(?P<id>\d+)/' =>
'HeraldWebhookKeyController',
),
),
);
}
protected function getCustomCapabilities() {
return array(
HeraldManageGlobalRulesCapability::CAPABILITY => array(
'caption' => pht('Global rules can bypass access controls.'),
'default' => PhabricatorPolicies::POLICY_ADMIN,
),
HeraldCreateWebhooksCapability::CAPABILITY => array(
'default' => PhabricatorPolicies::POLICY_ADMIN,
),
);
}
}
diff --git a/src/applications/legalpad/application/PhabricatorLegalpadApplication.php b/src/applications/legalpad/application/PhabricatorLegalpadApplication.php
index a3eaff5792..47a8f4ebef 100644
--- a/src/applications/legalpad/application/PhabricatorLegalpadApplication.php
+++ b/src/applications/legalpad/application/PhabricatorLegalpadApplication.php
@@ -1,102 +1,106 @@
<?php
final class PhabricatorLegalpadApplication extends PhabricatorApplication {
public function getBaseURI() {
return '/legalpad/';
}
public function getName() {
return pht('Legalpad');
}
public function getShortDescription() {
return pht('Agreements and Signatures');
}
public function getIcon() {
return 'fa-gavel';
}
public function getTitleGlyph() {
return "\xC2\xA9";
}
public function getApplicationGroup() {
return self::GROUP_UTILITIES;
}
public function getRemarkupRules() {
return array(
new LegalpadDocumentRemarkupRule(),
);
}
public function getHelpDocumentationArticles(PhabricatorUser $viewer) {
return array(
array(
'name' => pht('Legalpad User Guide'),
'href' => PhabricatorEnv::getDoclink('Legalpad User Guide'),
),
);
}
public function getOverview() {
return pht(
'**Legalpad** is a simple application for tracking signatures and '.
'legal agreements. At the moment, it is primarily intended to help '.
'open source projects keep track of Contributor License Agreements.');
}
+ public function getMonograms() {
+ return array('L');
+ }
+
public function getRoutes() {
return array(
'/L(?P<id>\d+)' => 'LegalpadDocumentSignController',
'/legalpad/' => array(
'' => 'LegalpadDocumentListController',
'(?:query/(?P<queryKey>[^/]+)/)?'
=> 'LegalpadDocumentListController',
$this->getEditRoutePattern('edit/')
=> 'LegalpadDocumentEditController',
'view/(?P<id>\d+)/' => 'LegalpadDocumentManageController',
'done/' => 'LegalpadDocumentDoneController',
'verify/(?P<code>[^/]+)/'
=> 'LegalpadDocumentSignatureVerificationController',
'signatures/(?:(?P<id>\d+)/)?(?:query/(?P<queryKey>[^/]+)/)?'
=> 'LegalpadDocumentSignatureListController',
'addsignature/(?P<id>\d+)/' => 'LegalpadDocumentSignatureAddController',
'signature/(?P<id>\d+)/' => 'LegalpadDocumentSignatureViewController',
'document/' => array(
'preview/' => 'PhabricatorMarkupPreviewController',
),
),
);
}
protected function getCustomCapabilities() {
return array(
LegalpadCreateDocumentsCapability::CAPABILITY => array(),
LegalpadDefaultViewCapability::CAPABILITY => array(
'template' => PhabricatorLegalpadDocumentPHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_VIEW,
),
LegalpadDefaultEditCapability::CAPABILITY => array(
'template' => PhabricatorLegalpadDocumentPHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_EDIT,
),
);
}
public function getMailCommandObjects() {
return array(
'document' => array(
'name' => pht('Email Commands: Legalpad Documents'),
'header' => pht('Interacting with Legalpad Documents'),
'object' => new LegalpadDocument(),
'summary' => pht(
'This page documents the commands you can use to interact with '.
'documents in Legalpad.'),
),
);
}
}
diff --git a/src/applications/maniphest/application/PhabricatorManiphestApplication.php b/src/applications/maniphest/application/PhabricatorManiphestApplication.php
index 8ed20416bb..9296060d81 100644
--- a/src/applications/maniphest/application/PhabricatorManiphestApplication.php
+++ b/src/applications/maniphest/application/PhabricatorManiphestApplication.php
@@ -1,113 +1,117 @@
<?php
final class PhabricatorManiphestApplication extends PhabricatorApplication {
public function getName() {
return pht('Maniphest');
}
public function getShortDescription() {
return pht('Tasks and Bugs');
}
public function getBaseURI() {
return '/maniphest/';
}
public function getIcon() {
return 'fa-anchor';
}
public function getTitleGlyph() {
return "\xE2\x9A\x93";
}
public function isPinnedByDefault(PhabricatorUser $viewer) {
return true;
}
public function getApplicationOrder() {
return 0.110;
}
public function getFactObjectsForAnalysis() {
return array(
new ManiphestTask(),
);
}
public function getRemarkupRules() {
return array(
new ManiphestRemarkupRule(),
);
}
+ public function getMonograms() {
+ return array('T');
+ }
+
public function getRoutes() {
return array(
'/T(?P<id>[1-9]\d*)' => 'ManiphestTaskDetailController',
'/maniphest/' => array(
$this->getQueryRoutePattern() => 'ManiphestTaskListController',
'report/(?:(?P<view>\w+)/)?' => 'ManiphestReportController',
$this->getBulkRoutePattern('bulk/') => 'ManiphestBulkEditController',
'task/' => array(
$this->getEditRoutePattern('edit/')
=> 'ManiphestTaskEditController',
'subtask/(?P<id>[1-9]\d*)/' => 'ManiphestTaskSubtaskController',
),
'graph/(?P<id>[1-9]\d*)/' => 'ManiphestTaskGraphController',
),
);
}
public function supportsEmailIntegration() {
return true;
}
public function getAppEmailBlurb() {
return pht(
'Send email to these addresses to create tasks. %s',
phutil_tag(
'a',
array(
'href' => $this->getInboundEmailSupportLink(),
),
pht('Learn More')));
}
protected function getCustomCapabilities() {
return array(
ManiphestDefaultViewCapability::CAPABILITY => array(
'caption' => pht('Default view policy for newly created tasks.'),
'template' => ManiphestTaskPHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_VIEW,
),
ManiphestDefaultEditCapability::CAPABILITY => array(
'caption' => pht('Default edit policy for newly created tasks.'),
'template' => ManiphestTaskPHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_EDIT,
),
ManiphestBulkEditCapability::CAPABILITY => array(),
);
}
public function getMailCommandObjects() {
return array(
'task' => array(
'name' => pht('Email Commands: Tasks'),
'header' => pht('Interacting with Maniphest Tasks'),
'object' => new ManiphestTask(),
'summary' => pht(
'This page documents the commands you can use to interact with '.
'tasks in Maniphest. These commands work when creating new tasks '.
'via email and when replying to existing tasks.'),
),
);
}
public function getApplicationSearchDocumentTypes() {
return array(
ManiphestTaskPHIDType::TYPECONST,
);
}
}
diff --git a/src/applications/meta/controller/PhabricatorApplicationDetailViewController.php b/src/applications/meta/controller/PhabricatorApplicationDetailViewController.php
index 8cceeb7396..1bf6734db3 100644
--- a/src/applications/meta/controller/PhabricatorApplicationDetailViewController.php
+++ b/src/applications/meta/controller/PhabricatorApplicationDetailViewController.php
@@ -1,214 +1,259 @@
<?php
final class PhabricatorApplicationDetailViewController
extends PhabricatorApplicationsController {
public function shouldAllowPublic() {
return true;
}
public function handleRequest(AphrontRequest $request) {
$viewer = $this->getViewer();
$application = $request->getURIData('application');
$selected = id(new PhabricatorApplicationQuery())
->setViewer($viewer)
->withClasses(array($application))
->executeOne();
if (!$selected) {
return new Aphront404Response();
}
$title = $selected->getName();
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($selected->getName());
$crumbs->setBorder(true);
$header = id(new PHUIHeaderView())
->setHeader($title)
->setUser($viewer)
->setPolicyObject($selected)
->setHeaderIcon($selected->getIcon());
if ($selected->isInstalled()) {
$header->setStatus('fa-check', 'bluegrey', pht('Installed'));
} else {
$header->setStatus('fa-ban', 'dark', pht('Uninstalled'));
}
+ if (!$selected->isFirstParty()) {
+ $header->addTag(id(new PHUITagView())
+ ->setName('Extension')
+ ->setIcon('fa-plug')
+ ->setColor(PHUITagView::COLOR_INDIGO)
+ ->setType(PHUITagView::TYPE_SHADE));
+ }
+
+ if ($selected->isPrototype()) {
+ $header->addTag(id(new PHUITagView())
+ ->setName('Prototype')
+ ->setIcon('fa-exclamation-circle')
+ ->setColor(PHUITagView::COLOR_ORANGE)
+ ->setType(PHUITagView::TYPE_SHADE));
+ }
+
+ if ($selected->isDeprecated()) {
+ $header->addTag(id(new PHUITagView())
+ ->setName('Deprecated')
+ ->setIcon('fa-exclamation-triangle')
+ ->setColor(PHUITagView::COLOR_RED)
+ ->setType(PHUITagView::TYPE_SHADE));
+ }
+
$timeline = $this->buildTransactionTimeline(
$selected,
new PhabricatorApplicationApplicationTransactionQuery());
$timeline->setShouldTerminate(true);
$curtain = $this->buildCurtain($selected);
$details = $this->buildPropertySectionView($selected);
$policies = $this->buildPolicyView($selected);
$configs =
PhabricatorApplicationConfigurationPanel::loadAllPanelsForApplication(
$selected);
$panels = array();
foreach ($configs as $config) {
$config->setViewer($viewer);
$config->setApplication($selected);
$panel = $config->buildConfigurationPagePanel();
$panel->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
$panels[] = $panel;
}
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setCurtain($curtain)
->setMainColumn(array(
$policies,
$panels,
$timeline,
))
->addPropertySection(pht('Details'), $details);
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->appendChild(
array(
$view,
));
}
private function buildPropertySectionView(
PhabricatorApplication $application) {
$viewer = $this->getViewer();
$properties = id(new PHUIPropertyListView());
$properties->addProperty(
pht('Description'),
$application->getShortDescription());
if ($application->getFlavorText()) {
$properties->addProperty(
null,
phutil_tag('em', array(), $application->getFlavorText()));
}
+ $phids = PhabricatorPHIDType::getAllTypesForApplication(
+ get_class($application));
+
+ $user_friendly_phids = array();
+ foreach ($phids as $phid => $type) {
+ $user_friendly_phids[] = "PHID-{$phid} ({$type->getTypeName()})";
+ }
+
+ if ($user_friendly_phids) {
+ $properties->addProperty(
+ 'PHIDs',
+ phutil_implode_html(phutil_tag('br'), $user_friendly_phids));
+ }
+
+ $monograms = $application->getMonograms();
+ if ($monograms) {
+ $properties->addProperty(
+ 'Monograms',
+ phutil_implode_html(', ', $monograms));
+ }
+
if ($application->isPrototype()) {
$proto_href = PhabricatorEnv::getDoclink(
'User Guide: Prototype Applications');
$learn_more = phutil_tag(
'a',
array(
'href' => $proto_href,
'target' => '_blank',
),
pht('Learn More'));
$properties->addProperty(
pht('Prototype'),
pht(
'This application is a prototype. %s',
$learn_more));
}
$overview = $application->getOverview();
if (phutil_nonempty_string($overview)) {
$overview = new PHUIRemarkupView($viewer, $overview);
$properties->addSectionHeader(
pht('Overview'), PHUIPropertyListView::ICON_SUMMARY);
$properties->addTextContent($overview);
}
return $properties;
}
private function buildPolicyView(
PhabricatorApplication $application) {
$viewer = $this->getViewer();
$properties = id(new PHUIPropertyListView());
$header = id(new PHUIHeaderView())
->setHeader(pht('Policies'));
$descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions(
$viewer,
$application);
foreach ($application->getCapabilities() as $capability) {
$properties->addProperty(
$application->getCapabilityLabel($capability),
idx($descriptions, $capability));
}
return id(new PHUIObjectBoxView())
->setHeader($header)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($properties);
}
private function buildCurtain(PhabricatorApplication $application) {
$viewer = $this->getViewer();
$can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer,
$application,
PhabricatorPolicyCapability::CAN_EDIT);
$key = get_class($application);
$edit_uri = $this->getApplicationURI("edit/{$key}/");
$install_uri = $this->getApplicationURI("{$key}/install/");
$uninstall_uri = $this->getApplicationURI("{$key}/uninstall/");
$curtain = $this->newCurtainView($application);
$curtain->addAction(
id(new PhabricatorActionView())
->setName(pht('Edit Policies'))
->setIcon('fa-pencil')
->setDisabled(!$can_edit)
->setWorkflow(!$can_edit)
->setHref($edit_uri));
if ($application->canUninstall()) {
if ($application->isInstalled()) {
$curtain->addAction(
id(new PhabricatorActionView())
->setName(pht('Uninstall'))
->setIcon('fa-times')
->setDisabled(!$can_edit)
->setWorkflow(true)
->setHref($uninstall_uri));
} else {
$action = id(new PhabricatorActionView())
->setName(pht('Install'))
->setIcon('fa-plus')
->setDisabled(!$can_edit)
->setWorkflow(true)
->setHref($install_uri);
$prototypes_enabled = PhabricatorEnv::getEnvConfig(
'phabricator.show-prototypes');
if ($application->isPrototype() && !$prototypes_enabled) {
$action->setDisabled(true);
}
$curtain->addAction($action);
}
} else {
$curtain->addAction(
id(new PhabricatorActionView())
->setName(pht('Uninstall'))
->setIcon('fa-times')
->setWorkflow(true)
->setDisabled(true)
->setHref($uninstall_uri));
}
return $curtain;
}
}
diff --git a/src/applications/meta/query/PhabricatorAppSearchEngine.php b/src/applications/meta/query/PhabricatorAppSearchEngine.php
index e68570fe1c..08283afc2e 100644
--- a/src/applications/meta/query/PhabricatorAppSearchEngine.php
+++ b/src/applications/meta/query/PhabricatorAppSearchEngine.php
@@ -1,276 +1,286 @@
<?php
final class PhabricatorAppSearchEngine
extends PhabricatorApplicationSearchEngine {
public function getResultTypeDescription() {
return pht('Applications');
}
public function getApplicationClassName() {
return 'PhabricatorApplicationsApplication';
}
public function getPageSize(PhabricatorSavedQuery $saved) {
return INF;
}
public function buildSavedQueryFromRequest(AphrontRequest $request) {
$saved = new PhabricatorSavedQuery();
$saved->setParameter('name', $request->getStr('name'));
$saved->setParameter(
'installed',
$this->readBoolFromRequest($request, 'installed'));
$saved->setParameter(
'prototypes',
$this->readBoolFromRequest($request, 'prototypes'));
$saved->setParameter(
'firstParty',
$this->readBoolFromRequest($request, 'firstParty'));
$saved->setParameter(
'launchable',
$this->readBoolFromRequest($request, 'launchable'));
$saved->setParameter(
'appemails',
$this->readBoolFromRequest($request, 'appemails'));
return $saved;
}
public function buildQueryFromSavedQuery(PhabricatorSavedQuery $saved) {
$query = id(new PhabricatorApplicationQuery())
->setOrder(PhabricatorApplicationQuery::ORDER_NAME)
->withUnlisted(false);
$name = $saved->getParameter('name');
if (phutil_nonempty_string($name)) {
$query->withNameContains($name);
}
$installed = $saved->getParameter('installed');
if ($installed !== null) {
$query->withInstalled($installed);
}
$prototypes = $saved->getParameter('prototypes');
if ($prototypes === null) {
// NOTE: This is the old name of the 'prototypes' option, see T6084.
$prototypes = $saved->getParameter('beta');
$saved->setParameter('prototypes', $prototypes);
}
if ($prototypes !== null) {
$query->withPrototypes($prototypes);
}
$first_party = $saved->getParameter('firstParty');
if ($first_party !== null) {
$query->withFirstParty($first_party);
}
$launchable = $saved->getParameter('launchable');
if ($launchable !== null) {
$query->withLaunchable($launchable);
}
$appemails = $saved->getParameter('appemails');
if ($appemails !== null) {
$query->withApplicationEmailSupport($appemails);
}
return $query;
}
public function buildSearchForm(
AphrontFormView $form,
PhabricatorSavedQuery $saved) {
$form
->appendChild(
id(new AphrontFormTextControl())
->setLabel(pht('Name Contains'))
->setName('name')
->setValue($saved->getParameter('name')))
->appendChild(
id(new AphrontFormSelectControl())
->setLabel(pht('Installed'))
->setName('installed')
->setValue($this->getBoolFromQuery($saved, 'installed'))
->setOptions(
array(
'' => pht('Show All Applications'),
'true' => pht('Show Installed Applications'),
'false' => pht('Show Uninstalled Applications'),
)))
->appendChild(
id(new AphrontFormSelectControl())
->setLabel(pht('Prototypes'))
->setName('prototypes')
->setValue($this->getBoolFromQuery($saved, 'prototypes'))
->setOptions(
array(
'' => pht('Show All Applications'),
'true' => pht('Show Prototype Applications'),
'false' => pht('Show Released Applications'),
)))
->appendChild(
id(new AphrontFormSelectControl())
->setLabel(pht('Provenance'))
->setName('firstParty')
->setValue($this->getBoolFromQuery($saved, 'firstParty'))
->setOptions(
array(
'' => pht('Show All Applications'),
'true' => pht('Show First-Party Applications'),
'false' => pht('Show Third-Party Applications'),
)))
->appendChild(
id(new AphrontFormSelectControl())
->setLabel(pht('Launchable'))
->setName('launchable')
->setValue($this->getBoolFromQuery($saved, 'launchable'))
->setOptions(
array(
'' => pht('Show All Applications'),
'true' => pht('Show Launchable Applications'),
'false' => pht('Show Non-Launchable Applications'),
)))
->appendChild(
id(new AphrontFormSelectControl())
->setLabel(pht('Application Emails'))
->setName('appemails')
->setValue($this->getBoolFromQuery($saved, 'appemails'))
->setOptions(
array(
'' => pht('Show All Applications'),
'true' => pht('Show Applications w/ App Email Support'),
'false' => pht('Show Applications w/o App Email Support'),
)));
}
protected function getURI($path) {
return '/applications/'.$path;
}
protected function getBuiltinQueryNames() {
return array(
'launcher' => pht('Launcher'),
'all' => pht('All Applications'),
);
}
public function buildSavedQueryFromBuiltin($query_key) {
$query = $this->newSavedQuery();
$query->setQueryKey($query_key);
switch ($query_key) {
case 'launcher':
return $query
->setParameter('installed', true)
->setParameter('launchable', true);
case 'all':
return $query;
}
return parent::buildSavedQueryFromBuiltin($query_key);
}
protected function renderResultList(
array $all_applications,
PhabricatorSavedQuery $query,
array $handle) {
assert_instances_of($all_applications, 'PhabricatorApplication');
$all_applications = msort($all_applications, 'getName');
if ($query->getQueryKey() == 'launcher') {
$groups = mgroup($all_applications, 'getApplicationGroup');
} else {
$groups = array($all_applications);
}
$group_names = PhabricatorApplication::getApplicationGroups();
$groups = array_select_keys($groups, array_keys($group_names)) + $groups;
$results = array();
foreach ($groups as $group => $applications) {
if (count($groups) > 1) {
$results[] = phutil_tag(
'h1',
array(
'class' => 'phui-oi-list-header',
),
idx($group_names, $group, $group));
}
$list = new PHUIObjectItemListView();
foreach ($applications as $application) {
$icon = $application->getIcon();
if (!$icon) {
$icon = 'application';
}
$description = $application->getShortDescription();
$configure = id(new PHUIButtonView())
->setTag('a')
->setIcon('fa-gears')
->setHref('/applications/view/'.get_class($application).'/')
->setText(pht('Configure'))
->setColor(PHUIButtonView::GREY);
$name = $application->getName();
$item = id(new PHUIObjectItemView())
->setHeader($name)
->setImageIcon($icon)
->setSideColumn($configure);
if (!$application->isFirstParty()) {
- $tag = id(new PHUITagView())
+ $extension_tag = id(new PHUITagView())
->setName(pht('Extension'))
- ->setIcon('fa-puzzle-piece')
- ->setColor(PHUITagView::COLOR_BLUE)
+ ->setIcon('fa-plug')
+ ->setColor(PHUITagView::COLOR_INDIGO)
->setType(PHUITagView::TYPE_SHADE)
->setSlimShady(true);
- $item->addAttribute($tag);
+ $item->addAttribute($extension_tag);
}
if ($application->isPrototype()) {
$prototype_tag = id(new PHUITagView())
->setName(pht('Prototype'))
->setIcon('fa-exclamation-circle')
->setColor(PHUITagView::COLOR_ORANGE)
->setType(PHUITagView::TYPE_SHADE)
->setSlimShady(true);
$item->addAttribute($prototype_tag);
}
+ if ($application->isDeprecated()) {
+ $deprecated_tag = id(new PHUITagView())
+ ->setName(pht('Deprecated'))
+ ->setIcon('fa-exclamation-triangle')
+ ->setColor(PHUITagView::COLOR_RED)
+ ->setType(PHUITagView::TYPE_SHADE)
+ ->setSlimShady(true);
+ $item->addAttribute($deprecated_tag);
+ }
+
$item->addAttribute($description);
if ($application->getBaseURI() && $application->isInstalled()) {
$item->setHref($application->getBaseURI());
}
if (!$application->isInstalled()) {
$item->addAttribute(pht('Uninstalled'));
$item->setDisabled(true);
}
$list->addItem($item);
}
$results[] = $list;
}
$result = new PhabricatorApplicationSearchResultView();
$result->setContent($results);
return $result;
}
}
diff --git a/src/applications/owners/application/PhabricatorOwnersApplication.php b/src/applications/owners/application/PhabricatorOwnersApplication.php
index 3ef5f974d9..34bbc4b7b5 100644
--- a/src/applications/owners/application/PhabricatorOwnersApplication.php
+++ b/src/applications/owners/application/PhabricatorOwnersApplication.php
@@ -1,78 +1,82 @@
<?php
final class PhabricatorOwnersApplication extends PhabricatorApplication {
public function getName() {
return pht('Owners');
}
public function getBaseURI() {
return '/owners/';
}
public function getIcon() {
return 'fa-gift';
}
public function getShortDescription() {
return pht('Own Source Code');
}
public function getTitleGlyph() {
return "\xE2\x98\x81";
}
public function getHelpDocumentationArticles(PhabricatorUser $viewer) {
return array(
array(
'name' => pht('Owners User Guide'),
'href' => PhabricatorEnv::getDoclink('Owners User Guide'),
),
);
}
public function getFlavorText() {
return pht('Adopt today!');
}
public function getApplicationGroup() {
return self::GROUP_UTILITIES;
}
public function getRemarkupRules() {
return array(
new PhabricatorOwnersPackageRemarkupRule(),
);
}
+ public function getMonograms() {
+ return array('O');
+ }
+
public function getRoutes() {
return array(
'/owners/' => array(
'(?:query/(?P<queryKey>[^/]+)/)?' => 'PhabricatorOwnersListController',
'new/' => 'PhabricatorOwnersEditController',
'package/(?P<id>[1-9]\d*)/' => 'PhabricatorOwnersDetailController',
'archive/(?P<id>[1-9]\d*)/' => 'PhabricatorOwnersArchiveController',
'paths/(?P<id>[1-9]\d*)/' => 'PhabricatorOwnersPathsController',
$this->getEditRoutePattern('edit/')
=> 'PhabricatorOwnersEditController',
),
);
}
protected function getCustomCapabilities() {
return array(
PhabricatorOwnersDefaultViewCapability::CAPABILITY => array(
'caption' => pht('Default view policy for newly created packages.'),
'template' => PhabricatorOwnersPackagePHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_VIEW,
),
PhabricatorOwnersDefaultEditCapability::CAPABILITY => array(
'caption' => pht('Default edit policy for newly created packages.'),
'template' => PhabricatorOwnersPackagePHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_EDIT,
),
);
}
}
diff --git a/src/applications/passphrase/application/PhabricatorPassphraseApplication.php b/src/applications/passphrase/application/PhabricatorPassphraseApplication.php
index 2ab4f1e33d..ae79e5c8b5 100644
--- a/src/applications/passphrase/application/PhabricatorPassphraseApplication.php
+++ b/src/applications/passphrase/application/PhabricatorPassphraseApplication.php
@@ -1,86 +1,90 @@
<?php
final class PhabricatorPassphraseApplication extends PhabricatorApplication {
public function getName() {
return pht('Passphrase');
}
public function getBaseURI() {
return '/passphrase/';
}
public function getShortDescription() {
return pht('Credential Store');
}
public function getIcon() {
return 'fa-user-secret';
}
public function getTitleGlyph() {
return "\xE2\x97\x88";
}
public function getFlavorText() {
return pht('Put your secrets in a lockbox.');
}
public function getApplicationGroup() {
return self::GROUP_UTILITIES;
}
public function canUninstall() {
return false;
}
+ public function getMonograms() {
+ return array('K');
+ }
+
public function getRoutes() {
return array(
'/K(?P<id>\d+)' => 'PassphraseCredentialViewController',
'/passphrase/' => array(
'(?:query/(?P<queryKey>[^/]+)/)?'
=> 'PassphraseCredentialListController',
'create/' => 'PassphraseCredentialCreateController',
'edit/(?:(?P<id>\d+)/)?' => 'PassphraseCredentialEditController',
'destroy/(?P<id>\d+)/' => 'PassphraseCredentialDestroyController',
'reveal/(?P<id>\d+)/' => 'PassphraseCredentialRevealController',
'public/(?P<id>\d+)/' => 'PassphraseCredentialPublicController',
'lock/(?P<id>\d+)/' => 'PassphraseCredentialLockController',
'conduit/(?P<id>\d+)/' => 'PassphraseCredentialConduitController',
),
);
}
public function getRemarkupRules() {
return array(
new PassphraseRemarkupRule(),
);
}
public function getApplicationSearchDocumentTypes() {
return array(
PassphraseCredentialPHIDType::TYPECONST,
);
}
protected function getCustomCapabilities() {
$policy_key = id(new PassphraseCredentialAuthorPolicyRule())
->getObjectPolicyFullKey();
return array(
PassphraseDefaultViewCapability::CAPABILITY => array(
'caption' => pht('Default view policy for newly created credentials.'),
'template' => PassphraseCredentialPHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_VIEW,
'default' => $policy_key,
),
PassphraseDefaultEditCapability::CAPABILITY => array(
'caption' => pht('Default edit policy for newly created credentials.'),
'template' => PassphraseCredentialPHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_EDIT,
'default' => $policy_key,
),
);
}
}
diff --git a/src/applications/paste/application/PhabricatorPasteApplication.php b/src/applications/paste/application/PhabricatorPasteApplication.php
index 26e4b1740e..f6b6f7cf65 100644
--- a/src/applications/paste/application/PhabricatorPasteApplication.php
+++ b/src/applications/paste/application/PhabricatorPasteApplication.php
@@ -1,91 +1,95 @@
<?php
final class PhabricatorPasteApplication extends PhabricatorApplication {
public function getName() {
return pht('Paste');
}
public function getBaseURI() {
return '/paste/';
}
public function getIcon() {
return 'fa-paste';
}
public function getTitleGlyph() {
return "\xE2\x9C\x8E";
}
public function getApplicationGroup() {
return self::GROUP_UTILITIES;
}
public function getShortDescription() {
return pht('Share Text Snippets');
}
public function getRemarkupRules() {
return array(
new PhabricatorPasteRemarkupRule(),
);
}
+ public function getMonograms() {
+ return array('P');
+ }
+
public function getRoutes() {
return array(
'/P(?P<id>[1-9]\d*)(?:\$(?P<lines>\d+(?:-\d+)?))?'
=> 'PhabricatorPasteViewController',
'/paste/' => array(
'(query/(?P<queryKey>[^/]+)/)?' => 'PhabricatorPasteListController',
$this->getEditRoutePattern('edit/') => 'PhabricatorPasteEditController',
'raw/(?P<id>[1-9]\d*)/' => 'PhabricatorPasteRawController',
'archive/(?P<id>[1-9]\d*)/' => 'PhabricatorPasteArchiveController',
),
);
}
public function supportsEmailIntegration() {
return true;
}
public function getAppEmailBlurb() {
return pht(
'Send email to these addresses to create pastes. %s',
phutil_tag(
'a',
array(
'href' => $this->getInboundEmailSupportLink(),
),
pht('Learn More')));
}
protected function getCustomCapabilities() {
return array(
PasteDefaultViewCapability::CAPABILITY => array(
'caption' => pht('Default view policy for newly created pastes.'),
'template' => PhabricatorPastePastePHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_VIEW,
),
PasteDefaultEditCapability::CAPABILITY => array(
'caption' => pht('Default edit policy for newly created pastes.'),
'template' => PhabricatorPastePastePHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_EDIT,
),
);
}
public function getMailCommandObjects() {
return array(
'paste' => array(
'name' => pht('Email Commands: Pastes'),
'header' => pht('Interacting with Pastes'),
'object' => new PhabricatorPaste(),
'summary' => pht(
'This page documents the commands you can use to interact with '.
'pastes.'),
),
);
}
}
diff --git a/src/applications/phame/application/PhabricatorPhameApplication.php b/src/applications/phame/application/PhabricatorPhameApplication.php
index cd2eb4b487..b030673d1f 100644
--- a/src/applications/phame/application/PhabricatorPhameApplication.php
+++ b/src/applications/phame/application/PhabricatorPhameApplication.php
@@ -1,112 +1,116 @@
<?php
final class PhabricatorPhameApplication extends PhabricatorApplication {
public function getName() {
return pht('Phame');
}
public function getBaseURI() {
return '/phame/';
}
public function getIcon() {
return 'fa-feed';
}
public function getShortDescription() {
return pht('Internal and External Blogs');
}
public function getTitleGlyph() {
return "\xe2\x9c\xa9";
}
public function getHelpDocumentationArticles(PhabricatorUser $viewer) {
return array(
array(
'name' => pht('Phame User Guide'),
'href' => PhabricatorEnv::getDoclink('Phame User Guide'),
),
);
}
+ public function getMonograms() {
+ return array('J');
+ }
+
public function getRoutes() {
return array(
'/J(?P<id>[1-9]\d*)' => 'PhamePostViewController',
'/phame/' => array(
'' => 'PhameHomeController',
// NOTE: The live routes include an initial "/", so leave it off
// this route.
'(?P<live>live)/(?P<blogID>\d+)' => $this->getLiveRoutes(),
'post/' => array(
'(?:query/(?P<queryKey>[^/]+)/)?' => 'PhamePostListController',
'blogger/(?P<bloggername>[\w\.-_]+)/' => 'PhamePostListController',
$this->getEditRoutePattern('edit/')
=> 'PhamePostEditController',
'history/(?P<id>\d+)/' => 'PhamePostHistoryController',
'view/(?P<id>\d+)/(?:(?P<slug>[^/]+)/)?' => 'PhamePostViewController',
'(?P<action>publish|unpublish)/(?P<id>\d+)/'
=> 'PhamePostPublishController',
'preview/' => 'PhabricatorMarkupPreviewController',
'move/(?P<id>\d+)/' => 'PhamePostMoveController',
'archive/(?P<id>\d+)/' => 'PhamePostArchiveController',
'header/(?P<id>[1-9]\d*)/' => 'PhamePostHeaderPictureController',
),
'blog/' => array(
'(?:query/(?P<queryKey>[^/]+)/)?' => 'PhameBlogListController',
'archive/(?P<id>[^/]+)/' => 'PhameBlogArchiveController',
$this->getEditRoutePattern('edit/')
=> 'PhameBlogEditController',
'view/(?P<blogID>\d+)/' => 'PhameBlogViewController',
'manage/(?P<id>[^/]+)/' => 'PhameBlogManageController',
'feed/(?P<id>[^/]+)/' => 'PhameBlogFeedController',
'picture/(?P<id>[1-9]\d*)/' => 'PhameBlogProfilePictureController',
'header/(?P<id>[1-9]\d*)/' => 'PhameBlogHeaderPictureController',
),
),
);
}
public function getBlogRoutes() {
return $this->getLiveRoutes() + array(
'/status/' => 'PhabricatorStatusController',
'/favicon.ico' => 'PhabricatorFaviconController',
'/robots.txt' => 'PhabricatorRobotsBlogController',
);
}
private function getLiveRoutes() {
return array(
'/' => array(
'' => 'PhameBlogViewController',
'post/(?P<id>\d+)/(?:(?P<slug>[^/]+)/)?' => 'PhamePostViewController',
),
);
}
public function getQuicksandURIPatternBlacklist() {
return array(
'/phame/live/.*',
);
}
public function getRemarkupRules() {
return array(
new PhamePostRemarkupRule(),
);
}
protected function getCustomCapabilities() {
return array(
PhameBlogCreateCapability::CAPABILITY => array(
'default' => PhabricatorPolicies::POLICY_USER,
'caption' => pht('Default create policy for blogs.'),
),
);
}
}
diff --git a/src/applications/phid/type/PhabricatorPHIDType.php b/src/applications/phid/type/PhabricatorPHIDType.php
index 2f82dcf169..f15df7f886 100644
--- a/src/applications/phid/type/PhabricatorPHIDType.php
+++ b/src/applications/phid/type/PhabricatorPHIDType.php
@@ -1,208 +1,232 @@
<?php
abstract class PhabricatorPHIDType extends Phobject {
final public function getTypeConstant() {
$const = $this->getPhobjectClassConstant('TYPECONST');
if (!is_string($const) || !preg_match('/^[A-Z]{4}$/', $const)) {
throw new Exception(
pht(
'%s class "%s" has an invalid %s property. PHID '.
'constants must be a four character uppercase string.',
__CLASS__,
get_class($this),
'TYPECONST'));
}
return $const;
}
abstract public function getTypeName();
public function getTypeIcon() {
// Default to the application icon if the type doesn't specify one.
$application_class = $this->getPHIDTypeApplicationClass();
if ($application_class) {
$application = newv($application_class, array());
return $application->getIcon();
}
return null;
}
public function newObject() {
return null;
}
/**
* Get the class name for the application this type belongs to.
*
* @return string|null Class name of the corresponding application, or null
* if the type is not bound to an application.
*/
abstract public function getPHIDTypeApplicationClass();
/**
* Build a @{class:PhabricatorPolicyAwareQuery} to load objects of this type
* by PHID.
*
* If you can not build a single query which satisfies this requirement, you
* can provide a dummy implementation for this method and overload
* @{method:loadObjects} instead.
*
* @param PhabricatorObjectQuery Query being executed.
* @param list<phid> PHIDs to load.
* @return PhabricatorPolicyAwareQuery Query object which loads the
* specified PHIDs when executed.
*/
abstract protected function buildQueryForObjects(
PhabricatorObjectQuery $query,
array $phids);
/**
* Load objects of this type, by PHID. For most PHID types, it is only
* necessary to implement @{method:buildQueryForObjects} to get object
* loading to work.
*
* @param PhabricatorObjectQuery Query being executed.
* @param list<phid> PHIDs to load.
* @return list<wild> Corresponding objects.
*/
public function loadObjects(
PhabricatorObjectQuery $query,
array $phids) {
$object_query = $this->buildQueryForObjects($query, $phids)
->setViewer($query->getViewer())
->setParentQuery($query);
// If the user doesn't have permission to use the application at all,
// just mark all the PHIDs as filtered. This primarily makes these
// objects show up as "Restricted" instead of "Unknown" when loaded as
// handles, which is technically true.
if (!$object_query->canViewerUseQueryApplication()) {
$object_query->addPolicyFilteredPHIDs(array_fuse($phids));
return array();
}
return $object_query->execute();
}
/**
* Populate provided handles with application-specific data, like titles and
* URIs.
*
* NOTE: The `$handles` and `$objects` lists are guaranteed to be nonempty
* and have the same keys: subclasses are expected to load information only
* for handles with visible objects.
*
* Because of this guarantee, a safe implementation will typically look like*
*
* foreach ($handles as $phid => $handle) {
* $object = $objects[$phid];
*
* $handle->setStuff($object->getStuff());
* // ...
* }
*
* In general, an implementation should call `setName()` and `setURI()` on
* each handle at a minimum. See @{class:PhabricatorObjectHandle} for other
* handle properties.
*
* @param PhabricatorHandleQuery Issuing query object.
* @param list<PhabricatorObjectHandle> Handles to populate with data.
* @param list<Object> Objects for these PHIDs loaded by
* @{method:buildQueryForObjects()}.
* @return void
*/
abstract public function loadHandles(
PhabricatorHandleQuery $query,
array $handles,
array $objects);
public function canLoadNamedObject($name) {
return false;
}
public function loadNamedObjects(
PhabricatorObjectQuery $query,
array $names) {
throw new PhutilMethodNotImplementedException();
}
/**
* Get all known PHID types.
*
* To get PHID types a given user has access to, see
* @{method:getAllInstalledTypes}.
*
* @return dict<string, PhabricatorPHIDType> Map of type constants to types.
*/
final public static function getAllTypes() {
return self::newClassMapQuery()
->execute();
}
final public static function getTypes(array $types) {
return id(new PhabricatorCachedClassMapQuery())
->setClassMapQuery(self::newClassMapQuery())
->setMapKeyMethod('getTypeConstant')
->loadClasses($types);
}
private static function newClassMapQuery() {
return id(new PhutilClassMapQuery())
->setAncestorClass(__CLASS__)
->setUniqueMethod('getTypeConstant');
}
/**
* Get all PHID types of applications installed for a given viewer.
*
* @param PhabricatorUser Viewing user.
* @return dict<string, PhabricatorPHIDType> Map of constants to installed
* types.
*/
public static function getAllInstalledTypes(PhabricatorUser $viewer) {
$all_types = self::getAllTypes();
$installed_types = array();
$app_classes = array();
foreach ($all_types as $key => $type) {
$app_class = $type->getPHIDTypeApplicationClass();
if ($app_class === null) {
// If the PHID type isn't bound to an application, include it as
// installed.
$installed_types[$key] = $type;
continue;
}
// Otherwise, we need to check if this application is installed before
// including the PHID type.
$app_classes[$app_class][$key] = $type;
}
if ($app_classes) {
$apps = id(new PhabricatorApplicationQuery())
->setViewer($viewer)
->withInstalled(true)
->withClasses(array_keys($app_classes))
->execute();
foreach ($apps as $app_class => $app) {
$installed_types += $app_classes[$app_class];
}
}
return $installed_types;
}
+
+ /**
+ * Get all PHID types of applications installed for a given viewer.
+ *
+ * @param PhabricatorUser Viewing user.
+ * @return dict<string, PhabricatorPHIDType> Map of constants to installed
+ * types.
+ */
+ public static function getAllTypesForApplication(
+ string $application) {
+ $all_types = self::getAllTypes();
+
+ $application_types = array();
+
+ foreach ($all_types as $key => $type) {
+ if ($type->getPHIDTypeApplicationClass() != $application) {
+ continue;
+ }
+
+ $application_types[$key] = $type;
+ }
+
+ return $application_types;
+ }
}
diff --git a/src/applications/pholio/application/PhabricatorPholioApplication.php b/src/applications/pholio/application/PhabricatorPholioApplication.php
index 4d80dd12ae..5ac650cc20 100644
--- a/src/applications/pholio/application/PhabricatorPholioApplication.php
+++ b/src/applications/pholio/application/PhabricatorPholioApplication.php
@@ -1,88 +1,92 @@
<?php
final class PhabricatorPholioApplication extends PhabricatorApplication {
public function getName() {
return pht('Pholio');
}
public function getBaseURI() {
return '/pholio/';
}
public function getShortDescription() {
return pht('Review Mocks and Design');
}
public function getIcon() {
return 'fa-camera-retro';
}
public function getTitleGlyph() {
return "\xE2\x9D\xA6";
}
public function getFlavorText() {
return pht('Things before they were cool.');
}
public function getRemarkupRules() {
return array(
new PholioRemarkupRule(),
);
}
+ public function getMonograms() {
+ return array('M');
+ }
+
public function getRoutes() {
return array(
'/M(?P<id>[1-9]\d*)(?:/(?P<imageID>\d+)/)?' => 'PholioMockViewController',
'/pholio/' => array(
'(?:query/(?P<queryKey>[^/]+)/)?' => 'PholioMockListController',
'new/' => 'PholioMockEditController',
'create/' => 'PholioMockEditController',
'edit/(?P<id>\d+)/' => 'PholioMockEditController',
'archive/(?P<id>\d+)/' => 'PholioMockArchiveController',
'comment/(?P<id>\d+)/' => 'PholioMockCommentController',
'inline/' => array(
'(?:(?P<id>\d+)/)?' => 'PholioInlineController',
'list/(?P<id>\d+)/' => 'PholioInlineListController',
),
'image/' => array(
'upload/' => 'PholioImageUploadController',
),
),
);
}
protected function getCustomCapabilities() {
return array(
PholioDefaultViewCapability::CAPABILITY => array(
'template' => PholioMockPHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_VIEW,
),
PholioDefaultEditCapability::CAPABILITY => array(
'template' => PholioMockPHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_EDIT,
),
);
}
public function getMailCommandObjects() {
return array(
'mock' => array(
'name' => pht('Email Commands: Mocks'),
'header' => pht('Interacting with Pholio Mocks'),
'object' => new PholioMock(),
'summary' => pht(
'This page documents the commands you can use to interact with '.
'mocks in Pholio.'),
),
);
}
public function getApplicationSearchDocumentTypes() {
return array(
PholioMockPHIDType::TYPECONST,
);
}
}
diff --git a/src/applications/phurl/application/PhabricatorPhurlApplication.php b/src/applications/phurl/application/PhabricatorPhurlApplication.php
index 14ffda77f1..56290ef5e1 100644
--- a/src/applications/phurl/application/PhabricatorPhurlApplication.php
+++ b/src/applications/phurl/application/PhabricatorPhurlApplication.php
@@ -1,75 +1,79 @@
<?php
final class PhabricatorPhurlApplication extends PhabricatorApplication {
public function getName() {
return pht('Phurl');
}
public function getShortDescription() {
return pht('URL Shortener');
}
public function getFlavorText() {
return pht('Shorten your favorite URL.');
}
public function getBaseURI() {
return '/phurl/';
}
public function getIcon() {
return 'fa-compress';
}
public function isPrototype() {
return true;
}
public function getApplicationGroup() {
return self::GROUP_UTILITIES;
}
public function getRemarkupRules() {
return array(
new PhabricatorPhurlRemarkupRule(),
new PhabricatorPhurlLinkRemarkupRule(),
);
}
+ public function getMonograms() {
+ return array('U');
+ }
+
public function getRoutes() {
return array(
'/U(?P<id>[1-9]\d*)/?' => 'PhabricatorPhurlURLViewController',
'/u/(?P<id>[1-9]\d*)/?' => 'PhabricatorPhurlURLAccessController',
'/u/(?P<alias>[^/]+)/?' => 'PhabricatorPhurlURLAccessController',
'/phurl/' => array(
'(?:query/(?P<queryKey>[^/]+)/)?'
=> 'PhabricatorPhurlURLListController',
'url/' => array(
$this->getEditRoutePattern('edit/')
=> 'PhabricatorPhurlURLEditController',
),
),
);
}
public function getShortRoutes() {
return array(
'/status/' => 'PhabricatorStatusController',
'/favicon.ico' => 'PhabricatorFaviconController',
'/robots.txt' => 'PhabricatorRobotsShortController',
'/u/(?P<append>[^/]+)' => 'PhabricatorPhurlShortURLController',
'.*' => 'PhabricatorPhurlShortURLDefaultController',
);
}
protected function getCustomCapabilities() {
return array(
PhabricatorPhurlURLCreateCapability::CAPABILITY => array(
'default' => PhabricatorPolicies::POLICY_USER,
),
);
}
}
diff --git a/src/applications/ponder/application/PhabricatorPonderApplication.php b/src/applications/ponder/application/PhabricatorPonderApplication.php
index 56973447f9..e6f4ef8867 100644
--- a/src/applications/ponder/application/PhabricatorPonderApplication.php
+++ b/src/applications/ponder/application/PhabricatorPonderApplication.php
@@ -1,118 +1,122 @@
<?php
final class PhabricatorPonderApplication extends PhabricatorApplication {
public function getBaseURI() {
return '/ponder/';
}
public function getName() {
return pht('Ponder');
}
public function getShortDescription() {
return pht('Questions and Answers');
}
public function getIcon() {
return 'fa-university';
}
public function getTitleGlyph() {
return "\xE2\x97\xB3";
}
public function getRemarkupRules() {
return array(
new PonderRemarkupRule(),
);
}
public function getApplicationGroup() {
return self::GROUP_UTILITIES;
}
public function supportsEmailIntegration() {
return true;
}
public function getAppEmailBlurb() {
return pht(
'Send email to these addresses to create questions. %s',
phutil_tag(
'a',
array(
'href' => $this->getInboundEmailSupportLink(),
),
pht('Learn More')));
}
+ public function getMonograms() {
+ return array('Q');
+ }
+
public function getRoutes() {
return array(
'/Q(?P<id>[1-9]\d*)'
=> 'PonderQuestionViewController',
'/ponder/' => array(
'(?:query/(?P<queryKey>[^/]+)/)?'
=> 'PonderQuestionListController',
'answer/' => array(
'add/'
=> 'PonderAnswerSaveController',
'edit/(?P<id>\d+)/'
=> 'PonderAnswerEditController',
'comment/(?P<id>\d+)/'
=> 'PonderAnswerCommentController',
'history/(?P<id>\d+)/'
=> 'PonderAnswerHistoryController',
),
'question/' => array(
$this->getEditRoutePattern('edit/')
=> 'PonderQuestionEditController',
'create/'
=> 'PonderQuestionEditController',
'comment/(?P<id>\d+)/'
=> 'PonderQuestionCommentController',
'history/(?P<id>\d+)/'
=> 'PonderQuestionHistoryController',
),
'preview/'
=> 'PhabricatorMarkupPreviewController',
'question/status/(?P<id>[1-9]\d*)/'
=> 'PonderQuestionStatusController',
),
);
}
public function getMailCommandObjects() {
return array(
'question' => array(
'name' => pht('Email Commands: Questions'),
'header' => pht('Interacting with Ponder Questions'),
'object' => new PonderQuestion(),
'summary' => pht(
'This page documents the commands you can use to interact with '.
'questions in Ponder.'),
),
);
}
protected function getCustomCapabilities() {
return array(
PonderDefaultViewCapability::CAPABILITY => array(
'template' => PonderQuestionPHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_VIEW,
),
PonderModerateCapability::CAPABILITY => array(
'default' => PhabricatorPolicies::POLICY_ADMIN,
'template' => PonderQuestionPHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_EDIT,
),
);
}
public function getApplicationSearchDocumentTypes() {
return array(
PonderQuestionPHIDType::TYPECONST,
);
}
}
diff --git a/src/applications/slowvote/application/PhabricatorSlowvoteApplication.php b/src/applications/slowvote/application/PhabricatorSlowvoteApplication.php
index 1e4bd78419..8fa4edc6f6 100644
--- a/src/applications/slowvote/application/PhabricatorSlowvoteApplication.php
+++ b/src/applications/slowvote/application/PhabricatorSlowvoteApplication.php
@@ -1,73 +1,77 @@
<?php
final class PhabricatorSlowvoteApplication extends PhabricatorApplication {
public function getBaseURI() {
return '/vote/';
}
public function getIcon() {
return 'fa-bar-chart';
}
public function getName() {
return pht('Slowvote');
}
public function getShortDescription() {
return pht('Conduct Polls');
}
public function getTitleGlyph() {
return "\xE2\x9C\x94";
}
public function getHelpDocumentationArticles(PhabricatorUser $viewer) {
return array(
array(
'name' => pht('Slowvote User Guide'),
'href' => PhabricatorEnv::getDoclink('Slowvote User Guide'),
),
);
}
public function getFlavorText() {
return pht('Design by committee.');
}
public function getApplicationGroup() {
return self::GROUP_UTILITIES;
}
public function getRemarkupRules() {
return array(
new SlowvoteRemarkupRule(),
);
}
+ public function getMonograms() {
+ return array('V');
+ }
+
public function getRoutes() {
return array(
'/V(?P<id>[1-9]\d*)' => 'PhabricatorSlowvotePollController',
'/vote/' => array(
'(?:query/(?P<queryKey>[^/]+)/)?'
=> 'PhabricatorSlowvoteListController',
'create/' => 'PhabricatorSlowvoteEditController',
'edit/(?P<id>[1-9]\d*)/' => 'PhabricatorSlowvoteEditController',
'(?P<id>[1-9]\d*)/' => 'PhabricatorSlowvoteVoteController',
'comment/(?P<id>[1-9]\d*)/' => 'PhabricatorSlowvoteCommentController',
'close/(?P<id>[1-9]\d*)/' => 'PhabricatorSlowvoteCloseController',
),
);
}
protected function getCustomCapabilities() {
return array(
PhabricatorSlowvoteDefaultViewCapability::CAPABILITY => array(
'caption' => pht('Default view policy for new polls.'),
'template' => PhabricatorSlowvotePollPHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_VIEW,
),
);
}
}
diff --git a/src/applications/spaces/application/PhabricatorSpacesApplication.php b/src/applications/spaces/application/PhabricatorSpacesApplication.php
index d542551ae4..f40538b69b 100644
--- a/src/applications/spaces/application/PhabricatorSpacesApplication.php
+++ b/src/applications/spaces/application/PhabricatorSpacesApplication.php
@@ -1,84 +1,88 @@
<?php
final class PhabricatorSpacesApplication extends PhabricatorApplication {
public function getBaseURI() {
return '/spaces/';
}
public function getName() {
return pht('Spaces');
}
public function getShortDescription() {
return pht('Policy Namespaces');
}
public function getIcon() {
return 'fa-th-large';
}
public function getTitleGlyph() {
return "\xE2\x97\x8B";
}
public function getFlavorText() {
return pht('Control access to groups of objects.');
}
public function getApplicationGroup() {
return self::GROUP_UTILITIES;
}
public function canUninstall() {
return false;
}
public function getHelpDocumentationArticles(PhabricatorUser $viewer) {
return array(
array(
'name' => pht('Spaces User Guide'),
'href' => PhabricatorEnv::getDoclink('Spaces User Guide'),
),
);
}
public function getRemarkupRules() {
return array(
new PhabricatorSpacesRemarkupRule(),
);
}
+ public function getMonograms() {
+ return array('S');
+ }
+
public function getRoutes() {
return array(
'/S(?P<id>[1-9]\d*)' => 'PhabricatorSpacesViewController',
'/spaces/' => array(
'(?:query/(?P<queryKey>[^/]+)/)?' => 'PhabricatorSpacesListController',
'create/' => 'PhabricatorSpacesEditController',
'edit/(?:(?P<id>\d+)/)?' => 'PhabricatorSpacesEditController',
'(?P<action>activate|archive)/(?P<id>\d+)/'
=> 'PhabricatorSpacesArchiveController',
),
);
}
protected function getCustomCapabilities() {
return array(
PhabricatorSpacesCapabilityCreateSpaces::CAPABILITY => array(
'default' => PhabricatorPolicies::POLICY_ADMIN,
),
PhabricatorSpacesCapabilityDefaultView::CAPABILITY => array(
'caption' => pht('Default view policy for newly created spaces.'),
'template' => PhabricatorSpacesNamespacePHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_VIEW,
),
PhabricatorSpacesCapabilityDefaultEdit::CAPABILITY => array(
'caption' => pht('Default edit policy for newly created spaces.'),
'default' => PhabricatorPolicies::POLICY_ADMIN,
'template' => PhabricatorSpacesNamespacePHIDType::TYPECONST,
'capability' => PhabricatorPolicyCapability::CAN_EDIT,
),
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Jan 19, 17:32 (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1127003
Default Alt Text
(118 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment