Summary: Add some missing methods from D10027. Test Plan: Viewed `/applications/query/all/` without hitting exceptions. Reviewers: joshuaspence Subscribers: epriestley, hach-que Differential Revision: https://secure.phabricator.com/D10029
69 lines
1.5 KiB
PHP
69 lines
1.5 KiB
PHP
<?php
|
|
|
|
final class PhabricatorPasteApplication extends PhabricatorApplication {
|
|
|
|
public function getName() {
|
|
return pht('Paste');
|
|
}
|
|
|
|
public function getBaseURI() {
|
|
return '/paste/';
|
|
}
|
|
|
|
public function getIconName() {
|
|
return '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 getRoutes() {
|
|
return array(
|
|
'/P(?P<id>[1-9]\d*)(?:\$(?P<lines>\d+(?:-\d+)?))?'
|
|
=> 'PhabricatorPasteViewController',
|
|
'/paste/' => array(
|
|
'(query/(?P<queryKey>[^/]+)/)?' => 'PhabricatorPasteListController',
|
|
'create/' => 'PhabricatorPasteEditController',
|
|
'edit/(?P<id>[1-9]\d*)/' => 'PhabricatorPasteEditController',
|
|
'comment/(?P<id>[1-9]\d*)/' => 'PhabricatorPasteCommentController',
|
|
),
|
|
);
|
|
}
|
|
|
|
protected function getCustomCapabilities() {
|
|
return array(
|
|
PasteCapabilityDefaultView::CAPABILITY => array(
|
|
'caption' => pht('Default view policy for newly created pastes.'),
|
|
),
|
|
);
|
|
}
|
|
|
|
public function getQuickCreateItems(PhabricatorUser $viewer) {
|
|
$items = array();
|
|
|
|
$item = id(new PHUIListItemView())
|
|
->setName(pht('Paste'))
|
|
->setIcon('fa-clipboard')
|
|
->setHref($this->getBaseURI().'create/');
|
|
$items[] = $item;
|
|
|
|
return $items;
|
|
}
|
|
|
|
}
|