에디터 모듈에 HTML 허용 설정 추가

회원 모듈에도 no html 서명을 위한 옵션 추가
This commit is contained in:
conory 2017-07-13 00:46:28 +09:00
parent f7915f8204
commit da0ad3bd39
20 changed files with 179 additions and 142 deletions

View file

@ -147,21 +147,21 @@ class editorController extends editor
$editor_config->{$key} = explode('|@|', $grant);
}
}
$editor_config->editor_height = (int)Context::get('editor_height');
$editor_config->comment_editor_height = (int)Context::get('comment_editor_height');
$editor_config->enable_autosave = Context::get('enable_autosave');
if($editor_config->enable_autosave != 'Y') $editor_config->enable_autosave = 'N';
$editor_config->enable_autosave = Context::get('enable_autosave') ?: 'N';
$editor_config->allow_html = Context::get('allow_html') ?: 'Y';
$oModuleController = getController('module');
foreach ($module_srl as $srl)
{
$oModuleController->insertModulePartConfig('editor',$srl,$editor_config);
$oModuleController->insertModulePartConfig('editor', $srl, $editor_config);
}
$this->setError(-1);
$this->setMessage('success_updated', 'info');
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminContent');
$this->setRedirectUrl($returnUrl);
}

View file

@ -43,7 +43,8 @@ class editorModel extends editor
}
// Fill in some other values.
if($editor_config->enable_autosave != 'N') $editor_config->enable_autosave = 'Y';
$editor_config->enable_autosave = $editor_config->enable_autosave ?: 'Y';
$editor_config->allow_html = $editor_config->allow_html ?: 'Y';
if(!is_array($editor_config->enable_html_grant)) $editor_config->enable_html_grant = array();
if(!is_array($editor_config->enable_comment_html_grant)) $editor_config->enable_comment_html_grant = array();
if(!is_array($editor_config->upload_file_grant)) $editor_config->upload_file_grant = array();
@ -252,6 +253,9 @@ class editorModel extends editor
}
Context::set('enable_autosave', $option->enable_autosave);
// Set allow html
Context::set('allow_html', ($option->allow_html === false || $option->allow_html === 'N') ? false : true);
// Load editor components.
$site_srl = Context::get('site_module_info')->site_srl ?: 0;
if($option->editor_skin === 'dreditor')

View file

@ -71,6 +71,7 @@ $lang->enable_default_component_grant = 'Permission to use default components';
$lang->enable_extra_component_grant = 'Permission to use extra components';
$lang->enable_html_grant = 'Permission to edit HTML';
$lang->enable_autosave = 'Enable Auto-Save';
$lang->allow_html = 'allow HTML';
$lang->height_resizable = 'Height Resizable';
$lang->editor_height = 'Height of Editor';
$lang->about_default_editor_settings = 'Follow editor settings of Rhymix Admin page through whole site.';

View file

@ -75,6 +75,7 @@ $lang->enable_default_component_grant = '기본 컴포넌트 사용 권한';
$lang->enable_extra_component_grant = '확장 컴포넌트 사용 권한';
$lang->enable_html_grant = 'HTML 편집 권한';
$lang->enable_autosave = '자동저장 사용';
$lang->allow_html = 'HTML 허용';
$lang->height_resizable = '높이 조절 가능';
$lang->editor_height = '에디터 높이';
$lang->about_default_editor_settings = '사이트 전체 에디터 설정을 통일하여서 모듈별 에디터 설정을 단순하게 합니다.';

View file

@ -1,8 +1,3 @@
.rx_editor_wrapper {
clear: both;
}
.rx_editor_wrapper .rx_editor_textarea {
width: 100%;
min-height: 64px;
@ -16,4 +11,5 @@
.rx_editor_wrapper .rx_editor_textarea.dark {
border-color: #111;
background: #333;
color: #fff;
}

View file

@ -27,6 +27,11 @@
}
// Save edited content
<!--@if(!$allow_html)-->
textarea.on("change", function() {
content_input.val(String($(this).val()).escape());
});
<!--@else-->
textarea.on("change", function() {
content_input.val("<p>" + String($(this).val()).escape().replace(/\r?\n/g, "</p>\n<p>") + "</p>");
});
@ -45,7 +50,7 @@
} else {
parentform.append('<input type="hidden" name="use_html" value="Y" />');
}
<!--@end-->
});
</script>
</div>

View file

@ -89,6 +89,13 @@
</label>
</td>
</tr>
<tr>
<th scope="row" style="text-align:right">{$lang->allow_html}</th>
<td colspan="2">
<label class="x_inline"><input type="radio" name="allow_html" value="Y" checked="checked"|cond="$editor_config->allow_html != 'N'" /> {$lang->cmd_yes}</label>
<label class="x_inline"><input type="radio" name="allow_html" value="N" checked="checked"|cond="$editor_config->allow_html == 'N'" /> {$lang->cmd_no}</label>
</td>
</tr>
<tr>
<th scope="row" style="text-align:right">{$lang->enable_html_grant}</th>
<td>