Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F82404868
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
Wed, Sep 11, 05:28
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Sep 13, 05:28 (2 d)
Engine
blob
Format
Raw Data
Handle
20695480
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