mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-22 12:49:55 +09:00
Author name update.
NHN developers@xpressengine.com http://xpressengine.com/ git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7676 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
7d1fa86e5c
commit
8f385a592b
603 changed files with 67379 additions and 67522 deletions
|
|
@ -1,127 +1,127 @@
|
|||
<?php
|
||||
/**
|
||||
* @class syndicationController
|
||||
* @author zero (skklove@gmail.com)
|
||||
* @brief syndication 모듈의 Controller class
|
||||
**/
|
||||
|
||||
class syndicationController extends syndication {
|
||||
|
||||
function triggerInsertDocument(&$obj) {
|
||||
if($obj->module_srl < 1) return new Object();
|
||||
|
||||
$oSyndicationModel = &getModel('syndication');
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
if($oSyndicationModel->isExceptedModules($obj->module_srl)) return new Object();
|
||||
|
||||
$config = $oModuleModel->getModuleConfig('syndication');
|
||||
|
||||
$id = $oSyndicationModel->getID('channel', $obj->module_srl);
|
||||
$this->ping($id, 'article');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
function triggerUpdateDocument(&$obj) {
|
||||
if($obj->module_srl < 1) return new Object();
|
||||
|
||||
$oSyndicationModel = &getModel('syndication');
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
if($oSyndicationModel->isExceptedModules($obj->module_srl)) return new Object();
|
||||
|
||||
$config = $oModuleModel->getModuleConfig('syndication');
|
||||
|
||||
$id = $oSyndicationModel->getID('channel', $obj->module_srl);
|
||||
$this->ping($id, 'article');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
function triggerDeleteDocument(&$obj) {
|
||||
if($obj->module_srl < 1) return new Object();
|
||||
|
||||
$oSyndicationModel = &getModel('syndication');
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
if($oSyndicationModel->isExceptedModules($obj->module_srl)) return new Object();
|
||||
|
||||
$this->insertLog($obj->module_srl, $obj->document_srl, $obj->title, $obj->content);
|
||||
|
||||
$id = $oSyndicationModel->getID('channel', $obj->module_srl);
|
||||
$this->ping($id, 'deleted');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
function triggerDeleteModule(&$obj) {
|
||||
$oSyndicationModel = &getModel('syndication');
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
if($oSyndicationModel->isExceptedModules($obj->module_srl)) return new Object();
|
||||
|
||||
$this->insertLog($obj->module_srl, $obj->document_srl, $obj->title, $obj->content);
|
||||
|
||||
$output = executeQuery('syndication.getExceptModule', $obj);
|
||||
if($output->data->count) return new Object();
|
||||
|
||||
$id = $oSyndicationModel->getID('site', $obj->module_srl);
|
||||
$this->ping($id, 'deleted');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
function triggerMoveDocumentToTrash(&$obj) {
|
||||
$document_srl = $obj->document_srl;
|
||||
$module_srl = $obj->module_srl;
|
||||
|
||||
$oSyndicationModel = &getModel('syndication');
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
if($oSyndicationModel->isExceptedModules($module_srl)) return new Object();
|
||||
|
||||
$id = $oSyndicationModel->getID('channel', $module_srl);
|
||||
$this->ping($id, 'deleted');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
function triggerRestoreTrash(&$obj) {
|
||||
$document_srl = $obj->document_srl;
|
||||
$module_srl = $obj->module_srl;
|
||||
|
||||
$oSyndicationModel = &getModel('syndication');
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
if($oSyndicationModel->isExceptedModules($module_srl)) return new Object();
|
||||
|
||||
$id = $oSyndicationModel->getID('article', $module_srl.'-'.$document_srl);
|
||||
$this->ping($id, 'article');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
function insertLog($module_srl, $document_srl, $title = null, $summary = null) {
|
||||
$args->module_srl = $module_srl;
|
||||
$args->document_srl = $document_srl;
|
||||
$args->title = $title;
|
||||
$args->summary = $summary;
|
||||
$output = executeQuery('syndication.insertLog', $args);
|
||||
}
|
||||
|
||||
function ping($id, $type) {
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('syndication');
|
||||
|
||||
if(!count($config->target_services)) return;
|
||||
if(substr($config->site_url,-1)!='/') $config->site_url .= '/';
|
||||
foreach($config->target_services as $key => $val) {
|
||||
$ping_url = trim($this->services[$val]);
|
||||
if(!$ping_url) continue;
|
||||
$ping_body = sprintf('http://%s?module=syndication&act=getSyndicationList&id=%s&type=%s', $config->site_url, $id, $type);
|
||||
FileHandler::getRemoteResource($ping_url, null, 3, 'POST', 'application/x-www-form-urlencoded', array(), array(), array('link'=>$ping_body));
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* @class syndicationController
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief syndication 모듈의 Controller class
|
||||
**/
|
||||
|
||||
class syndicationController extends syndication {
|
||||
|
||||
function triggerInsertDocument(&$obj) {
|
||||
if($obj->module_srl < 1) return new Object();
|
||||
|
||||
$oSyndicationModel = &getModel('syndication');
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
if($oSyndicationModel->isExceptedModules($obj->module_srl)) return new Object();
|
||||
|
||||
$config = $oModuleModel->getModuleConfig('syndication');
|
||||
|
||||
$id = $oSyndicationModel->getID('channel', $obj->module_srl);
|
||||
$this->ping($id, 'article');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
function triggerUpdateDocument(&$obj) {
|
||||
if($obj->module_srl < 1) return new Object();
|
||||
|
||||
$oSyndicationModel = &getModel('syndication');
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
if($oSyndicationModel->isExceptedModules($obj->module_srl)) return new Object();
|
||||
|
||||
$config = $oModuleModel->getModuleConfig('syndication');
|
||||
|
||||
$id = $oSyndicationModel->getID('channel', $obj->module_srl);
|
||||
$this->ping($id, 'article');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
function triggerDeleteDocument(&$obj) {
|
||||
if($obj->module_srl < 1) return new Object();
|
||||
|
||||
$oSyndicationModel = &getModel('syndication');
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
if($oSyndicationModel->isExceptedModules($obj->module_srl)) return new Object();
|
||||
|
||||
$this->insertLog($obj->module_srl, $obj->document_srl, $obj->title, $obj->content);
|
||||
|
||||
$id = $oSyndicationModel->getID('channel', $obj->module_srl);
|
||||
$this->ping($id, 'deleted');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
function triggerDeleteModule(&$obj) {
|
||||
$oSyndicationModel = &getModel('syndication');
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
if($oSyndicationModel->isExceptedModules($obj->module_srl)) return new Object();
|
||||
|
||||
$this->insertLog($obj->module_srl, $obj->document_srl, $obj->title, $obj->content);
|
||||
|
||||
$output = executeQuery('syndication.getExceptModule', $obj);
|
||||
if($output->data->count) return new Object();
|
||||
|
||||
$id = $oSyndicationModel->getID('site', $obj->module_srl);
|
||||
$this->ping($id, 'deleted');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
function triggerMoveDocumentToTrash(&$obj) {
|
||||
$document_srl = $obj->document_srl;
|
||||
$module_srl = $obj->module_srl;
|
||||
|
||||
$oSyndicationModel = &getModel('syndication');
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
if($oSyndicationModel->isExceptedModules($module_srl)) return new Object();
|
||||
|
||||
$id = $oSyndicationModel->getID('channel', $module_srl);
|
||||
$this->ping($id, 'deleted');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
function triggerRestoreTrash(&$obj) {
|
||||
$document_srl = $obj->document_srl;
|
||||
$module_srl = $obj->module_srl;
|
||||
|
||||
$oSyndicationModel = &getModel('syndication');
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
if($oSyndicationModel->isExceptedModules($module_srl)) return new Object();
|
||||
|
||||
$id = $oSyndicationModel->getID('article', $module_srl.'-'.$document_srl);
|
||||
$this->ping($id, 'article');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
function insertLog($module_srl, $document_srl, $title = null, $summary = null) {
|
||||
$args->module_srl = $module_srl;
|
||||
$args->document_srl = $document_srl;
|
||||
$args->title = $title;
|
||||
$args->summary = $summary;
|
||||
$output = executeQuery('syndication.insertLog', $args);
|
||||
}
|
||||
|
||||
function ping($id, $type) {
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('syndication');
|
||||
|
||||
if(!count($config->target_services)) return;
|
||||
if(substr($config->site_url,-1)!='/') $config->site_url .= '/';
|
||||
foreach($config->target_services as $key => $val) {
|
||||
$ping_url = trim($this->services[$val]);
|
||||
if(!$ping_url) continue;
|
||||
$ping_body = sprintf('http://%s?module=syndication&act=getSyndicationList&id=%s&type=%s', $config->site_url, $id, $type);
|
||||
FileHandler::getRemoteResource($ping_url, null, 3, 'POST', 'application/x-www-form-urlencoded', array(), array(), array('link'=>$ping_body));
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue