mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Remove module update scripts from XE 1.7 and before
XE 1.7 이하 버전에서 테이블 스키마 조정, 인덱스 추가, 임시파일 처리 등을 위해 만들어 놓은 업데이트 스크립트를 대부분 제거하여 처리 효율을 향상시킵니다. 이 중 대부분은 XE 개발 초창기(1.2 이전) 스키마 변경이 빈번하던 시절에 하위호환성을 위해 추가된 것으로, 이미 10년 이상 불필요한 상태였습니다. 단, 앞으로는 XE 1.8 미만 버전에서 라이믹스로 업데이트하기 어려워질 수 있습니다. XE 1.8 미만 버전을 사용하는 사이트에서는 먼저 XE 최신 버전으로 업데이트한 후 라이믹스를 덮어씌우는 방식으로 진행하여야 합니다.
This commit is contained in:
parent
0f9b96f9b4
commit
1c786d8cd5
9 changed files with 119 additions and 933 deletions
|
|
@ -42,57 +42,29 @@ class comment extends ModuleObject
|
|||
function checkUpdate()
|
||||
{
|
||||
$oDB = DB::getInstance();
|
||||
$oModuleModel = getModel('module');
|
||||
|
||||
// 2007. 10. 17 add a trigger to delete comments together with posting deleted
|
||||
if(!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'))
|
||||
if(!ModuleModel::getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
// 2007. 10. 17 add a trigger to delete all of comments together with module deleted
|
||||
if(!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
// 2007. 10. 23 add a column for recommendation votes or notification of the comments
|
||||
if(!$oDB->isColumnExists("comments", "voted_count"))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
if(!$oDB->isColumnExists("comments", "notify_message"))
|
||||
if(!ModuleModel::getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
// 2008. 02. 22 add comment setting when a new module added
|
||||
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'))
|
||||
if(!ModuleModel::getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
// 2008. 05. 14 add a column for blamed count
|
||||
if(!$oDB->isColumnExists("comments", "blamed_count"))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
if(!$oDB->isColumnExists("comment_voted_log", "point"))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if(!$oDB->isIndexExists("comments", "idx_module_list_order"))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
//2012. 02. 24 add comment published status column and index
|
||||
if(!$oDB->isColumnExists("comments", "status"))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
if(!$oDB->isIndexExists("comments", "idx_status"))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
|
||||
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -114,16 +86,17 @@ class comment extends ModuleObject
|
|||
return true;
|
||||
}
|
||||
|
||||
if(!$oModuleModel->getTrigger('document.moveDocumentModule', 'comment', 'controller', 'triggerMoveDocument', 'after'))
|
||||
// 2018.01.24 Improve mass file deletion
|
||||
if(!ModuleModel::getTrigger('document.moveDocumentModule', 'comment', 'controller', 'triggerMoveDocument', 'after'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if(!$oModuleModel->getTrigger('document.copyDocumentModule', 'comment', 'controller', 'triggerAddCopyDocument', 'add'))
|
||||
if(!ModuleModel::getTrigger('document.copyDocumentModule', 'comment', 'controller', 'triggerAddCopyDocument', 'add'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -133,66 +106,30 @@ class comment extends ModuleObject
|
|||
function moduleUpdate()
|
||||
{
|
||||
$oDB = DB::getInstance();
|
||||
$oModuleModel = getModel('module');
|
||||
$oModuleController = getController('module');
|
||||
|
||||
// 2007. 10. 17 add a trigger to delete comments together with posting deleted
|
||||
if(!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'))
|
||||
if(!ModuleModel::getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after');
|
||||
}
|
||||
// 2007. 10. 17 add a trigger to delete all of comments together with module deleted
|
||||
if(!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'))
|
||||
if(!ModuleModel::getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after');
|
||||
}
|
||||
// 2007. 10. 23 add a column for recommendation votes or notification of the comments
|
||||
if(!$oDB->isColumnExists("comments", "voted_count"))
|
||||
{
|
||||
$oDB->addColumn("comments", "voted_count", "number", "11");
|
||||
$oDB->addIndex("comments", "idx_voted_count", array("voted_count"));
|
||||
}
|
||||
|
||||
if(!$oDB->isColumnExists("comments", "notify_message"))
|
||||
{
|
||||
$oDB->addColumn("comments", "notify_message", "char", "1");
|
||||
}
|
||||
// 2008. 02. 22 add comment setting when a new module added
|
||||
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'))
|
||||
if(!ModuleModel::getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'))
|
||||
{
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before');
|
||||
}
|
||||
// 2008. 05. 14 add a column for blamed count
|
||||
if(!$oDB->isColumnExists("comments", "blamed_count"))
|
||||
{
|
||||
$oDB->addColumn('comments', 'blamed_count', 'number', 11, 0, TRUE);
|
||||
$oDB->addIndex('comments', 'idx_blamed_count', array('blamed_count'));
|
||||
}
|
||||
if(!$oDB->isColumnExists("comment_voted_log", "point"))
|
||||
{
|
||||
$oDB->addColumn('comment_voted_log', 'point', 'number', 11, 0, TRUE);
|
||||
}
|
||||
|
||||
if(!$oDB->isIndexExists("comments", "idx_module_list_order"))
|
||||
{
|
||||
$oDB->addIndex(
|
||||
"comments", "idx_module_list_order", array("module_srl", "list_order"), TRUE
|
||||
);
|
||||
}
|
||||
|
||||
//2012. 02. 24 add comment published status column and index
|
||||
if(!$oDB->isColumnExists("comments", "status"))
|
||||
{
|
||||
$oDB->addColumn("comments", "status", "number", 1, 1, TRUE);
|
||||
}
|
||||
if(!$oDB->isIndexExists("comments", "idx_status"))
|
||||
{
|
||||
$oDB->addIndex(
|
||||
"comments", "idx_status", array("status", "comment_srl", "module_srl", "document_srl"), TRUE
|
||||
);
|
||||
$oDB->addIndex("comments", "idx_module_list_order", array("module_srl", "list_order"), TRUE);
|
||||
}
|
||||
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
|
||||
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after');
|
||||
}
|
||||
|
|
@ -214,11 +151,12 @@ class comment extends ModuleObject
|
|||
$oDB->addIndex('comments', 'idx_nick_name', array('nick_name'));
|
||||
}
|
||||
|
||||
if(!$oModuleModel->getTrigger('document.moveDocumentModule', 'comment', 'controller', 'triggerMoveDocument', 'after'))
|
||||
// 2018.01.24 Improve mass file deletion
|
||||
if(!ModuleModel::getTrigger('document.moveDocumentModule', 'comment', 'controller', 'triggerMoveDocument', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('document.moveDocumentModule', 'comment', 'controller', 'triggerMoveDocument', 'after');
|
||||
}
|
||||
if(!$oModuleModel->getTrigger('document.copyDocumentModule', 'comment', 'controller', 'triggerAddCopyDocument', 'add'))
|
||||
if(!ModuleModel::getTrigger('document.copyDocumentModule', 'comment', 'controller', 'triggerAddCopyDocument', 'add'))
|
||||
{
|
||||
$oModuleController->insertTrigger('document.copyDocumentModule', 'comment', 'controller', 'triggerAddCopyDocument', 'add');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,13 +15,7 @@ class counter extends ModuleObject
|
|||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
$oCounterController = getController('counter');
|
||||
|
||||
// add a row for the total visit history
|
||||
//$oCounterController->insertTotalStatus();
|
||||
|
||||
// add a row for today's status
|
||||
//$oCounterController->insertTodayStatus();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -31,18 +25,6 @@ class counter extends ModuleObject
|
|||
*/
|
||||
function checkUpdate()
|
||||
{
|
||||
// Add site_srl to the counter
|
||||
$oDB = DB::getInstance();
|
||||
if(!$oDB->isColumnExists('counter_log', 'site_srl'))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if(!$oDB->isIndexExists('counter_log', 'idx_site_counter_log'))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -53,18 +35,7 @@ class counter extends ModuleObject
|
|||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
// Add site_srl to the counter
|
||||
$oDB = DB::getInstance();
|
||||
|
||||
if(!$oDB->isColumnExists('counter_log', 'site_srl'))
|
||||
{
|
||||
$oDB->addColumn('counter_log', 'site_srl', 'number', 11, 0, TRUE);
|
||||
}
|
||||
|
||||
if(!$oDB->isIndexExists('counter_log', 'idx_site_counter_log'))
|
||||
{
|
||||
$oDB->addIndex('counter_log', 'idx_site_counter_log', array('site_srl', 'ipaddress'), FALSE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -55,12 +55,9 @@ class document extends ModuleObject
|
|||
* A method to check if successfully installed
|
||||
* @return bool
|
||||
*/
|
||||
function checkUpdate() {
|
||||
$oDB = &DB::getInstance();
|
||||
$oModuleModel = getModel('module');
|
||||
|
||||
// 2007. 7. 25: Add a column(notify_message) for notification
|
||||
if(!$oDB->isColumnExists("documents","notify_message")) return true;
|
||||
function checkUpdate()
|
||||
{
|
||||
$oDB = DB::getInstance();
|
||||
|
||||
// 2007. 8. 23: create a clustered index in the document table
|
||||
if(!$oDB->isIndexExists("documents","idx_module_list_order")) return true;
|
||||
|
|
@ -68,61 +65,37 @@ class document extends ModuleObject
|
|||
if(!$oDB->isIndexExists("documents","idx_module_readed_count")) return true;
|
||||
if(!$oDB->isIndexExists("documents","idx_module_voted_count")) return true;
|
||||
if(!$oDB->isIndexExists("documents","idx_module_regdate")) return true;
|
||||
|
||||
// 2007. 10. 17 Add a trigger to delete all posts together when the module is deleted
|
||||
if(!$oModuleModel->getTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after')) return true;
|
||||
// 2007. 10. 25 add parent_srl, expand to the document category
|
||||
if(!$oDB->isColumnExists("document_categories","parent_srl")) return true;
|
||||
if(!$oDB->isColumnExists("document_categories","expand")) return true;
|
||||
if(!$oDB->isColumnExists("document_categories","group_srls")) return true;
|
||||
if(!ModuleModel::getTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after')) return true;
|
||||
|
||||
// 2007. 11. 20 create a composite index on the columns(module_srl + is_notice)
|
||||
if(!$oDB->isIndexExists("documents","idx_module_notice")) return true;
|
||||
|
||||
// 2008. 02. 18 create a composite index on the columns(module_srl + document_srl) (checked by Manian))
|
||||
if(!$oDB->isIndexExists("documents","idx_module_document_srl")) return true;
|
||||
|
||||
// 2007. 12. 03: Add if the colume(extra_vars) doesn't exist
|
||||
if(!$oDB->isColumnExists("documents","extra_vars")) return true;
|
||||
// 2008. 04. 23 Add a column(blamed_count)
|
||||
if(!$oDB->isColumnExists("documents", "blamed_count")) return true;
|
||||
if(!$oDB->isIndexExists("documents","idx_module_blamed_count")) return true;
|
||||
if(!$oDB->isColumnExists("document_voted_log", "point")) return true;
|
||||
// 2008-12-15 Add a column(color)
|
||||
if(!$oDB->isColumnExists("document_categories", "color")) return true;
|
||||
|
||||
/**
|
||||
* 2009. 01. 29: Add a column(lang_code) if not exist in the document_extra_vars table
|
||||
*/
|
||||
if(!$oDB->isColumnExists("document_extra_vars","lang_code")) return true;
|
||||
// 2009. 01. 29 Added a trigger for additional setup
|
||||
if(!ModuleModel::getTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before')) return true;
|
||||
|
||||
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before')) return true;
|
||||
// 2009. 03. 09 Add a column(lang_code) to the documnets table
|
||||
if(!$oDB->isColumnExists("documents","lang_code")) return true;
|
||||
// 2009. 03. 11 check the index in the document_extra_vars table
|
||||
if(!$oDB->isIndexExists("document_extra_vars", "unique_extra_vars")) return true;
|
||||
|
||||
// 2009. 03. 19: Add a column(eid) if not exist in the table
|
||||
if(!$oDB->isColumnExists("document_extra_keys","eid")) return true;
|
||||
if(!$oDB->isColumnExists("document_extra_vars","eid")) return true;
|
||||
if($oDB->isIndexExists("document_extra_vars", "unique_module_vars")) return true;
|
||||
|
||||
// 2011. 03. 30 Cubrid index Check the index in the document_extra_vars table
|
||||
if(!$oDB->isIndexExists("document_extra_vars", "idx_document_list_order")) return true;
|
||||
|
||||
//2011. 04. 07 adding description column to document categories
|
||||
if(!$oDB->isColumnExists("document_categories","description")) return true;
|
||||
|
||||
//2011. 05. 23 adding status column to document
|
||||
if(!$oDB->isColumnExists('documents', 'status')) return true;
|
||||
|
||||
//2011. 06. 07 check comment status update
|
||||
if($oDB->isColumnExists('documents', 'allow_comment') || $oDB->isColumnExists('documents', 'lock_comment')) return true;
|
||||
|
||||
// 2011. 10. 25 status index check
|
||||
if(!$oDB->isIndexExists("documents", "idx_module_status")) return true;
|
||||
|
||||
// 2012. 02. 27 Add a trigger to copy extra keys when the module is copied
|
||||
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModuleExtraKeys', 'after')) return true;
|
||||
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModuleExtraKeys', 'after')) return true;
|
||||
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModule', 'after')) return true;
|
||||
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModule', 'after')) return true;
|
||||
|
||||
// 2016. 1. 27: Add a column(declare_message) for report
|
||||
if(!$oDB->isColumnExists("document_declared_log","declare_message")) return true;
|
||||
|
|
@ -136,7 +109,8 @@ class document extends ModuleObject
|
|||
// 2017.12.21 Add an index for nick_name
|
||||
if(!$oDB->isIndexExists('documents', 'idx_nick_name')) return true;
|
||||
|
||||
if(!$oModuleModel->getTrigger('file.deleteFile', 'document', 'controller', 'triggerAfterDeleteFile', 'after')) return true;
|
||||
// 2018.01.24 Improve mass file deletion
|
||||
if(!ModuleModel::getTrigger('file.deleteFile', 'document', 'controller', 'triggerAfterDeleteFile', 'after')) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -147,16 +121,9 @@ class document extends ModuleObject
|
|||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
$oDB = &DB::getInstance();
|
||||
$oModuleModel = getModel('module');
|
||||
$oDB = DB::getInstance();
|
||||
$oModuleController = getController('module');
|
||||
|
||||
// 2007. 7. 25: Add a column(notify_message) for notification
|
||||
if(!$oDB->isColumnExists("documents","notify_message"))
|
||||
{
|
||||
$oDB->addColumn('documents',"notify_message","char",1);
|
||||
}
|
||||
|
||||
// 2007. 8. 23: create a clustered index in the document table
|
||||
if(!$oDB->isIndexExists("documents","idx_module_list_order"))
|
||||
{
|
||||
|
|
@ -184,162 +151,64 @@ class document extends ModuleObject
|
|||
}
|
||||
|
||||
// 2007. 10. 17 Add a trigger to delete all posts together when the module is deleted
|
||||
if(!$oModuleModel->getTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after'))
|
||||
$oModuleController->insertTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after');
|
||||
// 2007. 10. 25 add columns(parent_srl, expand)
|
||||
if(!$oDB->isColumnExists("document_categories","parent_srl")) $oDB->addColumn('document_categories',"parent_srl","number",12,0);
|
||||
if(!$oDB->isColumnExists("document_categories","expand")) $oDB->addColumn('document_categories',"expand","char",1,"N");
|
||||
if(!$oDB->isColumnExists("document_categories","group_srls")) $oDB->addColumn('document_categories',"group_srls","text");
|
||||
// 2007. 11. 20 create a composite index on the columns(module_srl + is_notice)
|
||||
if(!$oDB->isIndexExists("documents","idx_module_notice")) $oDB->addIndex("documents","idx_module_notice", array("module_srl","is_notice"));
|
||||
|
||||
// 2007. 12. 03: Add if the colume(extra_vars) doesn't exist
|
||||
if(!$oDB->isColumnExists("documents","extra_vars")) $oDB->addColumn('documents','extra_vars','text');
|
||||
|
||||
// 2008. 02. 18 create a composite index on the columns(module_srl + document_srl) (checked by Manian))
|
||||
if(!$oDB->isIndexExists("documents","idx_module_document_srl")) $oDB->addIndex("documents","idx_module_document_srl", array("module_srl","document_srl"));
|
||||
// 2008. 04. 23 Add a column(blamed count)
|
||||
if(!$oDB->isColumnExists("documents", "blamed_count"))
|
||||
if(!ModuleModel::getTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after'))
|
||||
{
|
||||
$oDB->addColumn('documents', 'blamed_count', 'number', 11, 0, true);
|
||||
$oDB->addIndex('documents', 'idx_blamed_count', array('blamed_count'));
|
||||
$oModuleController->insertTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after');
|
||||
}
|
||||
|
||||
// 2007. 11. 20 create a composite index on the columns(module_srl + is_notice)
|
||||
if(!$oDB->isIndexExists("documents","idx_module_notice"))
|
||||
{
|
||||
$oDB->addIndex("documents","idx_module_notice", array("module_srl","is_notice"));
|
||||
}
|
||||
|
||||
// 2008. 02. 18 create a composite index on the columns(module_srl + document_srl) (checked by Manian))
|
||||
if(!$oDB->isIndexExists("documents","idx_module_document_srl"))
|
||||
{
|
||||
$oDB->addIndex("documents","idx_module_document_srl", array("module_srl","document_srl"));
|
||||
}
|
||||
|
||||
// 2008. 04. 23 Add a column(blamed count)
|
||||
if(!$oDB->isIndexExists("documents","idx_module_blamed_count"))
|
||||
{
|
||||
$oDB->addIndex('documents', 'idx_module_blamed_count', array('module_srl', 'blamed_count'));
|
||||
}
|
||||
|
||||
if(!$oDB->isColumnExists("document_voted_log", "point"))
|
||||
$oDB->addColumn('document_voted_log', 'point', 'number', 11, 0, true);
|
||||
|
||||
|
||||
if(!$oDB->isColumnExists("document_categories","color")) $oDB->addColumn('document_categories',"color","char",7);
|
||||
|
||||
// 2009. 01. 29: Add a column(lang_code) if not exist in the document_extra_vars table
|
||||
if(!$oDB->isColumnExists("document_extra_vars","lang_code")) $oDB->addColumn('document_extra_vars',"lang_code","varchar",10);
|
||||
|
||||
// 2009. 01. 29 Added a trigger for additional setup
|
||||
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before'))
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before');
|
||||
// 2009. 03. 09 Add a column(lang_code) to the documnets table
|
||||
if(!$oDB->isColumnExists("documents","lang_code"))
|
||||
if(!ModuleModel::getTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before'))
|
||||
{
|
||||
$oDB->addColumn('documents',"lang_code","varchar",10, config('locale.default_lang'));
|
||||
$obj = new stdClass();
|
||||
$obj->lang_code = config('locale.default_lang');
|
||||
executeQuery('document.updateDocumentsLangCode', $obj);
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before');
|
||||
}
|
||||
|
||||
// 2009. 03. 11 Check the index in the document_extra_vars table
|
||||
if(!$oDB->isIndexExists("document_extra_vars", "unique_extra_vars"))
|
||||
{
|
||||
$oDB->addIndex("document_extra_vars", "unique_extra_vars", array("module_srl","document_srl","var_idx","lang_code"), true);
|
||||
}
|
||||
|
||||
if($oDB->isIndexExists("document_extra_vars", "unique_module_vars"))
|
||||
{
|
||||
$oDB->dropIndex("document_extra_vars", "unique_module_vars", true);
|
||||
}
|
||||
|
||||
// 2009. 03. 19: Add a column(eid)
|
||||
// 2009. 04. 12: Fixed the issue(#17922959) that changes another column values when adding eid column
|
||||
if(!$oDB->isColumnExists("document_extra_keys","eid"))
|
||||
{
|
||||
$oDB->addColumn("document_extra_keys","eid","varchar",40);
|
||||
|
||||
$output = executeQuery('document.getGroupsExtraKeys', $obj);
|
||||
if($output->toBool() && $output->data && count($output->data)) {
|
||||
foreach($output->data as $extra_keys) {
|
||||
$args = new stdClass();
|
||||
$args->module_srl = $extra_keys->module_srl;
|
||||
$args->var_idx = $extra_keys->idx;
|
||||
$args->new_eid = "extra_vars".$extra_keys->idx;
|
||||
$output = executeQuery('document.updateDocumentExtraKeyEid', $args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$oDB->isColumnExists("document_extra_vars","eid"))
|
||||
{
|
||||
$oDB->addColumn("document_extra_vars","eid","varchar",40);
|
||||
$obj = new stdClass();
|
||||
$obj->var_idx = '-1,-2';
|
||||
$output = executeQuery('document.getGroupsExtraVars', $obj);
|
||||
if($output->toBool() && $output->data && count($output->data))
|
||||
{
|
||||
foreach($output->data as $extra_vars)
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->module_srl = $extra_vars->module_srl;
|
||||
$args->var_idx = $extra_vars->idx;
|
||||
$args->new_eid = "extra_vars".$extra_vars->idx;
|
||||
$output = executeQuery('document.updateDocumentExtraVarEid', $args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 2011. 03. 30 Cubrid index Check the index in the document_extra_vars table
|
||||
if(!$oDB->isIndexExists("document_extra_vars", "idx_document_list_order"))
|
||||
{
|
||||
$oDB->addIndex("document_extra_vars", "idx_document_list_order", array("document_srl","module_srl","var_idx"), false);
|
||||
}
|
||||
|
||||
//2011. 04. 07 adding description column to document categories
|
||||
if(!$oDB->isColumnExists("document_categories","description")) $oDB->addColumn('document_categories',"description","varchar",200,0);
|
||||
|
||||
//2011. 05. 23 adding status column to document
|
||||
if(!$oDB->isColumnExists('documents', 'status'))
|
||||
{
|
||||
$oDB->addColumn('documents', 'status', 'varchar', 20, 'PUBLIC');
|
||||
$args = new stdClass();
|
||||
$args->is_secret = 'Y';
|
||||
$output = executeQuery('document.updateDocumentStatus', $args);
|
||||
}
|
||||
|
||||
// 2011. 09. 08 drop column document is_secret
|
||||
if($oDB->isColumnExists('documents', 'status') && $oDB->isColumnExists('documents', 'is_secret'))
|
||||
$oDB->dropColumn('documents', 'is_secret');
|
||||
|
||||
//2011. 06. 07 merge column, allow_comment and lock_comment
|
||||
if($oDB->isColumnExists('documents', 'allow_comment') || $oDB->isColumnExists('documents', 'lock_comment'))
|
||||
{
|
||||
$oDB->addColumn('documents', 'comment_status', 'varchar', 20, 'ALLOW');
|
||||
$args = new stdClass();
|
||||
$args->commentStatus = 'DENY';
|
||||
|
||||
// allow_comment='Y', lock_comment='Y'
|
||||
$args->allowComment = 'Y';
|
||||
$args->lockComment = 'Y';
|
||||
$output = executeQuery('document.updateDocumentCommentStatus', $args);
|
||||
|
||||
// allow_comment='N', lock_comment='Y'
|
||||
$args->allowComment = 'N';
|
||||
$args->lockComment = 'Y';
|
||||
$output = executeQuery('document.updateDocumentCommentStatus', $args);
|
||||
|
||||
// allow_comment='N', lock_comment='N'
|
||||
$args->allowComment = 'N';
|
||||
$args->lockComment = 'N';
|
||||
$output = executeQuery('document.updateDocumentCommentStatus', $args);
|
||||
}
|
||||
|
||||
if($oDB->isColumnExists('documents', 'allow_comment') && $oDB->isColumnExists('documents', 'comment_status'))
|
||||
$oDB->dropColumn('documents', 'allow_comment');
|
||||
|
||||
if($oDB->isColumnExists('documents', 'lock_comment') && $oDB->isColumnExists('documents', 'comment_status'))
|
||||
$oDB->dropColumn('documents', 'lock_comment');
|
||||
|
||||
if(!$oDB->isIndexExists("documents", "idx_module_status"))
|
||||
{
|
||||
$oDB->addIndex("documents", "idx_module_status", array("module_srl","status"));
|
||||
}
|
||||
|
||||
// 2012. 02. 27 Add a trigger to copy extra keys when the module is copied
|
||||
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModuleExtraKeys', 'after'))
|
||||
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModuleExtraKeys', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModuleExtraKeys', 'after');
|
||||
}
|
||||
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModule', 'after'))
|
||||
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModule', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModule', 'after');
|
||||
}
|
||||
|
|
@ -369,7 +238,8 @@ class document extends ModuleObject
|
|||
$oDB->addIndex('documents', 'idx_nick_name', array('nick_name'));
|
||||
}
|
||||
|
||||
if(!$oModuleModel->getTrigger('file.deleteFile', 'document', 'controller', 'triggerAfterDeleteFile', 'after'))
|
||||
// 2018.01.24 Improve mass file deletion
|
||||
if(!ModuleModel::getTrigger('file.deleteFile', 'document', 'controller', 'triggerAfterDeleteFile', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('file.deleteFile', 'document', 'controller', 'triggerAfterDeleteFile', 'after');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,29 +93,24 @@ class editor extends ModuleObject
|
|||
*/
|
||||
function checkUpdate()
|
||||
{
|
||||
$oModuleModel = getModel('module');
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
// 2009. 06. 15 Save module_srl when auto-saving
|
||||
if(!$oDB->isColumnExists("editor_autosave","module_srl")) return true;
|
||||
if(!$oDB->isIndexExists("editor_autosave","idx_module_srl")) return true;
|
||||
$oDB = DB::getInstance();
|
||||
|
||||
// XEVE-17-030
|
||||
if(!$oDB->isColumnExists('editor_autosave', 'certify_key')) return true;
|
||||
if(!$oDB->isIndexExists('editor_autosave', 'idx_certify_key')) return true;
|
||||
|
||||
// 2007. 10. 17 Add a trigger to delete automatically saved document whenever the document(insert or update) is modified
|
||||
if(!$oModuleModel->getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) return true;
|
||||
if(!$oModuleModel->getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) return true;
|
||||
if(!ModuleModel::getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) return true;
|
||||
if(!ModuleModel::getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) return true;
|
||||
// 2007. 10. 23 Add an editor trigger on the module addition setup
|
||||
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before')) return true;
|
||||
if(!ModuleModel::getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before')) return true;
|
||||
// 2009. 04. 14 Add a trigger from compiled codes of the editor component
|
||||
if(!$oModuleModel->getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before')) return true;
|
||||
if(!ModuleModel::getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before')) return true;
|
||||
// 2009. 06. 19 Remove unused trigger
|
||||
if($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) return true;
|
||||
if(ModuleModel::getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) return true;
|
||||
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after')) return true;
|
||||
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after')) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -125,20 +120,9 @@ class editor extends ModuleObject
|
|||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
$oModuleModel = getModel('module');
|
||||
$oDB = DB::getInstance();
|
||||
$oModuleController = getController('module');
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
// Save module_srl when auto-saving 15/06/2009
|
||||
if(!$oDB->isColumnExists('editor_autosave', 'module_srl'))
|
||||
{
|
||||
$oDB->addColumn('editor_autosave', 'module_srl', 'number');
|
||||
}
|
||||
if(!$oDB->isIndexExists('editor_autosave', 'idx_module_srl'))
|
||||
{
|
||||
$oDB->addIndex('editor_autosave', 'idx_module_srl', 'module_srl');
|
||||
}
|
||||
|
||||
// XEVE-17-030
|
||||
if(!$oDB->isColumnExists('editor_autosave', 'certify_key'))
|
||||
{
|
||||
|
|
@ -150,22 +134,22 @@ class editor extends ModuleObject
|
|||
}
|
||||
|
||||
// 2007. 10. 17 Add a trigger to delete automatically saved document whenever the document(insert or update) is modified
|
||||
if(!$oModuleModel->getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'))
|
||||
if(!ModuleModel::getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'))
|
||||
$oModuleController->insertTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
|
||||
if(!$oModuleModel->getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'))
|
||||
if(!ModuleModel::getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'))
|
||||
$oModuleController->insertTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
|
||||
// 2007. 10. Add an editor trigger on the module addition setup
|
||||
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before'))
|
||||
if(!ModuleModel::getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before'))
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before');
|
||||
// 2009. 04. 14 Add a trigger from compiled codes of the editor component
|
||||
if(!$oModuleModel->getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before'))
|
||||
if(!ModuleModel::getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before'))
|
||||
$oModuleController->insertTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before');
|
||||
// 2009. 06. 19 Remove unused trigger
|
||||
if($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before'))
|
||||
if(ModuleModel::getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before'))
|
||||
$oModuleController->deleteTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before');
|
||||
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after'))
|
||||
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ class layout extends ModuleObject
|
|||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
// Create a directory to be used in the layout
|
||||
FileHandler::makeDir('./files/cache/layout');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -23,32 +22,6 @@ class layout extends ModuleObject
|
|||
*/
|
||||
function checkUpdate()
|
||||
{
|
||||
$oDB = &DB::getInstance();
|
||||
// 2009. 02. 11 Add site_srl to layout table
|
||||
if(!$oDB->isColumnExists('layouts', 'site_srl')) return true;
|
||||
// 2009. 02. 26 Move the previous layout for faceoff
|
||||
$files = FileHandler::readDir('./files/cache/layout');
|
||||
for($i=0,$c=count($files);$i<$c;$i++)
|
||||
{
|
||||
$filename = $files[$i];
|
||||
if(preg_match('/([0-9]+)\.html/i',$filename)) return true;
|
||||
}
|
||||
|
||||
if(!$oDB->isColumnExists('layouts', 'layout_type')) return true;
|
||||
|
||||
$args = new stdClass();
|
||||
$args->layout = '.';
|
||||
$output = executeQueryArray('layout.getLayoutDotList', $args);
|
||||
if($output->data && count($output->data) > 0)
|
||||
{
|
||||
foreach($output->data as $layout)
|
||||
{
|
||||
$layout_path = explode('.', $layout->layout);
|
||||
if(count($layout_path) != 2) continue;
|
||||
if(is_dir(sprintf(_XE_PATH_ . 'themes/%s/layouts/%s', $layout_path[0], $layout_path[1]))) return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -58,50 +31,7 @@ class layout extends ModuleObject
|
|||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
$oDB = &DB::getInstance();
|
||||
// 2009. 02. 11 Add site_srl to menu table
|
||||
if(!$oDB->isColumnExists('layouts', 'site_srl'))
|
||||
{
|
||||
$oDB->addColumn('layouts','site_srl','number',11,0,true);
|
||||
}
|
||||
// 2009. 02. 26 Move the previous layout for faceoff
|
||||
$oLayoutModel = getModel('layout');
|
||||
$files = FileHandler::readDir('./files/cache/layout');
|
||||
for($i=0,$c=count($files);$i<$c;$i++)
|
||||
{
|
||||
$filename = $files[$i];
|
||||
if(!preg_match('/([0-9]+)\.html/i',$filename,$match)) continue;
|
||||
$layout_srl = $match[1];
|
||||
if(!$layout_srl) continue;
|
||||
$path = $oLayoutModel->getUserLayoutPath($layout_srl);
|
||||
if(!is_dir($path)) FileHandler::makeDir($path);
|
||||
FileHandler::copyFile('./files/cache/layout/'.$filename, $path.'layout.html');
|
||||
@unlink('./files/cache/layout/'.$filename);
|
||||
}
|
||||
|
||||
if(!$oDB->isColumnExists('layouts', 'layout_type'))
|
||||
{
|
||||
$oDB->addColumn('layouts','layout_type','char',1,'P',true);
|
||||
}
|
||||
|
||||
$args = new stdClass();
|
||||
$args->layout = '.';
|
||||
$output = executeQueryArray('layout.getLayoutDotList', $args);
|
||||
if($output->data && count($output->data) > 0)
|
||||
{
|
||||
foreach($output->data as $layout)
|
||||
{
|
||||
$layout_path = explode('.', $layout->layout);
|
||||
if(count($layout_path) != 2) continue;
|
||||
if(is_dir(sprintf(_XE_PATH_ . 'themes/%s/layouts/%s', $layout_path[0], $layout_path[1])))
|
||||
{
|
||||
$args->layout = implode('|@|', $layout_path);
|
||||
$args->layout_srl = $layout->layout_srl;
|
||||
$output = executeQuery('layout.updateLayout', $args);
|
||||
Rhymix\Framework\Cache::delete('layout:' . $args->layout_srl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -110,12 +40,7 @@ class layout extends ModuleObject
|
|||
*/
|
||||
function recompileCache()
|
||||
{
|
||||
$path = './files/cache/layout';
|
||||
if(!is_dir($path))
|
||||
{
|
||||
FileHandler::makeDir($path);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/* End of file layout.class.php */
|
||||
|
|
|
|||
|
|
@ -33,11 +33,11 @@ class member extends ModuleObject {
|
|||
// Register action forward (to use in administrator mode)
|
||||
$oModuleController = getController('module');
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->addIndex("member_group","idx_site_title", array("site_srl","title"),true);
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('member');
|
||||
$config = ModuleModel::getModuleConfig('member');
|
||||
|
||||
if(empty($config))
|
||||
{
|
||||
|
|
@ -136,7 +136,7 @@ class member extends ModuleObject {
|
|||
}
|
||||
// Register denied ID(default + module name)
|
||||
$oModuleModel = getModel('module');
|
||||
$module_list = $oModuleModel->getModuleList();
|
||||
$module_list = ModuleModel::getModuleList();
|
||||
foreach($module_list as $key => $val)
|
||||
{
|
||||
$oMemberAdminController->insertDeniedID($val->module,'');
|
||||
|
|
@ -165,32 +165,12 @@ class member extends ModuleObject {
|
|||
*/
|
||||
function checkUpdate()
|
||||
{
|
||||
$oDB = &DB::getInstance();
|
||||
$oModuleModel = getModel('module');
|
||||
$oDB = DB::getInstance();
|
||||
|
||||
// check member directory (11/08/2007 added)
|
||||
if(!is_dir("./files/member_extra_info")) return true;
|
||||
// check member directory (22/10/2007 added)
|
||||
if(!is_dir("./files/member_extra_info/profile_image")) return true;
|
||||
// Add a column(is_register) to "member_auth_mail" table (22/04/2008)
|
||||
$act = $oDB->isColumnExists("member_auth_mail", "is_register");
|
||||
if(!$act) return true;
|
||||
// Add a column(site_srl) to "member_group_member" table (11/15/2008)
|
||||
if(!$oDB->isColumnExists("member_group_member", "site_srl")) return true;
|
||||
if(!$oDB->isColumnExists("member_group", "site_srl")) return true;
|
||||
if($oDB->isIndexExists("member_group","uni_member_group_title")) return true;
|
||||
|
||||
// Add a column for list_order (05/18/2011)
|
||||
if(!$oDB->isColumnExists("member_group", "list_order")) return true;
|
||||
|
||||
// image_mark 추가 (2009. 02. 14)
|
||||
if(!$oDB->isColumnExists("member_group", "image_mark")) return true;
|
||||
// Add c column for password expiration date
|
||||
if(!$oDB->isColumnExists("member", "change_password_date")) return true;
|
||||
|
||||
// Add columns of question and answer to verify a password
|
||||
if(!$oDB->isColumnExists("member", "find_account_question")) return true;
|
||||
if(!$oDB->isColumnExists("member", "find_account_answer")) return true;
|
||||
|
||||
// Add columns for phone number
|
||||
if(!$oDB->isColumnExists("member", "phone_number")) return true;
|
||||
|
|
@ -220,8 +200,7 @@ class member extends ModuleObject {
|
|||
if(!$oDB->isIndexExists('member_nickname_log', 'idx_after_nick_name')) return true;
|
||||
if(!$oDB->isIndexExists('member_nickname_log', 'idx_user_id')) return true;
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('member');
|
||||
$config = ModuleModel::getModuleConfig('member');
|
||||
|
||||
// Check members with phone country in old format
|
||||
if ($config->phone_number_default_country && !preg_match('/^[A-Z]{3}$/', $config->phone_number_default_country))
|
||||
|
|
@ -281,8 +260,8 @@ class member extends ModuleObject {
|
|||
if(!is_readable('./files/ruleset/login.xml')) return true;
|
||||
|
||||
// 2013. 11. 22 add menu when popup document menu called
|
||||
if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) return true;
|
||||
if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) return true;
|
||||
if(!ModuleModel::getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) return true;
|
||||
if(!ModuleModel::getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) return true;
|
||||
|
||||
// Allow duplicate nickname
|
||||
if($config->allow_duplicate_nickname == 'Y')
|
||||
|
|
@ -303,62 +282,14 @@ class member extends ModuleObject {
|
|||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB = DB::getInstance();
|
||||
$oModuleController = getController('module');
|
||||
|
||||
// Check member directory
|
||||
FileHandler::makeDir('./files/member_extra_info/image_name');
|
||||
FileHandler::makeDir('./files/member_extra_info/image_mark');
|
||||
FileHandler::makeDir('./files/member_extra_info/signature');
|
||||
FileHandler::makeDir('./files/member_extra_info/profile_image');
|
||||
// Add a column
|
||||
if(!$oDB->isColumnExists("member_auth_mail", "is_register"))
|
||||
{
|
||||
$oDB->addColumn("member_auth_mail", "is_register", "char", 1, "N", true);
|
||||
}
|
||||
// Add a column(site_srl) to "member_group_member" table (11/15/2008)
|
||||
if(!$oDB->isColumnExists("member_group_member", "site_srl"))
|
||||
{
|
||||
$oDB->addColumn("member_group_member", "site_srl", "number", 11, 0, true);
|
||||
$oDB->addIndex("member_group_member", "idx_site_srl", "site_srl", false);
|
||||
}
|
||||
if(!$oDB->isColumnExists("member_group", "site_srl"))
|
||||
{
|
||||
$oDB->addColumn("member_group", "site_srl", "number", 11, 0, true);
|
||||
$oDB->addIndex("member_group","idx_site_title", array("site_srl","title"),true);
|
||||
}
|
||||
if($oDB->isIndexExists("member_group","uni_member_group_title"))
|
||||
{
|
||||
$oDB->dropIndex("member_group","uni_member_group_title",true);
|
||||
}
|
||||
|
||||
// Add a column(list_order) to "member_group" table (05/18/2011)
|
||||
if(!$oDB->isColumnExists("member_group", "list_order"))
|
||||
{
|
||||
$oDB->addColumn("member_group", "list_order", "number", 11, '', true);
|
||||
$oDB->addIndex("member_group","idx_list_order", "list_order",false);
|
||||
$output = executeQuery('member.updateAllMemberGroupListOrder');
|
||||
}
|
||||
// Add a column for image_mark (02/14/2009)
|
||||
if(!$oDB->isColumnExists("member_group", "image_mark"))
|
||||
{
|
||||
$oDB->addColumn("member_group", "image_mark", "text");
|
||||
}
|
||||
// Add a column for password expiration date
|
||||
if(!$oDB->isColumnExists("member", "change_password_date"))
|
||||
{
|
||||
$oDB->addColumn("member", "change_password_date", "date");
|
||||
executeQuery('member.updateAllChangePasswordDate');
|
||||
}
|
||||
|
||||
// Add columns of question and answer to verify a password
|
||||
if(!$oDB->isColumnExists("member", "find_account_question"))
|
||||
{
|
||||
$oDB->addColumn("member", "find_account_question", "number", 11);
|
||||
}
|
||||
if(!$oDB->isColumnExists("member", "find_account_answer"))
|
||||
{
|
||||
$oDB->addColumn("member", "find_account_answer", "varchar", 250);
|
||||
}
|
||||
|
||||
// Add columns for phone number
|
||||
if(!$oDB->isColumnExists("member", "phone_number"))
|
||||
|
|
@ -423,7 +354,7 @@ class member extends ModuleObject {
|
|||
if(!$oDB->isColumnExists("member_autologin", "security_key"))
|
||||
{
|
||||
$oDB->dropTable('member_autologin');
|
||||
$oDB->createTableByXmlFile($this->module_path . '/schemas/member_autologin.xml');
|
||||
$oDB->createTable($this->module_path . '/schemas/member_autologin.xml');
|
||||
}
|
||||
|
||||
// Check scrap folder table
|
||||
|
|
@ -441,8 +372,7 @@ class member extends ModuleObject {
|
|||
$oDB->addIndex('member_nickname_log', 'idx_user_id', array('user_id'));
|
||||
}
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('member');
|
||||
$config = ModuleModel::getModuleConfig('member');
|
||||
$changed = false;
|
||||
|
||||
// Check members with phone country in old format
|
||||
|
|
@ -472,7 +402,7 @@ class member extends ModuleObject {
|
|||
$config->signupForm = $oMemberAdminController->createSignupForm($config);
|
||||
$output = $oModuleController->updateModuleConfig('member', $config);
|
||||
}
|
||||
$phone_number_found = false;
|
||||
$phone_found = false;
|
||||
foreach($config->signupForm as $no => $signupItem)
|
||||
{
|
||||
if($signupItem->name === 'find_account_question')
|
||||
|
|
@ -490,7 +420,7 @@ class member extends ModuleObject {
|
|||
}
|
||||
if($signupItem->name === 'phone_number')
|
||||
{
|
||||
$phone_number_found = true;
|
||||
$phone_found = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
@ -567,9 +497,9 @@ class member extends ModuleObject {
|
|||
$oMemberAdminController->_createLoginRuleset($config->identifier);
|
||||
|
||||
// 2013. 11. 22 add menu when popup document menu called
|
||||
if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after'))
|
||||
if(!ModuleModel::getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after'))
|
||||
$oModuleController->insertTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after');
|
||||
if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after'))
|
||||
if(!ModuleModel::getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after'))
|
||||
$oModuleController->insertTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after');
|
||||
|
||||
// Allow duplicate nickname
|
||||
|
|
@ -607,7 +537,7 @@ class member extends ModuleObject {
|
|||
$config = $oMemberModel->getMemberConfig();
|
||||
|
||||
// Check if there is recoding table.
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB = DB::getInstance();
|
||||
if(!$oDB->isTableExists('member_login_count') || $config->enable_login_fail_report == 'N') return new BaseObject($error, $message);
|
||||
|
||||
$args = new stdClass();
|
||||
|
|
@ -652,7 +582,7 @@ class member extends ModuleObject {
|
|||
$config = $oMemberModel->getMemberConfig();
|
||||
|
||||
// Check if there is recoding table.
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB = DB::getInstance();
|
||||
if(!$oDB->isTableExists('member_count_history') || $config->enable_login_fail_report == 'N') return new BaseObject($error, $message);
|
||||
|
||||
$output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args);
|
||||
|
|
|
|||
|
|
@ -26,24 +26,7 @@ class menu extends ModuleObject
|
|||
*/
|
||||
function checkUpdate()
|
||||
{
|
||||
$oDB = &DB::getInstance();
|
||||
// 2009. 02. 11 menu added to the table site_srl
|
||||
if(!$oDB->isColumnExists('menu', 'site_srl')) return true;
|
||||
|
||||
// 2012. 02. 01 title index check
|
||||
if(!$oDB->isIndexExists("menu", "idx_title")) return true;
|
||||
|
||||
if(!$oDB->isColumnExists('menu_item', 'is_shortcut'))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
$oMenuAdminModel = getAdminModel('menu');
|
||||
$args = new stdClass();
|
||||
$args->title = array("Temporary menu");
|
||||
$temp_menus = executeQueryArray('menu.getMenuByTitle', $args);
|
||||
if($temp_menus->toBool() && count($temp_menus->data)) return true;
|
||||
$oDB = DB::getInstance();
|
||||
|
||||
// 2015. 06. 15 add column desc
|
||||
if(!$oDB->isColumnExists('menu_item', 'desc'))
|
||||
|
|
@ -58,128 +41,15 @@ class menu extends ModuleObject
|
|||
* Execute update
|
||||
* @return Object
|
||||
*/
|
||||
function moduleUpdate() {
|
||||
$oDB = &DB::getInstance();
|
||||
// 2009. 02. 11 menu added to the table site_srl
|
||||
if(!$oDB->isColumnExists('menu', 'site_srl'))
|
||||
{
|
||||
$oDB->addColumn('menu','site_srl','number',11,0,true);
|
||||
}
|
||||
|
||||
// 2012. 02. 01 title index check
|
||||
if(!$oDB->isIndexExists("menu","idx_title"))
|
||||
{
|
||||
$oDB->addIndex('menu', 'idx_title', array('title'));
|
||||
}
|
||||
function moduleUpdate()
|
||||
{
|
||||
$oDB = DB::getInstance();
|
||||
|
||||
// 2015. 06. 15 add column desc
|
||||
if(!$oDB->isColumnExists('menu_item', 'desc'))
|
||||
{
|
||||
$oDB->addColumn('menu_item', 'desc','varchar',250,"",true);
|
||||
}
|
||||
|
||||
// 1.7(maserati) shortcut column add and mirgration
|
||||
if(!$oDB->isColumnExists('menu_item', 'is_shortcut'))
|
||||
{
|
||||
$oDB->addColumn('menu_item', 'is_shortcut', 'char', 1, 'N');
|
||||
|
||||
// check empty url and change shortcut type
|
||||
$oMenuAdminModel = getAdminModel('menu');
|
||||
$output = $oMenuAdminModel->getMenus();
|
||||
|
||||
if(is_array($output))
|
||||
{
|
||||
$menuItemUniqueList = array();
|
||||
$menuItemAllList = array();
|
||||
foreach($output AS $key=>$value)
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->menu_srl = $value->menu_srl;
|
||||
$output2 = executeQueryArray('menu.getMenuItems', $args);
|
||||
if(is_array($output2->data))
|
||||
{
|
||||
foreach($output2->data AS $key2=>$value2)
|
||||
{
|
||||
$menuItemAllList[$value2->menu_item_srl] = $value2->url;
|
||||
if(!in_array($value2->url, $menuItemUniqueList))
|
||||
{
|
||||
$menuItemUniqueList[$value2->menu_item_srl] = $value2->url;
|
||||
}
|
||||
|
||||
// if url is empty, change type to shortcurt
|
||||
if($value2->is_shortcut == 'N' && (!$value2->url || strncasecmp('http', $value2->url, 4) === 0))
|
||||
{
|
||||
$value2->is_shortcut = 'Y';
|
||||
$output3 = executeQuery('menu.updateMenuItem', $value2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
// if duplicate reference, change type to shortcut
|
||||
$shortcutItemList = array_diff_assoc($menuItemAllList, $menuItemUniqueList);
|
||||
foreach($output AS $key=>$value)
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->menu_srl = $value->menu_srl;
|
||||
$output2 = executeQueryArray('menu.getMenuItems', $args);
|
||||
if(is_array($output2->data))
|
||||
{
|
||||
foreach($output2->data AS $key2=>$value2)
|
||||
{
|
||||
if(!empty($value2->url) && strncasecmp('http', $value2->url, 4) !== 0)
|
||||
{
|
||||
$moduleInfo = $oModuleModel->getModuleInfoByMid($value2->url);
|
||||
if(!$moduleInfo->module_srl)
|
||||
{
|
||||
$value2->url = Context::getDefaultUrl();
|
||||
if(!$value2->url) $value2->url = '#';
|
||||
$value2->is_shortcut = 'Y';
|
||||
|
||||
$updateOutput = executeQuery('menu.updateMenuItem', $value2);
|
||||
}
|
||||
}
|
||||
|
||||
if($shortcutItemList[$value2->menu_item_srl])
|
||||
{
|
||||
$value2->is_shortcut = 'Y';
|
||||
$output3 = executeQuery('menu.updateMenuItem', $value2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->recompileCache();
|
||||
}
|
||||
|
||||
// for 1.7.4 update, 기존에 생성된 Temporary menu 항목 정리
|
||||
$oMenuAdminModel = getAdminModel('menu');
|
||||
$args = new stdClass();
|
||||
$args->title = array("Temporary menu");
|
||||
$temp_menus = executeQueryArray('menu.getMenuByTitle', $args);
|
||||
|
||||
$args = new stdClass();
|
||||
if($temp_menus->toBool() && count($temp_menus->data))
|
||||
{
|
||||
|
||||
$oMenuAdminController = getAdminController('menu');
|
||||
foreach($temp_menus->data as $menu)
|
||||
{
|
||||
$args->current_menu_srl = $menu->menu_srl;
|
||||
$args->menu_srl = $oMenuAdminController->getUnlinkedMenu();
|
||||
$output3 = executeQuery('menu.updateMenuItems', $args);
|
||||
|
||||
if($output3->toBool())
|
||||
{
|
||||
// delete
|
||||
$oMenuAdminController->deleteMenu($menu->menu_srl);
|
||||
}
|
||||
}
|
||||
|
||||
$this->recompileCache();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class module extends ModuleObject
|
|||
// Register action forward (to use in administrator mode)
|
||||
$oModuleController = getController('module');
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->addIndex("modules","idx_site_mid", array("site_srl","mid"), true);
|
||||
|
||||
// Insert new domain
|
||||
|
|
@ -52,44 +52,10 @@ class module extends ModuleObject
|
|||
*/
|
||||
function checkUpdate()
|
||||
{
|
||||
$oDB = &DB::getInstance();
|
||||
// 2008. 10. 27 Add multi-index in the table, the module_part_config
|
||||
if(!$oDB->isIndexExists('module_part_config', 'idx_module_part_config') && !$oDB->isIndexExists('module_part_config', 'unique_module_part_config')) return true;
|
||||
// 2008. 11. 13 Delete unique constraint on mid in modules. Add site_srl and then create unique index on site_srl and mid
|
||||
if(!$oDB->isIndexExists('modules',"idx_site_mid")) return true;
|
||||
// Move permissions/skin information of all modules to the table, grants.
|
||||
if($oDB->isColumnExists('modules', 'grants')) return true;
|
||||
// Delete extra_vars* column
|
||||
for($i=1;$i<=20;$i++)
|
||||
{
|
||||
if($oDB->isColumnExists("documents","extra_vars".$i)) return true;
|
||||
}
|
||||
|
||||
// Check indexes
|
||||
if(!$oDB->isColumnExists("modules", "use_mobile")) return true;
|
||||
if(!$oDB->isColumnExists("modules", "mlayout_srl")) return true;
|
||||
if(!$oDB->isColumnExists("modules", "mcontent")) return true;
|
||||
if(!$oDB->isColumnExists("modules", "mskin")) return true;
|
||||
|
||||
// check fix skin
|
||||
if(!$oDB->isColumnExists("modules", "is_skin_fix")) return true;
|
||||
|
||||
if(!$oDB->isColumnExists("module_config", "site_srl")) return true;
|
||||
|
||||
if(!is_dir('./files/ruleset')) return true;
|
||||
|
||||
$args = new stdClass;
|
||||
$args->skin = '.';
|
||||
$output = executeQueryArray('module.getModuleSkinDotList', $args);
|
||||
if($output->data && count($output->data) > 0)
|
||||
{
|
||||
foreach($output->data as $item)
|
||||
{
|
||||
$skin_path = explode('.', $item->skin);
|
||||
if(count($skin_path) != 2) continue;
|
||||
if(is_dir(sprintf(_XE_PATH_ . 'themes/%s/modules/%s', $skin_path[0], $skin_path[1]))) return true;
|
||||
}
|
||||
}
|
||||
$oDB = DB::getInstance();
|
||||
|
||||
// check ruleset directory
|
||||
if(!is_dir(RX_BASEDIR . 'files/ruleset')) return true;
|
||||
|
||||
// Check domains
|
||||
if (!$oDB->isTableExists('domains') || !getModel('module')->getDefaultDomainInfo())
|
||||
|
|
@ -100,8 +66,7 @@ class module extends ModuleObject
|
|||
// check fix mskin
|
||||
if(!$oDB->isColumnExists("modules", "is_mskin_fix")) return true;
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$moduleConfig = $oModuleModel->getModuleConfig('module');
|
||||
$moduleConfig = ModuleModel::getModuleConfig('module');
|
||||
if(!$moduleConfig->isUpdateFixedValue) return true;
|
||||
|
||||
// check unique index on module_part_config
|
||||
|
|
@ -131,7 +96,10 @@ class module extends ModuleObject
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// check unique index on module_part_config
|
||||
if(!$oDB->isIndexExists('module_part_config', 'unique_module_part_config')) return true;
|
||||
|
||||
// check route columns in action_forward table
|
||||
if(!$oDB->isColumnExists('action_forward', 'route_regexp')) return true;
|
||||
if(!$oDB->isColumnExists('action_forward', 'route_config')) return true;
|
||||
|
|
@ -143,278 +111,16 @@ class module extends ModuleObject
|
|||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
$oDB = &DB::getInstance();
|
||||
// 2008. 10. 27 module_part_config Add a multi-index to the table and check all information of module_configg
|
||||
if(!$oDB->isIndexExists('module_part_config', 'idx_module_part_config') && !$oDB->isIndexExists('module_part_config', 'unique_module_part_config'))
|
||||
{
|
||||
$oModuleModel = getModel('module');
|
||||
$oModuleController = getController('module');
|
||||
$modules = $oModuleModel->getModuleList();
|
||||
foreach($modules as $key => $module_info)
|
||||
{
|
||||
$module = $module_info->module;
|
||||
if(!in_array($module, array('point','trackback','layout','rss','file','comment','editor'))) continue;
|
||||
$config = $oModuleModel->getModuleConfig($module);
|
||||
|
||||
$module_config = null;
|
||||
switch($module)
|
||||
{
|
||||
case 'point' :
|
||||
$module_config = $config->module_point;
|
||||
unset($config->module_point);
|
||||
break;
|
||||
case 'trackback' :
|
||||
case 'rss' :
|
||||
case 'file' :
|
||||
case 'comment' :
|
||||
case 'editor' :
|
||||
$module_config = $config->module_config;
|
||||
unset($config->module_config);
|
||||
if(is_array($module_config) && count($module_config))
|
||||
{
|
||||
foreach($module_config as $key => $val)
|
||||
{
|
||||
if(isset($module_config[$key]->module_srl)) unset($module_config[$key]->module_srl);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'layout' :
|
||||
$tmp = $config->header_script;
|
||||
if(is_array($tmp) && count($tmp))
|
||||
{
|
||||
foreach($tmp as $k => $v)
|
||||
{
|
||||
if(!$v && !trim($v)) continue;
|
||||
$module_config[$k]->header_script = $v;
|
||||
}
|
||||
}
|
||||
$config = null;
|
||||
break;
|
||||
}
|
||||
|
||||
$oModuleController->insertModuleConfig($module, $config);
|
||||
|
||||
if(is_array($module_config) && count($module_config))
|
||||
{
|
||||
foreach($module_config as $module_srl => $module_part_config)
|
||||
{
|
||||
$oModuleController->insertModulePartConfig($module,$module_srl,$module_part_config);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 2008. 11. 13 drop index(unique_mid). Add a column and index on site_srl and mid columns
|
||||
if(!$oDB->isIndexExists('modules',"idx_site_mid"))
|
||||
{
|
||||
$oDB->dropIndex("modules","unique_mid",true);
|
||||
$oDB->addColumn('modules','site_srl','number',11,0,true);
|
||||
$oDB->addIndex("modules","idx_site_mid", array("site_srl","mid"),true);
|
||||
}
|
||||
|
||||
// document extra vars
|
||||
if(!$oDB->isTableExists('document_extra_vars')) $oDB->createTableByXmlFile('./modules/document/schemas/document_extra_vars.xml');
|
||||
if(!$oDB->isTableExists('document_extra_keys')) $oDB->createTableByXmlFile('./modules/document/schemas/document_extra_keys.xml');
|
||||
|
||||
// Move permission, skin info, extection info, admin ID of all modules to the table, grants
|
||||
if($oDB->isColumnExists('modules', 'grants'))
|
||||
{
|
||||
$oModuleController = getController('module');
|
||||
$oDocumentController = getController('document');
|
||||
|
||||
// Get a value of the current system language code
|
||||
$lang_code = Context::getLangType();
|
||||
|
||||
// Get module_info of all modules
|
||||
$output = executeQueryArray('module.getModuleInfos');
|
||||
if(count($output->data))
|
||||
{
|
||||
foreach($output->data as $module_info)
|
||||
{
|
||||
// Separate information about permission granted to the module, extra vars, skin vars, super-admin's authority
|
||||
$module_srl = trim($module_info->module_srl);
|
||||
// grant an authority
|
||||
$grants = unserialize($module_info->grants);
|
||||
if($grants) $oModuleController->insertModuleGrants($module_srl, $grants);
|
||||
// Insert skin vars
|
||||
$skin_vars = unserialize($module_info->skin_vars);
|
||||
if($skin_vars) $oModuleController->insertModuleSkinVars($module_srl, $skin_vars);
|
||||
// Insert super admin's ID
|
||||
$admin_id = trim($module_info->admin_id);
|
||||
if($admin_id && $admin_id != 'Array')
|
||||
{
|
||||
$admin_ids = explode(',',$admin_id);
|
||||
if(count($admin_id))
|
||||
{
|
||||
foreach($admin_ids as $admin_id)
|
||||
{
|
||||
$oModuleController->insertAdminId($module_srl, $admin_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Save extra configurations for each module(column data which doesn't exist in the defaut modules)
|
||||
$extra_vars = unserialize($module_info->extra_vars);
|
||||
$document_extra_keys = null;
|
||||
if($extra_vars->extra_vars && count($extra_vars->extra_vars))
|
||||
{
|
||||
$document_extra_keys = $extra_vars->extra_vars;
|
||||
unset($extra_vars->extra_vars);
|
||||
}
|
||||
if($extra_vars) $oModuleController->insertModuleExtraVars($module_srl, $extra_vars);
|
||||
|
||||
/**
|
||||
* Move document extra vars(it should have conducted in the documents module however extra vars in modules table should be listed up in this module)
|
||||
*/
|
||||
// Insert extra vars if planet module is
|
||||
if($module_info->module == 'planet')
|
||||
{
|
||||
if(!$document_extra_keys || !is_array($document_extra_keys)) $document_extra_keys = array();
|
||||
$planet_extra_keys->name = 'postscript';
|
||||
$planet_extra_keys->type = 'text';
|
||||
$planet_extra_keys->is_required = 'N';
|
||||
$planet_extra_keys->search = 'N';
|
||||
$planet_extra_keys->default = '';
|
||||
$planet_extra_keys->desc = '';
|
||||
$document_extra_keys[20] = $planet_extra_keys;
|
||||
}
|
||||
// Register keys for document extra vars
|
||||
if(count($document_extra_keys))
|
||||
{
|
||||
foreach($document_extra_keys as $var_idx => $val)
|
||||
{
|
||||
$oDocumentController->insertDocumentExtraKey($module_srl, $var_idx, $val->name, $val->type, $val->is_required, $val->search, $val->default, $val->desc, 'extra_vars'.$var_idx);
|
||||
}
|
||||
// 2009-04-14 Fixed a bug that only 100 extra vars are moved
|
||||
$oDocumentModel = getModel('document');
|
||||
$total_count = $oDocumentModel->getDocumentCount($module_srl);
|
||||
|
||||
if($total_count > 0)
|
||||
{
|
||||
$per_page = 100;
|
||||
$total_pages = (int) (($total_count - 1) / $per_page) + 1;
|
||||
// Get extra vars if exist
|
||||
$doc_args = new stdClass();
|
||||
$doc_args->module_srl = $module_srl;
|
||||
$doc_args->list_count = $per_page;
|
||||
$doc_args->sort_index = 'list_order';
|
||||
$doc_args->order_type = 'asc';
|
||||
|
||||
for($doc_args->page = 1; $doc_args->page <= $total_pages; $doc_args->page++)
|
||||
{
|
||||
$output = executeQueryArray('document.getDocumentList', $doc_args);
|
||||
|
||||
if($output->toBool() && $output->data && count($output->data))
|
||||
{
|
||||
foreach ($output->data as $document)
|
||||
{
|
||||
if(!$document) continue;
|
||||
foreach ($document as $key => $var)
|
||||
{
|
||||
if (strpos($key, 'extra_vars') !== 0 || !trim($var) || $var == 'N;') continue;
|
||||
$var_idx = str_replace('extra_vars','',$key);
|
||||
$oDocumentController->insertDocumentExtraVar($module_srl, $document->document_srl, $var_idx, $var, 'extra_vars'.$var_idx, $lang_code);
|
||||
}
|
||||
}
|
||||
}
|
||||
} // for total_pages
|
||||
} // if count
|
||||
}
|
||||
|
||||
// Additional variables of the module, remove
|
||||
$module_info->grant = null;
|
||||
$module_info->extra_vars = null;
|
||||
$module_info->skin_vars = null;
|
||||
$module_info->admin_id = null;
|
||||
executeQuery('module.updateModule', $module_info);
|
||||
|
||||
Rhymix\Framework\Cache::clearGroup('site_and_module');
|
||||
}
|
||||
}
|
||||
|
||||
// Various column drop
|
||||
$oDB->dropColumn('modules','grants');
|
||||
$oDB->dropColumn('modules','admin_id');
|
||||
$oDB->dropColumn('modules','skin_vars');
|
||||
$oDB->dropColumn('modules','extra_vars');
|
||||
}
|
||||
|
||||
// extra_vars * Remove Column
|
||||
for($i=1;$i<=20;$i++)
|
||||
{
|
||||
if(!$oDB->isColumnExists("documents","extra_vars".$i)) continue;
|
||||
$oDB->dropColumn('documents','extra_vars'.$i);
|
||||
}
|
||||
$oDB = DB::getInstance();
|
||||
|
||||
// Migrate domains
|
||||
if (!getModel('module')->getDefaultDomainInfo())
|
||||
{
|
||||
$this->migrateDomains();
|
||||
}
|
||||
|
||||
if(!$oDB->isColumnExists("modules", "use_mobile"))
|
||||
{
|
||||
$oDB->addColumn('modules','use_mobile','char',1,'N');
|
||||
}
|
||||
if(!$oDB->isColumnExists("modules", "mlayout_srl"))
|
||||
{
|
||||
$oDB->addColumn('modules','mlayout_srl','number',11, 0);
|
||||
}
|
||||
if(!$oDB->isColumnExists("modules", "mcontent"))
|
||||
{
|
||||
$oDB->addColumn('modules','mcontent','bigtext');
|
||||
}
|
||||
if(!$oDB->isColumnExists("modules", "mskin"))
|
||||
{
|
||||
$oDB->addColumn('modules','mskin','varchar',250);
|
||||
}
|
||||
if(!$oDB->isColumnExists("modules", "is_skin_fix"))
|
||||
{
|
||||
$oDB->addColumn('modules', 'is_skin_fix', 'char', 1, 'N');
|
||||
$output = executeQuery('module.updateSkinFixModules');
|
||||
}
|
||||
if(!$oDB->isColumnExists("module_config", "site_srl"))
|
||||
{
|
||||
$oDB->addColumn('module_config', 'site_srl', 'number', 11, 0, true);
|
||||
}
|
||||
FileHandler::makeDir('./files/ruleset');
|
||||
|
||||
$args->skin = '.';
|
||||
$output = executeQueryArray('module.getModuleSkinDotList', $args);
|
||||
if($output->data && count($output->data) > 0)
|
||||
{
|
||||
foreach($output->data as $item)
|
||||
{
|
||||
$skin_path = explode('.', $item->skin);
|
||||
if(count($skin_path) != 2) continue;
|
||||
if(is_dir(sprintf(_XE_PATH_ . 'themes/%s/modules/%s', $skin_path[0], $skin_path[1])))
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->skin = $item->skin;
|
||||
$args->new_skin = implode('|@|', $skin_path);
|
||||
$output = executeQuery('module.updateSkinAll', $args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// XE 1.7
|
||||
if(!$oDB->isColumnExists("modules", "is_mskin_fix"))
|
||||
{
|
||||
$oDB->addColumn('modules', 'is_mskin_fix', 'char', 1, 'N');
|
||||
$output = executeQuery('module.updateMobileSkinFixModules');
|
||||
}
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$moduleConfig = $oModuleModel->getModuleConfig('module');
|
||||
if(!$moduleConfig->isUpdateFixedValue)
|
||||
{
|
||||
$output = executeQuery('module.updateSkinFixModules');
|
||||
$output = executeQuery('module.updateMobileSkinFixModules');
|
||||
|
||||
$oModuleController = getController('module');
|
||||
if(!$moduleConfig) $moduleConfig = new stdClass;
|
||||
$moduleConfig->isUpdateFixedValue = TRUE;
|
||||
$output = $oModuleController->updateModuleConfig('module', $moduleConfig);
|
||||
}
|
||||
|
||||
// check ruleset directory
|
||||
FileHandler::makeDir(RX_BASEDIR . 'files/ruleset');
|
||||
|
||||
// check module_config data type
|
||||
$column_info = $oDB->getColumnInfo('module_config', 'config');
|
||||
|
|
@ -478,12 +184,11 @@ class module extends ModuleObject
|
|||
$oDB = DB::getInstance();
|
||||
if (!$oDB->isTableExists('domains'))
|
||||
{
|
||||
$oDB->createTableByXmlFile($this->module_path . 'schemas/domains.xml');
|
||||
$oDB->createTable($this->module_path . 'schemas/domains.xml');
|
||||
}
|
||||
|
||||
// Get current site configuration.
|
||||
$oModuleModel = getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('module');
|
||||
$config = ModuleModel::getModuleConfig('module');
|
||||
|
||||
// Initialize domains data.
|
||||
$domains = array();
|
||||
|
|
@ -616,13 +321,11 @@ class module extends ModuleObject
|
|||
function recompileCache()
|
||||
{
|
||||
$oModuleModel = getModel('module');
|
||||
$module_list = $oModuleModel->getModuleList();
|
||||
$module_list = ModuleModel::getModuleList();
|
||||
$module_names = array_map(function($module_info) {
|
||||
return $module_info->module;
|
||||
}, $module_list);
|
||||
|
||||
$oModuleModel->loadModuleExtends();
|
||||
|
||||
// Delete triggers belonging to modules that don't exist
|
||||
$args = new stdClass;
|
||||
$args->module = $module_names ?: [];
|
||||
|
|
|
|||
|
|
@ -33,9 +33,7 @@ class session extends ModuleObject
|
|||
*/
|
||||
function checkUpdate()
|
||||
{
|
||||
$oDB = &DB::getInstance();
|
||||
if(!$oDB->isTableExists('session')) return true;
|
||||
if(!$oDB->isColumnExists("session","cur_mid")) return true;
|
||||
$oDB = DB::getInstance();
|
||||
if(!$oDB->isIndexExists("session","idx_session_update_mid")) return true;
|
||||
return false;
|
||||
}
|
||||
|
|
@ -46,13 +44,10 @@ class session extends ModuleObject
|
|||
function moduleUpdate()
|
||||
{
|
||||
$oDB = &DB::getInstance();
|
||||
$oModuleModel = getModel('module');
|
||||
|
||||
if(!$oDB->isTableExists('session')) $oDB->createTableByXmlFile($this->module_path.'schemas/session.xml');
|
||||
|
||||
if(!$oDB->isColumnExists("session","cur_mid")) $oDB->addColumn('session',"cur_mid","varchar",128);
|
||||
|
||||
if(!$oDB->isIndexExists("session","idx_session_update_mid")) $oDB->addIndex("session","idx_session_update_mid", array("member_srl","last_update","cur_mid"));
|
||||
if(!$oDB->isIndexExists("session","idx_session_update_mid"))
|
||||
{
|
||||
$oDB->addIndex("session","idx_session_update_mid", array("member_srl","last_update","cur_mid"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue