mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 18:21:39 +09:00
Set editor_mid automatically based on module_srl
This commit is contained in:
parent
e1cfb09652
commit
990343d906
5 changed files with 7 additions and 29 deletions
|
|
@ -92,7 +92,7 @@
|
|||
var defaultFormData = {
|
||||
"editor_sequence": data.editorSequence,
|
||||
"upload_target_srl" : data.uploadTargetSrl ? data.uploadTargetSrl : 0,
|
||||
"mid" : window.current_mid ? window.current_mid : window.editor_mid,
|
||||
"mid" : window.editor_mid ? window.editor_mid : window.current_mid,
|
||||
"act": 'procFileUpload'
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -295,9 +295,7 @@ class CommunicationView extends communication
|
|||
}
|
||||
if ($option->allow_fileupload)
|
||||
{
|
||||
$oMemberView = MemberView::getInstance();
|
||||
$option->module_srl = $oMemberView->getMemberModuleSrl();
|
||||
$option->mid = $oMemberView->getMemberModulePrefix();
|
||||
$option->module_srl = MemberView::getInstance()->getMemberModuleSrl();
|
||||
}
|
||||
$editor = $oEditorModel->getEditor(getNextSequence(), $option);
|
||||
$editor = $editor . "\n" . '<input type="hidden" name="temp_srl" value="" />' . "\n";
|
||||
|
|
|
|||
|
|
@ -260,6 +260,10 @@ class EditorModel extends Editor
|
|||
FileController::setUploadInfo($option->editor_sequence, $upload_target_srl, $option->module_srl ?? 0);
|
||||
|
||||
// Set editor mid
|
||||
if (!empty($option->module_srl))
|
||||
{
|
||||
$option->mid = ModuleModel::getModuleInfoByModuleSrl($option->module_srl)->mid ?? null;
|
||||
}
|
||||
if (!empty($option->mid))
|
||||
{
|
||||
Context::addHtmlFooter('<script> var editor_mid = ' . json_encode($option->mid) . '; </script>');
|
||||
|
|
|
|||
|
|
@ -439,9 +439,7 @@ class MemberAdminView extends Member
|
|||
}
|
||||
if ($option->allow_fileupload)
|
||||
{
|
||||
$oMemberView = MemberView::getInstance();
|
||||
$option->module_srl = $oMemberView->getMemberModuleSrl();
|
||||
$option->mid = $oMemberView->getMemberModulePrefix();
|
||||
$option->module_srl = MemberView::getInstance()->getMemberModuleSrl();
|
||||
}
|
||||
|
||||
Context::set('editor', getModel('editor')->getEditor($member_info->member_srl, $option));
|
||||
|
|
|
|||
|
|
@ -93,26 +93,6 @@ class MemberView extends Member
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the member mid (prefix)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMemberModulePrefix(): string
|
||||
{
|
||||
if (!$this->member_config)
|
||||
{
|
||||
$this->member_config = MemberModel::getMemberConfig();
|
||||
}
|
||||
if (!empty($this->member_config->mid))
|
||||
{
|
||||
return $this->member_config->mid;
|
||||
}
|
||||
else
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Get the module_srl for the member mid.
|
||||
*
|
||||
|
|
@ -378,7 +358,6 @@ class MemberView extends Member
|
|||
if ($option->allow_fileupload)
|
||||
{
|
||||
$option->module_srl = $this->getMemberModuleSrl();
|
||||
$option->mid = $this->getMemberModulePrefix();
|
||||
}
|
||||
|
||||
Context::set('editor', getModel('editor')->getEditor(0, $option));
|
||||
|
|
@ -497,7 +476,6 @@ class MemberView extends Member
|
|||
if ($option->allow_fileupload)
|
||||
{
|
||||
$option->module_srl = $this->getMemberModuleSrl();
|
||||
$option->mid = $this->getMemberModulePrefix();
|
||||
}
|
||||
|
||||
Context::set('editor', getModel('editor')->getEditor($member_info->member_srl, $option));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue