Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100875150
DoorkeeperAsanaRemarkupRule.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
Mon, Feb 3, 12:37
Size
739 B
Mime Type
text/x-php
Expires
Wed, Feb 5, 12:37 (2 d)
Engine
blob
Format
Raw Data
Handle
24049062
Attached To
rPH Phabricator
DoorkeeperAsanaRemarkupRule.php
View Options
<?php
final
class
DoorkeeperAsanaRemarkupRule
extends
DoorkeeperRemarkupRule
{
public
function
apply
(
$text
)
{
return
preg_replace_callback
(
'@https://app
\\
.asana
\\
.com/0/(
\\
d+)/(
\\
d+)@'
,
array
(
$this
,
'markupAsanaLink'
),
$text
);
}
public
function
markupAsanaLink
(
$matches
)
{
return
$this
->
addDoorkeeperTag
(
array
(
'href'
=>
$matches
[
0
],
'tag'
=>
array
(
'ref'
=>
array
(
DoorkeeperBridgeAsana
::
APPTYPE_ASANA
,
DoorkeeperBridgeAsana
::
APPDOMAIN_ASANA
,
DoorkeeperBridgeAsana
::
OBJTYPE_TASK
,
$matches
[
2
],
),
'extra'
=>
array
(
'asana.context'
=>
$matches
[
1
],
),
),
));
}
}
Event Timeline
Log In to Comment