Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F158899
CustomInlineJIRA5Rule.php
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
epriestley
May 22 2014, 2:45 PM
2014-05-22 14:45:55 (UTC+0)
Size
628 B
Referenced Files
None
Subscribers
None
CustomInlineJIRA5Rule.php
View Options
<?php
final
class
CustomInlineJIRA5Rule
extends
PhabricatorRemarkupCustomInlineRule
{
public
function
apply
(
$text
)
{
return
preg_replace_callback
(
'/
\b
([A-Z]+-
\d
+)/'
,
array
(
$this
,
'markupInlineJIRALink'
),
$text
);
}
public
function
markupInlineJIRALink
(
array
$matches
)
{
// Change this to your JIRA install.
$uri
=
'http://your.jira.install.com/browse/'
.
$matches
[
1
];
$link
=
phutil_tag
(
'a'
,
array
(
'href'
=>
$uri
,
'style'
=>
'font-weight: bold;'
,
),
$matches
[
1
]);
$engine
=
$this
->
getEngine
();
return
$engine
->
storeText
(
$link
);
}
}
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/ub/dq/26inhr3n6cabawwn
Default Alt Text
CustomInlineJIRA5Rule.php (628 B)
Attached To
Mode
P1157 CustomInlineJIRA5Rule.php
Attached
Detach File
Event Timeline
Log In to Comment