本文整理汇总了PHP中Events::CreateEvent方法的典型用法代码示例。如果您正苦于以下问题:PHP Events::CreateEvent方法的具体用法?PHP Events::CreateEvent怎么用?PHP Events::CreateEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Events
的用法示例。
在下文中一共展示了Events::CreateEvent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SetupCoreEvents
/**
* Used to setup all core event on system installation.
*
* @ignore
* @return void
*/
public static function SetupCoreEvents()
{
$modulename = 'Core';
Events::CreateEvent($modulename, 'LoginPost');
Events::CreateEvent($modulename, 'LogoutPost');
Events::CreateEvent($modulename, 'AddUserPre');
Events::CreateEvent($modulename, 'AddUserPost');
Events::CreateEvent($modulename, 'EditUserPre');
Events::CreateEvent($modulename, 'EditUserPost');
Events::CreateEvent($modulename, 'DeleteUserPre');
Events::CreateEvent($modulename, 'DeleteUserPost');
Events::CreateEvent($modulename, 'AddGroupPre');
Events::CreateEvent($modulename, 'AddGroupPost');
Events::CreateEvent($modulename, 'EditGroupPre');
Events::CreateEvent($modulename, 'EditGroupPost');
Events::CreateEvent($modulename, 'DeleteGroupPre');
Events::CreateEvent($modulename, 'DeleteGroupPost');
Events::CreateEvent($modulename, 'AddStylesheetPre');
Events::CreateEvent($modulename, 'AddStylesheetPost');
Events::CreateEvent($modulename, 'EditStylesheetPre');
Events::CreateEvent($modulename, 'EditStylesheetPost');
Events::CreateEvent($modulename, 'DeleteStylesheetPre');
Events::CreateEvent($modulename, 'DeleteStylesheetPost');
Events::CreateEvent($modulename, 'AddTemplatePre');
Events::CreateEvent($modulename, 'AddTemplatePost');
Events::CreateEvent($modulename, 'EditTemplatePre');
Events::CreateEvent($modulename, 'EditTemplatePost');
Events::CreateEvent($modulename, 'DeleteTemplatePre');
Events::CreateEvent($modulename, 'DeleteTemplatePost');
Events::CreateEvent($modulename, 'TemplatePreCompile');
Events::CreateEvent($modulename, 'TemplatePostCompile');
Events::CreateEvent($modulename, 'AddGlobalContentPre');
Events::CreateEvent($modulename, 'AddGlobalContentPost');
Events::CreateEvent($modulename, 'EditGlobalContentPre');
Events::CreateEvent($modulename, 'EditGlobalContentPost');
Events::CreateEvent($modulename, 'DeleteGlobalContentPre');
Events::CreateEvent($modulename, 'DeleteGlobalContentPost');
Events::CreateEvent($modulename, 'GlobalContentPreCompile');
Events::CreateEvent($modulename, 'GlobalContentPostCompile');
Events::CreateEvent($modulename, 'ContentEditPre');
Events::CreateEvent($modulename, 'ContentEditPost');
Events::CreateEvent($modulename, 'ContentDeletePre');
Events::CreateEvent($modulename, 'ContentDeletePost');
Events::CreateEvent($modulename, 'AddUserDefinedTagPre');
Events::CreateEvent($modulename, 'AddUserDefinedTagPost');
Events::CreateEvent($modulename, 'EditUserDefinedTagPre');
Events::CreateEvent($modulename, 'EditUserDefinedTagPost');
Events::CreateEvent($modulename, 'DeleteUserDefinedTagPre');
Events::CreateEvent($modulename, 'DeleteUserDefinedTagPost');
Events::CreateEvent($modulename, 'ModuleInstalled');
Events::CreateEvent($modulename, 'ModuleUninstalled');
Events::CreateEvent($modulename, 'ModuleUpgraded');
Events::CreateEvent($modulename, 'ContentStylesheet');
Events::CreateEvent($modulename, 'ContentPreCompile');
Events::CreateEvent($modulename, 'ContentPostCompile');
Events::CreateEvent($modulename, 'ContentPostRender');
Events::CreateEvent($modulename, 'SmartyPreCompile');
Events::CreateEvent($modulename, 'SmartyPostCompile');
Events::CreateEvent($modulename, 'ChangeGroupAssignPre');
Events::CreateEvent($modulename, 'ChangeGroupAssignPost');
}
示例2: CreateEvent
/**
* Inform the system about a new event that can be generated
*
* @final
* @param string The name of the event
* @returns nothing
*/
public final function CreateEvent($eventname)
{
Events::CreateEvent($this->GetName(), $eventname);
}
示例3: CreateEvent
function CreateEvent($inputs)
{
include "Events.php";
$event = new Events();
$event->CreateEvent($inputs[0]);
}
示例4: cms_db_prefix
// move all the handlers
$q = "UPDATE " . cms_db_prefix() . "event_handlers SET event_id = ? WHERE event_id = ?";
$db->Execute($q, array($id, $event['event_id']));
// then delete the event
$q = "DELETE FROM " . cms_db_prefix() . "events WHERE event_id = ?";
$db->Execute($q, array($event['event_id']));
} else {
$core_events[] = $event;
}
}
}
}
echo '[done]</p>';
echo '<p>Creating ChangeGroupAssign events...';
Events::CreateEvent('Core', 'ChangeGroupAssignPre');
Events::CreateEvent('Core', 'ChangeGroupAssignPost');
echo '[done]</p>';
echo '<p>Updating schema version... ';
$query = 'UPDATE ' . cms_db_prefix() . 'version SET version = 26';
$db->Execute($query);
echo '[done]</p>';
function find_event($arr, $name)
{
foreach ($arr as $event) {
if ($event['event_name'] == $name) {
return $event['event_id'];
}
}
return false;
}
# vim:ts=4 sw=4 noet