Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92705289
PhabricatorPasteController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Nov 22, 23:22
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Nov 24, 23:22 (1 d, 19 h)
Engine
blob
Format
Raw Data
Handle
22491131
Attached To
rPH Phabricator
PhabricatorPasteController.php
View Options
<?php
/**
* @group paste
*/
abstract
class
PhabricatorPasteController
extends
PhabricatorController
{
public
function
buildSideNavView
(
$for_app
=
false
)
{
$user
=
$this
->
getRequest
()->
getUser
();
$nav
=
new
AphrontSideNavFilterView
();
$nav
->
setBaseURI
(
new
PhutilURI
(
$this
->
getApplicationURI
()));
if
(
$for_app
)
{
$nav
->
addFilter
(
'create'
,
pht
(
'Create Paste'
));
}
id
(
new
PhabricatorPasteSearchEngine
())
->
setViewer
(
$user
)
->
addNavigationItems
(
$nav
->
getMenu
());
$nav
->
selectFilter
(
null
);
return
$nav
;
}
public
function
buildApplicationMenu
()
{
return
$this
->
buildSideNavView
(
true
)->
getMenu
();
}
public
function
buildApplicationCrumbs
()
{
$crumbs
=
parent
::
buildApplicationCrumbs
();
$crumbs
->
addAction
(
id
(
new
PHUIListItemView
())
->
setName
(
pht
(
'Create Paste'
))
->
setHref
(
$this
->
getApplicationURI
(
'create/'
))
->
setIcon
(
'fa-plus-square'
));
return
$crumbs
;
}
public
function
buildSourceCodeView
(
PhabricatorPaste
$paste
,
$max_lines
=
null
,
$highlights
=
array
())
{
$lines
=
phutil_split_lines
(
$paste
->
getContent
());
return
id
(
new
PhabricatorSourceCodeView
())
->
setLimit
(
$max_lines
)
->
setLines
(
$lines
)
->
setHighlights
(
$highlights
)
->
setURI
(
new
PhutilURI
(
$paste
->
getURI
()));
}
}
Event Timeline
Log In to Comment