Prevent disabled editor component in editor popup

This commit is contained in:
Kijin Sung 2021-12-31 00:06:13 +09:00
parent 3925c24487
commit e3541c046b
4 changed files with 8 additions and 1 deletions

View file

@ -532,6 +532,10 @@ class editorModel extends editor
// Add configuration information
$component_info = self::getComponent($component, $site_srl);
if ($component_info->enabled !== 'Y')
{
return new BaseObject(-1, 'msg_component_is_disabled', $component);
}
$oComponent->setInfo($component_info);
self::$_loaded_component_list[$component][$editor_sequence] = $oComponent;
}

View file

@ -66,7 +66,8 @@ class editorView extends editor
$oComponent = &$oEditorModel->getComponentObject($component, $editor_sequence, $site_srl);
if(!$oComponent->toBool())
{
Context::set('message', sprintf(lang('msg_component_is_not_founded'), $component));
Context::set('message', sprintf($oComponent->getMessage(), $component));
$this->setLayoutFile('popup_layout');
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('component_not_founded');
}

View file

@ -61,6 +61,7 @@ $lang->content_font_size = 'Content Font Size';
$lang->about_component = 'About component';
$lang->about_component_mid = 'Editor components can select targets.(All targets will be selected when nothing is selected.)';
$lang->msg_component_is_not_founded = 'Cannot find editor component %s.';
$lang->msg_component_is_disabled = 'Editor component %s is disabled.';
$lang->msg_component_is_inserted = 'Selected component is already inserted.';
$lang->msg_component_is_first_order = 'Selected component is located at the first position.';
$lang->msg_component_is_last_order = 'Selected component is located at the last position.';

View file

@ -59,6 +59,7 @@ $lang->content_font_size = '문서 폰트 크기';
$lang->about_component = '컴포넌트 소개';
$lang->about_component_mid = '에디터 컴포넌트가 사용될 대상을 지정할 수 있습니다.(모두 해제 시 모든 대상에서 사용 가능합니다)';
$lang->msg_component_is_not_founded = '%s 에디터 컴포넌트를 찾을 수 없습니다.';
$lang->msg_component_is_disabled = '%s 에디터 컴포넌트는 사용하지 않도록 설정되어 있습니다.';
$lang->msg_component_is_inserted = '선택한 컴포넌트는 이미 입력되어 있습니다.';
$lang->msg_component_is_first_order = '선택한 컴포넌트는 첫 번째에 위치하고 있습니다.';
$lang->msg_component_is_last_order = '선택한 컴포넌트는 마지막에 위치하고 있습니다.';