Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120418518
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, Jul 4, 06:03
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Jul 6, 06:03 (2 d)
Engine
blob
Format
Raw Data
Handle
27185800
Attached To
rPH Phabricator
PhabricatorPasteController.php
View Options
<?php
abstract
class
PhabricatorPasteController
extends
PhabricatorController
{
public
function
buildSideNavView
(
$filter
=
null
,
$for_app
=
false
)
{
$user
=
$this
->
getRequest
()->
getUser
();
$nav
=
new
AphrontSideNavFilterView
();
$nav
->
setBaseURI
(
new
PhutilURI
(
$this
->
getApplicationURI
(
'filter/'
)));
if
(
$for_app
)
{
$nav
->
addFilter
(
''
,
pht
(
'Create Paste'
),
$this
->
getApplicationURI
(
'/create/'
));
}
$nav
->
addLabel
(
pht
(
'Filters'
));
$nav
->
addFilter
(
'all'
,
pht
(
'All Pastes'
));
if
(
$user
->
isLoggedIn
())
{
$nav
->
addFilter
(
'my'
,
pht
(
'My Pastes'
));
}
$nav
->
selectFilter
(
$filter
,
'all'
);
return
$nav
;
}
public
function
buildApplicationMenu
()
{
return
$this
->
buildSideNavView
(
null
,
true
)->
getMenu
();
}
public
function
buildApplicationCrumbs
()
{
$crumbs
=
parent
::
buildApplicationCrumbs
();
$crumbs
->
addAction
(
id
(
new
PhabricatorMenuItemView
())
->
setName
(
pht
(
'Create Paste'
))
->
setHref
(
$this
->
getApplicationURI
(
'create/'
))
->
setIcon
(
'create'
));
return
$crumbs
;
}
public
function
buildSourceCodeView
(
PhabricatorPaste
$paste
,
$max_lines
=
null
)
{
$lines
=
phutil_split_lines
(
$paste
->
getContent
());
return
id
(
new
PhabricatorSourceCodeView
())
->
setLimit
(
$max_lines
)
->
setLines
(
$lines
);
}
}
Event Timeline
Log In to Comment