Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1122598
custom_eh.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, 9:48 PM
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Sep 2, 9:48 PM (1 h, 58 m)
Engine
blob
Format
Raw Data
Handle
726065
Attached To
rMCUS Modules.Custom
custom_eh.php
View Options
<?php
defined
(
'FULL_PATH'
)
or
die
(
'restricted access!'
);
/**
* Custom event handler class
*
*/
class
CustomEventHandler
extends
kEventHandler
{
/**
* Connection to database
*
* @var kDBConnection
* @access public
*/
var
$Conn
;
function
CustomEventHandler
()
{
parent
::
kBase
();
$this
->
Conn
=&
$this
->
Application
->
GetADODBConnection
();
}
/**
* [HOOK] Override cloned sub-items (ie. register extended classes for clones from Reviews, Images)
*
* @param kEvent $event
*/
function
OnOverrideClonedSubItems
(&
$event
)
{
# register EReviewEventHandler class as extented from cloned ReviewEventHandler for article reviews ("n" prefix)
// $this->Application->registerClass('EReviewEventHandler', dirname(__FILE__) . '/reviews/e_review_eh.php', 'n-rev_EventHandler');
}
/**
* [HOOK] Modify config stored in "categories_config.php" without extending CategoriesEventHandler class
*
* @param kEvent $event
*/
function
OnModifyCategoriesConfig
(&
$event
)
{
# get Fields configuration from /core/units/categories/categories_config.php
$fields
=
$this
->
Application
->
getUnitOption
(
$event
->
MasterEvent
->
Prefix
,
'Fields'
);
# set configuration fields
$this
->
Application
->
setUnitOption
(
$event
->
MasterEvent
->
Prefix
,
'Fields'
,
$fields
);
}
}
Event Timeline
Log In to Comment