Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96379471
HeraldRuleTransaction.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
Thu, Dec 26, 04:23
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Dec 28, 04:23 (1 d, 11 h)
Engine
blob
Format
Raw Data
Handle
23147792
Attached To
rPH Phabricator
HeraldRuleTransaction.php
View Options
<?php
final
class
HeraldRuleTransaction
extends
PhabricatorApplicationTransaction
{
const
TYPE_EDIT
=
'herald:edit'
;
const
TYPE_DISABLE
=
'herald:disable'
;
public
function
getApplicationName
()
{
return
'herald'
;
}
public
function
getApplicationTransactionType
()
{
return
HeraldRulePHIDType
::
TYPECONST
;
}
public
function
getApplicationTransactionCommentObject
()
{
return
new
HeraldRuleTransactionComment
();
}
public
function
getColor
()
{
$old
=
$this
->
getOldValue
();
$new
=
$this
->
getNewValue
();
switch
(
$this
->
getTransactionType
())
{
case
self
::
TYPE_DISABLE
:
if
(
$new
)
{
return
'red'
;
}
else
{
return
'green'
;
}
}
return
parent
::
getColor
();
}
public
function
getActionName
()
{
$old
=
$this
->
getOldValue
();
$new
=
$this
->
getNewValue
();
switch
(
$this
->
getTransactionType
())
{
case
self
::
TYPE_DISABLE
:
if
(
$new
)
{
return
pht
(
'Disabled'
);
}
else
{
return
pht
(
'Enabled'
);
}
}
return
parent
::
getActionName
();
}
public
function
getIcon
()
{
$old
=
$this
->
getOldValue
();
$new
=
$this
->
getNewValue
();
switch
(
$this
->
getTransactionType
())
{
case
self
::
TYPE_DISABLE
:
if
(
$new
)
{
return
'fa-ban'
;
}
else
{
return
'fa-check'
;
}
}
return
parent
::
getIcon
();
}
public
function
getTitle
()
{
$author_phid
=
$this
->
getAuthorPHID
();
$old
=
$this
->
getOldValue
();
$new
=
$this
->
getNewValue
();
switch
(
$this
->
getTransactionType
())
{
case
self
::
TYPE_DISABLE
:
if
(
$new
)
{
return
pht
(
'%s disabled this rule.'
,
$this
->
renderHandleLink
(
$author_phid
));
}
else
{
return
pht
(
'%s enabled this rule.'
,
$this
->
renderHandleLink
(
$author_phid
));
}
}
return
parent
::
getTitle
();
}
}
Event Timeline
Log In to Comment