Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F435825
PhabricatorUserBlurbField.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
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
;
}
public
function
readValueFromObject
(
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
(
array
$handles
)
{
return
id
(
new
PhabricatorRemarkupControl
())
->
setUser
(
$this
->
getViewer
())
->
setName
(
$this
->
getFieldKey
())
->
setValue
(
$this
->
value
)
->
setLabel
(
$this
->
getFieldName
());
}
public
function
renderPropertyViewLabel
()
{
return
null
;
}
public
function
renderPropertyViewValue
(
array
$handles
)
{
$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'
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 3, 9:10 PM (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
58023
Default Alt Text
PhabricatorUserBlurbField.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment