Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F106898772
PhabricatorSlowvoteController.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
Wed, Apr 2, 06:16
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Apr 4, 06:16 (2 d)
Engine
blob
Format
Raw Data
Handle
25301035
Attached To
rPH Phabricator
PhabricatorSlowvoteController.php
View Options
<?php
/**
* @group slowvote
*/
abstract
class
PhabricatorSlowvoteController
extends
PhabricatorController
{
const
VIEW_ALL
=
'all'
;
const
VIEW_CREATED
=
'created'
;
const
VIEW_VOTED
=
'voted'
;
public
function
buildStandardPageResponse
(
$view
,
array
$data
)
{
$page
=
$this
->
buildStandardPageView
();
$page
->
setApplicationName
(
pht
(
'Slowvote'
));
$page
->
setBaseURI
(
'/vote/'
);
$page
->
setTitle
(
idx
(
$data
,
'title'
));
$page
->
setGlyph
(
"
\x
E2
\x
9C
\x
94"
);
$page
->
appendChild
(
$view
);
$response
=
new
AphrontWebpageResponse
();
return
$response
->
setContent
(
$page
->
render
());
}
public
function
buildSideNavView
(
$filter
=
null
,
$for_app
=
false
)
{
$views
=
$this
->
getViews
();
$side_nav
=
new
AphrontSideNavFilterView
();
$side_nav
->
setBaseURI
(
new
PhutilURI
(
'/vote/view/'
));
foreach
(
$views
as
$key
=>
$name
)
{
$side_nav
->
addFilter
(
$key
,
$name
);
}
if
(
$filter
)
{
$side_nav
->
selectFilter
(
$filter
,
null
);
}
if
(
$for_app
)
{
$side_nav
->
addFilter
(
''
,
pht
(
'Create Question'
),
$this
->
getApplicationURI
(
'create/'
));
}
return
$side_nav
;
}
public
function
buildApplicationMenu
()
{
return
$this
->
buildSideNavView
(
null
,
true
)->
getMenu
();
}
public
function
buildApplicationCrumbs
()
{
$crumbs
=
parent
::
buildApplicationCrumbs
();
$crumbs
->
addAction
(
id
(
new
PHUIListItemView
())
->
setName
(
pht
(
'Create Question'
))
->
setHref
(
$this
->
getApplicationURI
(
'create/'
))
->
setIcon
(
'create'
));
return
$crumbs
;
}
public
function
getViews
()
{
return
array
(
self
::
VIEW_ALL
=>
pht
(
'All Slowvotes'
),
self
::
VIEW_CREATED
=>
pht
(
'Created'
),
self
::
VIEW_VOTED
=>
pht
(
'Voted In'
),
);
}
}
Event Timeline
Log In to Comment