Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1121715
widget_tp.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Aug 31, 2:40 AM
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Sep 2, 2:40 AM (3 m, 32 s)
Engine
blob
Format
Raw Data
Handle
725525
Attached To
rMCUS Modules.Custom
widget_tp.php
View Options
<?php
defined
(
'FULL_PATH'
)
or
die
(
'restricted access!'
);
/**
* Widgets Tag Processor (sample)
*
*/
class
WidgetTagProcessor
extends
kDBTagProcessor
{
/**
* Custom tag to output "Hello World!"
*
* @param Array $params
* @return string
*/
function
NewTag
(
$params
)
{
return
'Hello world!'
;
}
/**
* Returns a link for editing product
*
* @param Array $params
* @return string
*/
function
ItemEditLink
(
$params
)
{
/** @var kDBList $object */
$object
=
$this
->
getObject
(
$params
);
$edit_template
=
$this
->
Application
->
getUnitOption
(
$this
->
Prefix
,
'AdminTemplatePath'
)
.
'/'
.
$this
->
Application
->
getUnitOption
(
$this
->
Prefix
,
'AdminTemplatePrefix'
)
.
'edit'
;
$url_params
=
Array
(
'm_opener'
=>
'd'
,
$this
->
Prefix
.
'_mode'
=>
't'
,
$this
->
Prefix
.
'_event'
=>
'OnEdit'
,
$this
->
Prefix
.
'_id'
=>
$object
->
GetID
(),
'pass'
=>
'all,'
.
$this
->
Prefix
,
'no_pass_through'
=>
1
,
);
return
$this
->
Application
->
HREF
(
$edit_template
,
''
,
$url_params
);
}
/**
* Creates link to an item including only it's id
*
* @param Array $params
* @return string
* @access protected
*/
protected
function
ItemLink
(
$params
)
{
/** @var kDBItem $object */
$object
=
$this
->
getObject
(
$params
);
$params
[
'pass'
]
=
'm,'
.
$this
->
Prefix
;
$params
[
$object
->
Prefix
.
'_id'
]
=
$object
->
GetID
();
$params
[
$object
->
Prefix
.
'_filename'
]
=
$object
->
GetDBField
(
'Title'
);
return
$this
->
Application
->
ProcessParsedTag
(
'm'
,
'Link'
,
$params
);
}
}
Event Timeline
Log In to Comment