Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2349184
HeraldRuleTransaction.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
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-pause'
;
}
else
{
return
'fa-play'
;
}
}
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
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Sep 16, 11:25 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
397714
Default Alt Text
HeraldRuleTransaction.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment