Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97248234
PhabricatorUserBlurbField.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, Jan 3, 18:57
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Jan 5, 18:57 (2 d)
Engine
blob
Format
Raw Data
Handle
23364184
Attached To
rPH Phabricator
PhabricatorUserBlurbField.php
View Options
<?php
final
class
PhabricatorUserBlurbField
extends
PhabricatorUserCustomField
{
private
$value
;
public
function
getFieldKey
()
{
return
'user:blurb'
;
}
public
function
getFieldName
()
{
return
pht
(
'Blurb'
);
}
public
function
getFieldDescription
()
{
return
pht
(
'Short blurb about the user.'
);
}
public
function
shouldAppearInApplicationTransactions
()
{
return
true
;
}
public
function
shouldAppearInEditView
()
{
return
true
;
}
public
function
shouldAppearInPropertyView
()
{
return
true
;
}
protected
function
didSetObject
(
PhabricatorCustomFieldInterface
$object
)
{
$this
->
value
=
$object
->
loadUserProfile
()->
getBlurb
();
}
public
function
getOldValueForApplicationTransactions
()
{
return
$this
->
getObject
()->
loadUserProfile
()->
getBlurb
();
}
public
function
getNewValueForApplicationTransactions
()
{
return
$this
->
value
;
}
public
function
applyApplicationTransactionInternalEffects
(
PhabricatorApplicationTransaction
$xaction
)
{
$this
->
getObject
()->
loadUserProfile
()->
setBlurb
(
$xaction
->
getNewValue
());
}
public
function
readValueFromRequest
(
AphrontRequest
$request
)
{
$this
->
value
=
$request
->
getStr
(
$this
->
getFieldKey
());
}
public
function
renderEditControl
()
{
return
id
(
new
PhabricatorRemarkupControl
())
->
setName
(
$this
->
getFieldKey
())
->
setValue
(
$this
->
value
)
->
setLabel
(
$this
->
getFieldName
());
}
public
function
renderPropertyViewLabel
()
{
return
null
;
}
public
function
renderPropertyViewValue
()
{
$blurb
=
$this
->
getObject
()->
loadUserProfile
()->
getBlurb
();
if
(!
strlen
(
$blurb
))
{
return
null
;
}
return
PhabricatorMarkupEngine
::
renderOneObject
(
id
(
new
PhabricatorMarkupOneOff
())->
setContent
(
$blurb
),
'default'
,
$this
->
getViewer
());
}
public
function
getStyleForPropertyView
()
{
return
'block'
;
}
}
Event Timeline
Log In to Comment