Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93073851
PhabricatorUserIconField.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
Tue, Nov 26, 00:25
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Nov 28, 00:25 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22567770
Attached To
rPH Phabricator
PhabricatorUserIconField.php
View Options
<?php
final
class
PhabricatorUserIconField
extends
PhabricatorUserCustomField
{
private
$value
;
public
function
getFieldKey
()
{
return
'user:icon'
;
}
public
function
getFieldName
()
{
return
pht
(
'Icon'
);
}
public
function
getFieldDescription
()
{
return
pht
(
'User icon to accompany their title.'
);
}
public
function
canDisableField
()
{
return
false
;
}
public
function
shouldAppearInApplicationTransactions
()
{
return
true
;
}
public
function
shouldAppearInEditView
()
{
return
true
;
}
public
function
readValueFromObject
(
PhabricatorCustomFieldInterface
$object
)
{
$this
->
value
=
$object
->
loadUserProfile
()->
getIcon
();
}
public
function
getOldValueForApplicationTransactions
()
{
return
$this
->
getObject
()->
loadUserProfile
()->
getIcon
();
}
public
function
getNewValueForApplicationTransactions
()
{
return
$this
->
value
;
}
public
function
applyApplicationTransactionInternalEffects
(
PhabricatorApplicationTransaction
$xaction
)
{
$this
->
getObject
()->
loadUserProfile
()->
setIcon
(
$xaction
->
getNewValue
());
}
public
function
readValueFromRequest
(
AphrontRequest
$request
)
{
$this
->
value
=
$request
->
getStr
(
$this
->
getFieldKey
());
}
public
function
renderEditControl
(
array
$handles
)
{
return
id
(
new
PHUIFormIconSetControl
())
->
setName
(
$this
->
getFieldKey
())
->
setValue
(
$this
->
value
)
->
setLabel
(
$this
->
getFieldName
())
->
setIconSet
(
new
PhabricatorPeopleIconSet
());
}
}
Event Timeline
Log In to Comment