Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/paste/application/PhabricatorPasteApplication.php
12242 views
1
<?php
2
3
final class PhabricatorPasteApplication extends PhabricatorApplication {
4
5
public function getName() {
6
return pht('Paste');
7
}
8
9
public function getBaseURI() {
10
return '/paste/';
11
}
12
13
public function getIcon() {
14
return 'fa-paste';
15
}
16
17
public function getTitleGlyph() {
18
return "\xE2\x9C\x8E";
19
}
20
21
public function getApplicationGroup() {
22
return self::GROUP_UTILITIES;
23
}
24
25
public function getShortDescription() {
26
return pht('Share Text Snippets');
27
}
28
29
public function getRemarkupRules() {
30
return array(
31
new PhabricatorPasteRemarkupRule(),
32
);
33
}
34
35
public function getRoutes() {
36
return array(
37
'/P(?P<id>[1-9]\d*)(?:\$(?P<lines>\d+(?:-\d+)?))?'
38
=> 'PhabricatorPasteViewController',
39
'/paste/' => array(
40
'(query/(?P<queryKey>[^/]+)/)?' => 'PhabricatorPasteListController',
41
$this->getEditRoutePattern('edit/') => 'PhabricatorPasteEditController',
42
'raw/(?P<id>[1-9]\d*)/' => 'PhabricatorPasteRawController',
43
'archive/(?P<id>[1-9]\d*)/' => 'PhabricatorPasteArchiveController',
44
),
45
);
46
}
47
48
public function supportsEmailIntegration() {
49
return true;
50
}
51
52
public function getAppEmailBlurb() {
53
return pht(
54
'Send email to these addresses to create pastes. %s',
55
phutil_tag(
56
'a',
57
array(
58
'href' => $this->getInboundEmailSupportLink(),
59
),
60
pht('Learn More')));
61
}
62
63
protected function getCustomCapabilities() {
64
return array(
65
PasteDefaultViewCapability::CAPABILITY => array(
66
'caption' => pht('Default view policy for newly created pastes.'),
67
'template' => PhabricatorPastePastePHIDType::TYPECONST,
68
'capability' => PhabricatorPolicyCapability::CAN_VIEW,
69
),
70
PasteDefaultEditCapability::CAPABILITY => array(
71
'caption' => pht('Default edit policy for newly created pastes.'),
72
'template' => PhabricatorPastePastePHIDType::TYPECONST,
73
'capability' => PhabricatorPolicyCapability::CAN_EDIT,
74
),
75
);
76
}
77
78
public function getMailCommandObjects() {
79
return array(
80
'paste' => array(
81
'name' => pht('Email Commands: Pastes'),
82
'header' => pht('Interacting with Pastes'),
83
'object' => new PhabricatorPaste(),
84
'summary' => pht(
85
'This page documents the commands you can use to interact with '.
86
'pastes.'),
87
),
88
);
89
}
90
91
}
92
93