mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 11:44:10 +09:00
Clean up legacy class references in comment and document controllers
This commit is contained in:
parent
6219a381a4
commit
8940dd92ef
2 changed files with 31 additions and 40 deletions
|
|
@ -460,8 +460,8 @@ class CommentController extends Comment
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$oCommentController = getAdminController('comment');
|
$oCommentAdminController = CommentAdminController::getInstance();
|
||||||
return $oCommentController->deleteModuleComments($module_srl);
|
return $oCommentAdminController->deleteModuleComments($module_srl);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -672,7 +672,7 @@ class CommentController extends Comment
|
||||||
// if use editor of nohtml, Remove HTML tags from the contents.
|
// if use editor of nohtml, Remove HTML tags from the contents.
|
||||||
if(!$manual_inserted || isset($obj->allow_html) || isset($obj->use_html))
|
if(!$manual_inserted || isset($obj->allow_html) || isset($obj->use_html))
|
||||||
{
|
{
|
||||||
$obj->content = getModel('editor')->converter($obj, 'comment');
|
$obj->content = EditorModel::converter($obj, 'comment');
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove iframe and script if not a top administrator on the session.
|
// remove iframe and script if not a top administrator on the session.
|
||||||
|
|
@ -770,10 +770,8 @@ class CommentController extends Comment
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
// create the controller object of the document
|
|
||||||
$oDocumentController = getController('document');
|
|
||||||
|
|
||||||
// Update the number of comments in the post
|
// Update the number of comments in the post
|
||||||
|
$oDocumentController = DocumentController::getInstance();
|
||||||
$comment_count = CommentModel::getCommentCount($document_srl);
|
$comment_count = CommentModel::getCommentCount($document_srl);
|
||||||
if($comment_count && (!$using_validation || $is_admin))
|
if($comment_count && (!$using_validation || $is_admin))
|
||||||
{
|
{
|
||||||
|
|
@ -782,7 +780,7 @@ class CommentController extends Comment
|
||||||
|
|
||||||
if($obj->uploaded_count > 0)
|
if($obj->uploaded_count > 0)
|
||||||
{
|
{
|
||||||
$attachOutput = getController('file')->setFilesValid($obj->comment_srl, 'com');
|
$attachOutput = FileController::getInstance()->setFilesValid($obj->comment_srl, 'com');
|
||||||
if(!$attachOutput->toBool())
|
if(!$attachOutput->toBool())
|
||||||
{
|
{
|
||||||
$oDB->rollback();
|
$oDB->rollback();
|
||||||
|
|
@ -1012,7 +1010,7 @@ class CommentController extends Comment
|
||||||
// if use editor of nohtml, Remove HTML tags from the contents.
|
// if use editor of nohtml, Remove HTML tags from the contents.
|
||||||
if(!$manual_updated || isset($obj->allow_html) || isset($obj->use_html))
|
if(!$manual_updated || isset($obj->allow_html) || isset($obj->use_html))
|
||||||
{
|
{
|
||||||
$obj->content = getModel('editor')->converter($obj, 'comment');
|
$obj->content = EditorModel::converter($obj, 'comment');
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove iframe and script if not a top administrator on the session
|
// remove iframe and script if not a top administrator on the session
|
||||||
|
|
@ -1037,7 +1035,7 @@ class CommentController extends Comment
|
||||||
|
|
||||||
if($obj->uploaded_count > 0)
|
if($obj->uploaded_count > 0)
|
||||||
{
|
{
|
||||||
$attachOutput = getController('file')->setFilesValid($obj->comment_srl, 'com');
|
$attachOutput = FileController::getInstance()->setFilesValid($obj->comment_srl, 'com');
|
||||||
if(!$attachOutput->toBool())
|
if(!$attachOutput->toBool())
|
||||||
{
|
{
|
||||||
$oDB->rollback();
|
$oDB->rollback();
|
||||||
|
|
@ -1126,10 +1124,8 @@ class CommentController extends Comment
|
||||||
// only document is exists
|
// only document is exists
|
||||||
if(is_int($comment_count))
|
if(is_int($comment_count))
|
||||||
{
|
{
|
||||||
// create the controller object of the document
|
|
||||||
$oDocumentController = getController('document');
|
|
||||||
|
|
||||||
// update comment count of the article posting
|
// update comment count of the article posting
|
||||||
|
$oDocumentController = DocumentController::getInstance();
|
||||||
$output = $oDocumentController->updateCommentCount($obj->document_srl, $comment_count, NULL, FALSE);
|
$output = $oDocumentController->updateCommentCount($obj->document_srl, $comment_count, NULL, FALSE);
|
||||||
if(!$output->toBool())
|
if(!$output->toBool())
|
||||||
{
|
{
|
||||||
|
|
@ -1170,10 +1166,8 @@ class CommentController extends Comment
|
||||||
// only document is exists
|
// only document is exists
|
||||||
if(is_int($comment_count))
|
if(is_int($comment_count))
|
||||||
{
|
{
|
||||||
// create the controller object of the document
|
|
||||||
$oDocumentController = getController('document');
|
|
||||||
|
|
||||||
// update comment count of the article posting
|
// update comment count of the article posting
|
||||||
|
$oDocumentController = DocumentController::getInstance();
|
||||||
$output = $oDocumentController->updateCommentCount($obj->document_srl, $comment_count, NULL, FALSE);
|
$output = $oDocumentController->updateCommentCount($obj->document_srl, $comment_count, NULL, FALSE);
|
||||||
if(!$output->toBool())
|
if(!$output->toBool())
|
||||||
{
|
{
|
||||||
|
|
@ -1301,10 +1295,8 @@ class CommentController extends Comment
|
||||||
// only document is exists
|
// only document is exists
|
||||||
if(is_int($comment_count))
|
if(is_int($comment_count))
|
||||||
{
|
{
|
||||||
// create the controller object of the document
|
|
||||||
$oDocumentController = getController('document');
|
|
||||||
|
|
||||||
// update comment count of the article posting
|
// update comment count of the article posting
|
||||||
|
$oDocumentController = DocumentController::getInstance();
|
||||||
$output = $oDocumentController->updateCommentCount($document_srl, $comment_count, NULL, FALSE);
|
$output = $oDocumentController->updateCommentCount($document_srl, $comment_count, NULL, FALSE);
|
||||||
if(!$output->toBool())
|
if(!$output->toBool())
|
||||||
{
|
{
|
||||||
|
|
@ -1390,7 +1382,7 @@ class CommentController extends Comment
|
||||||
$oDB = DB::getInstance();
|
$oDB = DB::getInstance();
|
||||||
$oDB->begin();
|
$oDB->begin();
|
||||||
|
|
||||||
$oTrashAdminController = getAdminController('trash');
|
$oTrashAdminController = TrashAdminController::getInstance();
|
||||||
$output = $oTrashAdminController->insertTrash($oTrashVO);
|
$output = $oTrashAdminController->insertTrash($oTrashVO);
|
||||||
if(!$output->toBool())
|
if(!$output->toBool())
|
||||||
{
|
{
|
||||||
|
|
@ -1420,7 +1412,8 @@ class CommentController extends Comment
|
||||||
$comment_count = CommentModel::getCommentCount($oComment->document_srl);
|
$comment_count = CommentModel::getCommentCount($oComment->document_srl);
|
||||||
if(is_int($comment_count))
|
if(is_int($comment_count))
|
||||||
{
|
{
|
||||||
$output = getController('document')->updateCommentCount($oComment->document_srl, $comment_count);
|
$oDocumentController = DocumentController::getInstance();
|
||||||
|
$output = $oDocumentController->updateCommentCount($oComment->document_srl, $comment_count);
|
||||||
if(!$output->toBool())
|
if(!$output->toBool())
|
||||||
{
|
{
|
||||||
$oDB->rollback();
|
$oDB->rollback();
|
||||||
|
|
@ -1821,7 +1814,7 @@ class CommentController extends Comment
|
||||||
}
|
}
|
||||||
if ($message_targets)
|
if ($message_targets)
|
||||||
{
|
{
|
||||||
$oCommunicationController = getController('communication');
|
$oCommunicationController = CommunicationController::getInstance();
|
||||||
$message_title = lang('document.declared_message_title');
|
$message_title = lang('document.declared_message_title');
|
||||||
$message_content = sprintf('<p><a href="%s">%s</a></p><p>%s</p>', $oComment->getPermanentUrl(), $oComment->getContentText(50), $declare_message);
|
$message_content = sprintf('<p><a href="%s">%s</a></p><p>%s</p>', $oComment->getPermanentUrl(), $oComment->getContentText(50), $declare_message);
|
||||||
foreach ($message_targets as $target_member_srl => $val)
|
foreach ($message_targets as $target_member_srl => $val)
|
||||||
|
|
@ -1938,7 +1931,7 @@ class CommentController extends Comment
|
||||||
}
|
}
|
||||||
if ($message_targets)
|
if ($message_targets)
|
||||||
{
|
{
|
||||||
$oCommunicationController = getController('communication');
|
$oCommunicationController = CommunicationController::getInstance();
|
||||||
$message_title = lang('document.declared_cancel_message_title');
|
$message_title = lang('document.declared_cancel_message_title');
|
||||||
$message_content = sprintf('<p><a href="%s">%s</a></p>', $oComment->getPermanentUrl(), $oComment->getContentText(50));
|
$message_content = sprintf('<p><a href="%s">%s</a></p>', $oComment->getPermanentUrl(), $oComment->getContentText(50));
|
||||||
foreach ($message_targets as $target_member_srl => $val)
|
foreach ($message_targets as $target_member_srl => $val)
|
||||||
|
|
@ -2087,7 +2080,7 @@ class CommentController extends Comment
|
||||||
*/
|
*/
|
||||||
function setCommentModuleConfig($srl, $comment_config)
|
function setCommentModuleConfig($srl, $comment_config)
|
||||||
{
|
{
|
||||||
$oModuleController = getController('module');
|
$oModuleController = ModuleController::getInstance();
|
||||||
$oModuleController->insertModulePartConfig('comment', $srl, $comment_config);
|
$oModuleController->insertModulePartConfig('comment', $srl, $comment_config);
|
||||||
return new BaseObject();
|
return new BaseObject();
|
||||||
}
|
}
|
||||||
|
|
@ -2176,7 +2169,7 @@ class CommentController extends Comment
|
||||||
{
|
{
|
||||||
$commentConfig = ModuleModel::getModulePartConfig('comment', $obj->originModuleSrl);
|
$commentConfig = ModuleModel::getModulePartConfig('comment', $obj->originModuleSrl);
|
||||||
|
|
||||||
$oModuleController = getController('module');
|
$oModuleController = ModuleController::getInstance();
|
||||||
if(is_array($obj->moduleSrlList))
|
if(is_array($obj->moduleSrlList))
|
||||||
{
|
{
|
||||||
foreach($obj->moduleSrlList as $moduleSrl)
|
foreach($obj->moduleSrlList as $moduleSrl)
|
||||||
|
|
|
||||||
|
|
@ -559,12 +559,11 @@ class DocumentController extends Document
|
||||||
$module_srl = $obj->module_srl;
|
$module_srl = $obj->module_srl;
|
||||||
if(!$module_srl) return;
|
if(!$module_srl) return;
|
||||||
// Delete the document
|
// Delete the document
|
||||||
$oDocumentAdminController = getAdminController('document');
|
$oDocumentAdminController = DocumentAdminController::getInstance();
|
||||||
$output = $oDocumentAdminController->deleteModuleDocument($module_srl);
|
$output = $oDocumentAdminController->deleteModuleDocument($module_srl);
|
||||||
if(!$output->toBool()) return $output;
|
if(!$output->toBool()) return $output;
|
||||||
// Delete the category
|
// Delete the category
|
||||||
$oDocumentController = getController('document');
|
$output = $this->deleteModuleCategory($module_srl);
|
||||||
$output = $oDocumentController->deleteModuleCategory($module_srl);
|
|
||||||
if(!$output->toBool()) return $output;
|
if(!$output->toBool()) return $output;
|
||||||
// Delete extra key and variable, because module deleted
|
// Delete extra key and variable, because module deleted
|
||||||
$this->deleteDocumentExtraKeys($module_srl);
|
$this->deleteDocumentExtraKeys($module_srl);
|
||||||
|
|
@ -757,7 +756,7 @@ class DocumentController extends Document
|
||||||
// if use editor of nohtml, Remove HTML tags from the contents.
|
// if use editor of nohtml, Remove HTML tags from the contents.
|
||||||
if(!$manual_inserted || isset($obj->allow_html) || isset($obj->use_html))
|
if(!$manual_inserted || isset($obj->allow_html) || isset($obj->use_html))
|
||||||
{
|
{
|
||||||
$obj->content = getModel('editor')->converter($obj, 'document');
|
$obj->content = EditorModel::converter($obj, 'document');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove iframe and script if not a top adminisrator in the session.
|
// Remove iframe and script if not a top adminisrator in the session.
|
||||||
|
|
@ -836,7 +835,7 @@ class DocumentController extends Document
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$attachOutput = getController('file')->setFilesValid($obj->document_srl, 'doc');
|
$attachOutput = FileController::getInstance()->setFilesValid($obj->document_srl, 'doc');
|
||||||
if(!$attachOutput->toBool())
|
if(!$attachOutput->toBool())
|
||||||
{
|
{
|
||||||
$oDB->rollback();
|
$oDB->rollback();
|
||||||
|
|
@ -1032,7 +1031,7 @@ class DocumentController extends Document
|
||||||
// if use editor of nohtml, Remove HTML tags from the contents.
|
// if use editor of nohtml, Remove HTML tags from the contents.
|
||||||
if(!$manual_updated || isset($obj->allow_html) || isset($obj->use_html))
|
if(!$manual_updated || isset($obj->allow_html) || isset($obj->use_html))
|
||||||
{
|
{
|
||||||
$obj->content = getModel('editor')->converter($obj, 'document');
|
$obj->content = EditorModel::converter($obj, 'document');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove iframe and script if not a top adminisrator in the session.
|
// Remove iframe and script if not a top adminisrator in the session.
|
||||||
|
|
@ -1170,7 +1169,7 @@ class DocumentController extends Document
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update attached file count
|
// Update attached file count
|
||||||
$attachOutput = getController('file')->setFilesValid($obj->document_srl, 'doc');
|
$attachOutput = FileController::getInstance()->setFilesValid($obj->document_srl, 'doc');
|
||||||
if(!$attachOutput->toBool())
|
if(!$attachOutput->toBool())
|
||||||
{
|
{
|
||||||
$oDB->rollback();
|
$oDB->rollback();
|
||||||
|
|
@ -1406,7 +1405,7 @@ class DocumentController extends Document
|
||||||
$oDB = DB::getInstance();
|
$oDB = DB::getInstance();
|
||||||
$oDB->begin();
|
$oDB->begin();
|
||||||
|
|
||||||
$oTrashAdminController = getAdminController('trash');
|
$oTrashAdminController = TrashAdminController::getInstance();
|
||||||
$output = $oTrashAdminController->insertTrash($oTrashVO);
|
$output = $oTrashAdminController->insertTrash($oTrashVO);
|
||||||
if(!$output->toBool())
|
if(!$output->toBool())
|
||||||
{
|
{
|
||||||
|
|
@ -2060,7 +2059,7 @@ class DocumentController extends Document
|
||||||
}
|
}
|
||||||
if ($message_targets)
|
if ($message_targets)
|
||||||
{
|
{
|
||||||
$oCommunicationController = getController('communication');
|
$oCommunicationController = CommunicationController::getInstance();
|
||||||
$message_title = lang('document.declared_message_title');
|
$message_title = lang('document.declared_message_title');
|
||||||
$message_content = sprintf('<p><a href="%s">%s</a></p><p>%s</p>', $oDocument->getPermanentUrl(), $oDocument->getTitleText(), $declare_message);
|
$message_content = sprintf('<p><a href="%s">%s</a></p><p>%s</p>', $oDocument->getPermanentUrl(), $oDocument->getTitleText(), $declare_message);
|
||||||
foreach ($message_targets as $target_member_srl => $val)
|
foreach ($message_targets as $target_member_srl => $val)
|
||||||
|
|
@ -2176,7 +2175,7 @@ class DocumentController extends Document
|
||||||
}
|
}
|
||||||
if ($message_targets)
|
if ($message_targets)
|
||||||
{
|
{
|
||||||
$oCommunicationController = getController('communication');
|
$oCommunicationController = CommunicationController::getInstance();
|
||||||
$message_title = lang('document.declared_cancel_message_title');
|
$message_title = lang('document.declared_cancel_message_title');
|
||||||
$message_content = sprintf('<p><a href="%s">%s</a></p>', $oDocument->getPermanentUrl(), $oDocument->getTitleText());
|
$message_content = sprintf('<p><a href="%s">%s</a></p>', $oDocument->getPermanentUrl(), $oDocument->getTitleText());
|
||||||
foreach ($message_targets as $target_member_srl => $val)
|
foreach ($message_targets as $target_member_srl => $val)
|
||||||
|
|
@ -3159,7 +3158,7 @@ class DocumentController extends Document
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
$oController = getAdminController('document');
|
$oController = DocumentAdminController::getInstance();
|
||||||
if($obj->type == 'move')
|
if($obj->type == 'move')
|
||||||
{
|
{
|
||||||
if(!$obj->target_module_srl)
|
if(!$obj->target_module_srl)
|
||||||
|
|
@ -3274,7 +3273,7 @@ Content;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send
|
// Send
|
||||||
$oCommunicationController = getController('communication');
|
$oCommunicationController = CommunicationController::getInstance();
|
||||||
foreach ($recipients as $member_srl => $items)
|
foreach ($recipients as $member_srl => $items)
|
||||||
{
|
{
|
||||||
$oCommunicationController->sendMessage($this->user->member_srl, $member_srl, $title, sprintf($content, implode('', $items)), true, null, false);
|
$oCommunicationController->sendMessage($this->user->member_srl, $member_srl, $title, sprintf($content, implode('', $items)), true, null, false);
|
||||||
|
|
@ -3345,7 +3344,7 @@ Content;
|
||||||
if(!is_array($document_config->declared_message)) $document_config->declared_message = array();
|
if(!is_array($document_config->declared_message)) $document_config->declared_message = array();
|
||||||
$document_config->declared_message = array_values($document_config->declared_message);
|
$document_config->declared_message = array_values($document_config->declared_message);
|
||||||
|
|
||||||
$oModuleController = getController('module');
|
$oModuleController = ModuleController::getInstance();
|
||||||
foreach ($module_srl as $srl)
|
foreach ($module_srl as $srl)
|
||||||
{
|
{
|
||||||
$output = $oModuleController->insertModulePartConfig('document',$srl,$document_config);
|
$output = $oModuleController->insertModulePartConfig('document',$srl,$document_config);
|
||||||
|
|
@ -3562,12 +3561,11 @@ Content;
|
||||||
|
|
||||||
if(is_array($documentExtraKeys) && is_array($obj->moduleSrlList))
|
if(is_array($documentExtraKeys) && is_array($obj->moduleSrlList))
|
||||||
{
|
{
|
||||||
$oDocumentController=getController('document');
|
|
||||||
foreach($obj->moduleSrlList AS $key=>$value)
|
foreach($obj->moduleSrlList AS $key=>$value)
|
||||||
{
|
{
|
||||||
foreach($documentExtraKeys AS $extraItem)
|
foreach($documentExtraKeys AS $extraItem)
|
||||||
{
|
{
|
||||||
$oDocumentController->insertDocumentExtraKey($value, $extraItem->idx, $extraItem->name, $extraItem->type, $extraItem->is_required , $extraItem->search , $extraItem->default , $extraItem->desc, $extraItem->eid) ;
|
$this->insertDocumentExtraKey($value, $extraItem->idx, $extraItem->name, $extraItem->type, $extraItem->is_required , $extraItem->search , $extraItem->default , $extraItem->desc, $extraItem->eid) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3577,7 +3575,7 @@ Content;
|
||||||
{
|
{
|
||||||
$documentConfig = ModuleModel::getModulePartConfig('document', $obj->originModuleSrl);
|
$documentConfig = ModuleModel::getModulePartConfig('document', $obj->originModuleSrl);
|
||||||
|
|
||||||
$oModuleController = getController('module');
|
$oModuleController = ModuleController::getInstance();
|
||||||
if(is_array($obj->moduleSrlList))
|
if(is_array($obj->moduleSrlList))
|
||||||
{
|
{
|
||||||
foreach($obj->moduleSrlList AS $key=>$moduleSrl)
|
foreach($obj->moduleSrlList AS $key=>$moduleSrl)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue