rhymix/addons/tccommentnotify/tccommentnotify.addon.php
haneul 008840f5c4 17310086
module이 없는 경우에 애드온 활성화되면 아예 생성이 안되는 문제 해결


git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4558 201d5d3c-b55e-5fd7-737f-ddc643e51545
2008-09-25 06:56:50 +00:00

38 lines
971 B
PHP

<?php
if(!defined("__ZBXE__")) exit();
if(Context::getRequestMethod() == "XMLRPC" || Context::getResponseMethod() == "XMLRPC")
{
return;
}
if(Context::getRequestMethod() == "POST" && $called_position == 'before_module_proc') {
$mode = $_REQUEST['mode'];
if(!$mode || $mode != "fb")
{
return;
}
$oController = &getController('tccommentnotify');
if(!$oController) return;
$oController->procNotifyReceived();
return;
}
if($called_position == "after_module_proc")
{
$oModel = &getModel('tccommentnotify');
if(!$oModel) return;
if($oModel->checkShouldNotify())
{
$scriptCode = <<<EndOfScript
<script type="text/javascript">
// <![CDATA[
exec_xml("tccommentnotify", "procDoNotify");
// ]]>
</script>
EndOfScript;
Context::addHtmlHeader($scriptCode);
}
}
?>