mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 02:31:40 +09:00
Set proper module_srl and mid when uploading in member and communication modules
This commit is contained in:
parent
f6a02fd006
commit
e1cfb09652
5 changed files with 82 additions and 3 deletions
|
|
@ -433,6 +433,16 @@ class MemberAdminView extends Member
|
|||
$option->editor_toolbar_hide = 'Y';
|
||||
$option->editor_skin = $member_config->signature_editor_skin;
|
||||
$option->sel_editor_colorset = $member_config->sel_editor_colorset;
|
||||
if (!$option->allow_html)
|
||||
{
|
||||
$option->editor_skin = 'textarea';
|
||||
}
|
||||
if ($option->allow_fileupload)
|
||||
{
|
||||
$oMemberView = MemberView::getInstance();
|
||||
$option->module_srl = $oMemberView->getMemberModuleSrl();
|
||||
$option->mid = $oMemberView->getMemberModulePrefix();
|
||||
}
|
||||
|
||||
Context::set('editor', getModel('editor')->getEditor($member_info->member_srl, $option));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,6 +93,47 @@ 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.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getMemberModuleSrl(): int
|
||||
{
|
||||
if (!$this->member_config)
|
||||
{
|
||||
$this->member_config = MemberModel::getMemberConfig();
|
||||
}
|
||||
if (!empty($this->member_config->mid))
|
||||
{
|
||||
return ModuleModel::getModuleInfoByMid($this->member_config->mid)->module_srl ?? 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Module index
|
||||
*/
|
||||
|
|
@ -334,6 +375,11 @@ class MemberView extends Member
|
|||
{
|
||||
$option->editor_skin = 'textarea';
|
||||
}
|
||||
if ($option->allow_fileupload)
|
||||
{
|
||||
$option->module_srl = $this->getMemberModuleSrl();
|
||||
$option->mid = $this->getMemberModulePrefix();
|
||||
}
|
||||
|
||||
Context::set('editor', getModel('editor')->getEditor(0, $option));
|
||||
}
|
||||
|
|
@ -448,6 +494,11 @@ class MemberView extends Member
|
|||
{
|
||||
$option->editor_skin = 'textarea';
|
||||
}
|
||||
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