Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97586757
PhabricatorPinnedApplicationsSetting.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
Sun, Jan 5, 12:11
Size
850 B
Mime Type
text/x-php
Expires
Tue, Jan 7, 12:11 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23431451
Attached To
rPH Phabricator
PhabricatorPinnedApplicationsSetting.php
View Options
<?php
final
class
PhabricatorPinnedApplicationsSetting
extends
PhabricatorInternalSetting
{
const
SETTINGKEY
=
'app-pinned'
;
public
function
getSettingName
()
{
return
pht
(
'Pinned Applications'
);
}
public
function
getSettingDefaultValue
()
{
$viewer
=
$this
->
getViewer
();
// If we're editing a template, just show every available application.
if
(!
$viewer
)
{
$viewer
=
PhabricatorUser
::
getOmnipotentUser
();
}
$applications
=
id
(
new
PhabricatorApplicationQuery
())
->
setViewer
(
$viewer
)
->
withInstalled
(
true
)
->
withUnlisted
(
false
)
->
withLaunchable
(
true
)
->
execute
();
$pinned
=
array
();
foreach
(
$applications
as
$application
)
{
if
(
$application
->
isPinnedByDefault
(
$viewer
))
{
$pinned
[]
=
get_class
(
$application
);
}
}
return
$pinned
;
}
}
Event Timeline
Log In to Comment