Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97989760
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
Wed, Jan 8, 08:29
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Jan 10, 08:29 (2 d)
Engine
blob
Format
Raw Data
Handle
23473697
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