Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101914112
PhabricatorSettingsListController.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
Sat, Feb 15, 02:17
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Feb 17, 02:17 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24244550
Attached To
rPH Phabricator
PhabricatorSettingsListController.php
View Options
<?php
final
class
PhabricatorSettingsListController
extends
PhabricatorController
{
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$this
->
getViewer
();
// If the viewer isn't an administrator, just redirect them to their own
// settings panel.
if
(!
$viewer
->
getIsAdmin
())
{
$settings_uri
=
'/user/'
.
$viewer
->
getUsername
().
'/'
;
$settings_uri
=
$this
->
getApplicationURI
(
$settings_uri
);
return
id
(
new
AphrontRedirectResponse
())
->
setURI
(
$settings_uri
);
}
return
id
(
new
PhabricatorUserPreferencesSearchEngine
())
->
setController
(
$this
)
->
buildResponse
();
}
protected
function
buildApplicationCrumbs
()
{
$crumbs
=
parent
::
buildApplicationCrumbs
();
$viewer
=
$this
->
getViewer
();
if
(
$viewer
->
getIsAdmin
())
{
$builtin_global
=
PhabricatorUserPreferences
::
BUILTIN_GLOBAL_DEFAULT
;
$global_settings
=
id
(
new
PhabricatorUserPreferencesQuery
())
->
setViewer
(
$viewer
)
->
withBuiltinKeys
(
array
(
$builtin_global
,
))
->
execute
();
if
(!
$global_settings
)
{
$action
=
id
(
new
PHUIListItemView
())
->
setName
(
pht
(
'Create Global Defaults'
))
->
setHref
(
'/settings/builtin/'
.
$builtin_global
.
'/'
)
->
setIcon
(
'fa-plus'
);
$crumbs
->
addAction
(
$action
);
}
}
return
$crumbs
;
}
}
Event Timeline
Log In to Comment