Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98137283
PhabricatorQuickActions.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, Jan 10, 04:53
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Jan 12, 04:53 (2 d)
Engine
blob
Format
Raw Data
Handle
23513629
Attached To
rPH Phabricator
PhabricatorQuickActions.php
View Options
<?php
abstract
class
PhabricatorQuickActions
extends
Phobject
{
private
$viewer
;
public
function
setViewer
(
PhabricatorUser
$viewer
)
{
$this
->
viewer
=
$viewer
;
return
$this
;
}
public
function
getViewer
()
{
return
$this
->
viewer
;
}
public
function
isEnabled
()
{
return
true
;
}
abstract
public
function
getQuickMenuItems
();
final
public
function
getQuickActionsKey
()
{
return
$this
->
getPhobjectClassConstant
(
'QUICKACTIONSKEY'
);
}
public
static
function
getAllQuickActions
()
{
return
id
(
new
PhutilClassMapQuery
())
->
setAncestorClass
(
__CLASS__
)
->
setUniqueMethod
(
'getQuickActionsKey'
)
->
execute
();
}
public
static
function
loadMenuItemsForUser
(
PhabricatorUser
$viewer
)
{
$actions
=
self
::
getAllQuickActions
();
foreach
(
$actions
as
$key
=>
$action
)
{
$action
->
setViewer
(
$viewer
);
if
(!
$action
->
isEnabled
())
{
unset
(
$actions
[
$key
]);
continue
;
}
}
$items
=
array
();
foreach
(
$actions
as
$key
=>
$action
)
{
foreach
(
$action
->
getQuickMenuItems
()
as
$item
)
{
$items
[]
=
$item
;
}
}
return
$items
;
}
}
Event Timeline
Log In to Comment