Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F80158005
PhabricatorMailRoutingRule.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, Aug 30, 04:56
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Sep 1, 04:56 (2 d)
Engine
blob
Format
Raw Data
Handle
20312374
Attached To
rPH Phabricator
PhabricatorMailRoutingRule.php
View Options
<?php
final
class
PhabricatorMailRoutingRule
extends
Phobject
{
const
ROUTE_AS_NOTIFICATION
=
'route.notification'
;
const
ROUTE_AS_MAIL
=
'route.mail'
;
public
static
function
isStrongerThan
(
$rule_u
,
$rule_v
)
{
$strength_u
=
self
::
getRuleStrength
(
$rule_u
);
$strength_v
=
self
::
getRuleStrength
(
$rule_v
);
return
(
$strength_u
>
$strength_v
);
}
public
static
function
getRuleStrength
(
$const
)
{
$strength
=
array
(
self
::
ROUTE_AS_NOTIFICATION
=>
1
,
self
::
ROUTE_AS_MAIL
=>
2
,
);
return
idx
(
$strength
,
$const
,
0
);
}
public
static
function
getRuleName
(
$const
)
{
$names
=
array
(
self
::
ROUTE_AS_NOTIFICATION
=>
pht
(
'Route as Notification'
),
self
::
ROUTE_AS_MAIL
=>
pht
(
'Route as Mail'
),
);
return
idx
(
$names
,
$const
,
$const
);
}
public
static
function
getRuleIcon
(
$const
)
{
$icons
=
array
(
self
::
ROUTE_AS_NOTIFICATION
=>
'fa-bell'
,
self
::
ROUTE_AS_MAIL
=>
'fa-envelope'
,
);
return
idx
(
$icons
,
$const
,
'fa-question-circle'
);
}
public
static
function
getRuleColor
(
$const
)
{
$colors
=
array
(
self
::
ROUTE_AS_NOTIFICATION
=>
'grey'
,
self
::
ROUTE_AS_MAIL
=>
'grey'
,
);
return
idx
(
$colors
,
$const
,
'yellow'
);
}
}
Event Timeline
Log In to Comment