Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99412660
PhabricatorEditEngineCreateQuickActions.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 24, 08:20
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Jan 26, 08:20 (2 d)
Engine
blob
Format
Raw Data
Handle
23792383
Attached To
rPH Phabricator
PhabricatorEditEngineCreateQuickActions.php
View Options
<?php
final
class
PhabricatorEditEngineCreateQuickActions
extends
PhabricatorQuickActions
{
const
QUICKACTIONSKEY
=
'editengine.create'
;
public
function
getQuickMenuItems
()
{
$viewer
=
$this
->
getViewer
();
$engines
=
PhabricatorEditEngine
::
getAllEditEngines
();
foreach
(
$engines
as
$key
=>
$engine
)
{
if
(!
$engine
->
hasQuickCreateActions
())
{
unset
(
$engines
[
$key
]);
}
}
if
(!
$engines
)
{
return
array
();
}
$engine_keys
=
array_keys
(
$engines
);
$configs
=
id
(
new
PhabricatorEditEngineConfigurationQuery
())
->
setViewer
(
$viewer
)
->
withEngineKeys
(
$engine_keys
)
->
withIsDefault
(
true
)
->
withIsDisabled
(
false
)
->
execute
();
$configs
=
msort
(
$configs
,
'getCreateSortKey'
);
$configs
=
mgroup
(
$configs
,
'getEngineKey'
);
$items
=
array
();
foreach
(
$engines
as
$key
=>
$engine
)
{
$engine_configs
=
idx
(
$configs
,
$key
,
array
());
$engine_items
=
$engine
->
newQuickCreateActions
(
$engine_configs
);
foreach
(
$engine_items
as
$engine_item
)
{
$items
[]
=
$engine_item
;
}
}
return
$items
;
}
}
Event Timeline
Log In to Comment