Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F106721387
PhabricatorTokenizerEditField.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
Sun, Mar 30, 15:26
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Apr 1, 15:26 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
25260899
Attached To
rPH Phabricator
PhabricatorTokenizerEditField.php
View Options
<?php
abstract
class
PhabricatorTokenizerEditField
extends
PhabricatorPHIDListEditField
{
private
$commentActionLabel
;
abstract
protected
function
newDatasource
();
public
function
setCommentActionLabel
(
$label
)
{
$this
->
commentActionLabel
=
$label
;
return
$this
;
}
public
function
getCommentActionLabel
()
{
return
$this
->
commentActionLabel
;
}
protected
function
newControl
()
{
$control
=
id
(
new
AphrontFormTokenizerControl
())
->
setDatasource
(
$this
->
newDatasource
());
$initial_value
=
$this
->
getInitialValue
();
if
(
$initial_value
!==
null
)
{
$control
->
setOriginalValue
(
$initial_value
);
}
if
(
$this
->
getIsSingleValue
())
{
$control
->
setLimit
(
1
);
}
return
$control
;
}
protected
function
getInitialValueFromSubmit
(
AphrontRequest
$request
,
$key
)
{
return
$request
->
getArr
(
$key
.
'.original'
);
}
protected
function
newEditType
()
{
$type
=
parent
::
newEditType
();
if
(
$this
->
getUseEdgeTransactions
())
{
$datasource
=
$this
->
newDatasource
()
->
setViewer
(
$this
->
getViewer
());
$type
->
setDatasource
(
$datasource
);
}
return
$type
;
}
public
function
getCommentEditTypes
()
{
if
(!
$this
->
getUseEdgeTransactions
())
{
return
parent
::
getCommentEditTypes
();
}
$transaction_type
=
$this
->
getTransactionType
();
if
(
$transaction_type
===
null
)
{
return
array
();
}
$label
=
$this
->
getCommentActionLabel
();
if
(
$label
===
null
)
{
return
array
();
}
$type_key
=
$this
->
getEditTypeKey
();
$base
=
$this
->
getEditType
();
$add
=
id
(
clone
$base
)
->
setEditType
(
$type_key
.
'.add'
)
->
setEdgeOperation
(
'+'
)
->
setLabel
(
$label
);
return
array
(
$add
);
}
}
Event Timeline
Log In to Comment