Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96536872
PhabricatorSettingsEditEngine.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, Dec 27, 18:52
Size
2 KB
Mime Type
text/x-php
Expires
Sun, Dec 29, 18:52 (2 d)
Engine
blob
Format
Raw Data
Handle
23201791
Attached To
rPH Phabricator
PhabricatorSettingsEditEngine.php
View Options
<?php
final
class
PhabricatorSettingsEditEngine
extends
PhabricatorEditEngine
{
const
ENGINECONST
=
'settings.settings'
;
public
function
isEngineConfigurable
()
{
return
false
;
}
public
function
getEngineName
()
{
return
pht
(
'Settings'
);
}
public
function
getSummaryHeader
()
{
return
pht
(
'Edit Settings Configurations'
);
}
public
function
getSummaryText
()
{
return
pht
(
'This engine is used to edit settings.'
);
}
public
function
getEngineApplicationClass
()
{
return
'PhabricatorSettingsApplication'
;
}
protected
function
newEditableObject
()
{
return
new
PhabricatorUserPreferences
();
}
protected
function
newObjectQuery
()
{
return
new
PhabricatorUserPreferencesQuery
();
}
protected
function
getObjectCreateTitleText
(
$object
)
{
return
pht
(
'Create Settings'
);
}
protected
function
getObjectCreateButtonText
(
$object
)
{
return
pht
(
'Create Settings'
);
}
protected
function
getObjectEditTitleText
(
$object
)
{
return
pht
(
'Edit Settings'
);
}
protected
function
getObjectEditShortText
(
$object
)
{
return
pht
(
'Edit Settings'
);
}
protected
function
getObjectCreateShortText
()
{
return
pht
(
'Create Settings'
);
}
protected
function
getObjectName
()
{
return
pht
(
'Settings'
);
}
protected
function
getEditorURI
()
{
return
'/settings/edit/'
;
}
protected
function
getObjectCreateCancelURI
(
$object
)
{
return
'/settings/'
;
}
protected
function
getObjectViewURI
(
$object
)
{
// TODO: This isn't correct...
return
'/settings/user/'
.
$this
->
getViewer
()->
getUsername
().
'/'
;
}
protected
function
getCreateNewObjectPolicy
()
{
return
PhabricatorPolicies
::
POLICY_ADMIN
;
}
protected
function
buildCustomEditFields
(
$object
)
{
$viewer
=
$this
->
getViewer
();
$settings
=
PhabricatorSetting
::
getAllEnabledSettings
(
$viewer
);
$fields
=
array
();
foreach
(
$settings
as
$setting
)
{
foreach
(
$setting
->
newCustomEditFields
(
$object
)
as
$field
)
{
$fields
[]
=
$field
;
}
}
return
$fields
;
}
}
Event Timeline
Log In to Comment