Implement control of whether to hide the editor toolbar

This commit is contained in:
Kijin Sung 2017-06-27 18:04:26 +09:00
parent 0d257b6b67
commit 4adf223524
8 changed files with 71 additions and 7 deletions

View file

@ -149,9 +149,17 @@ class editorAdminController extends editor
$config->editor_skin = $configVars->editor_skin;
$config->editor_height = $configVars->editor_height;
$config->mobile_editor_height = $configVars->mobile_editor_height;
$config->editor_toolbar = $configVars->editor_toolbar;
$config->editor_toolbar_hide = $configVars->editor_toolbar_hide === 'Y' ? 'Y' : 'N';
$config->mobile_editor_toolbar = $configVars->mobile_editor_toolbar;
$config->mobile_editor_toolbar_hide = $configVars->mobile_editor_toolbar_hide === 'Y' ? 'Y' : 'N';
$config->comment_editor_skin = $configVars->comment_editor_skin;
$config->comment_editor_height = $configVars->comment_editor_height;
$config->mobile_comment_editor_height = $configVars->mobile_comment_editor_height;
$config->comment_editor_toolbar = $configVars->comment_editor_toolbar;
$config->comment_editor_toolbar_hide = $configVars->comment_editor_toolbar_hide === 'Y' ? 'Y' : 'N';
$config->mobile_comment_editor_toolbar = $configVars->mobile_comment_editor_toolbar;
$config->mobile_comment_editor_toolbar_hide = $configVars->mobile_comment_editor_toolbar_hide === 'Y' ? 'Y' : 'N';
$config->content_style = $configVars->content_style;
$config->sel_editor_colorset= $configVars->sel_editor_colorset;
$config->sel_comment_editor_colorset= $configVars->sel_comment_editor_colorset;

View file

@ -24,12 +24,20 @@ class editor extends ModuleObject
public $default_editor_config = array(
'editor_skin' => 'ckeditor',
'editor_height' => 300,
'editor_toolbar' => 'default',
'editor_toolbar_hide' => 'N',
'mobile_editor_height' => 200,
'mobile_editor_toolbar' => 'simple',
'mobile_editor_toolbar_hide' => 'Y',
'sel_editor_colorset' => 'moono-lisa',
'content_style' => 'ckeditor_light',
'comment_editor_skin' => 'ckeditor',
'comment_editor_height' => 100,
'comment_editor_toolbar' => 'simple',
'comment_editor_toolbar_hide' => 'Y',
'mobile_comment_editor_height' => 100,
'mobile_comment_editor_toolbar' => 'simple',
'mobile_comment_editor_toolbar_hide' => 'Y',
'sel_comment_editor_colorset' => 'moono-lisa',
'comment_content_style' => 'ckeditor_light',
'content_font' => '',

View file

@ -223,6 +223,8 @@ class editorModel extends editor
Context::set('content_style_path', $this->module_path . 'styles/' . $option->content_style);
Context::set('colorset', $option->sel_editor_colorset);
Context::set('editor_height', $option->editor_height);
Context::set('editor_toolbar', $option->editor_toolbar);
Context::set('editor_toolbar_hide', toBool($option->editor_toolbar_hide));
Context::set('module_type', $option->module_type);
// Default font setting
@ -359,6 +361,8 @@ class editorModel extends editor
if ($is_mobile)
{
$option->editor_height = $option->mobile_editor_height;
$option->editor_toolbar = $option->mobile_editor_toolbar;
$option->editor_toolbar_hide = $option->mobile_editor_toolbar_hide;
}
}
else
@ -375,10 +379,14 @@ class editorModel extends editor
$option->enable_component_grant = $option->enable_comment_component_grant;
$option->enable_html_grant = $option->enable_comment_html_grant;
$option->editor_height = $option->comment_editor_height;
$option->editor_toolbar = $option->comment_editor_toolbar;
$option->editor_toolbar_hide = $option->comment_editor_toolbar_hide;
$option->enable_autosave = 'N';
if ($is_mobile)
{
$option->editor_height = $option->mobile_comment_editor_height;
$option->editor_toolbar = $option->mobile_comment_editor_toolbar;
$option->editor_toolbar_hide = $option->mobile_comment_editor_toolbar_hide;
}
}

View file

@ -5,8 +5,10 @@ $lang->comment_editor = 'Comment editor';
$lang->editor_option = 'Editor Options';
$lang->guide_choose_main_editor = 'Main editor';
$lang->guide_set_height_main_editor = 'Main editor height';
$lang->guide_set_main_editor_toolbar = 'Main editor toolbar';
$lang->guide_choose_comment_editor = 'Comment editor';
$lang->guide_set_height_comment_editor = 'Comment editor height';
$lang->guide_set_comment_editor_toolbar = 'Comment editor toolbar';
$lang->guide_additional_css = 'Additional CSS Files';
$lang->about_additional_css = 'To load additional CSS files inside the editor, such as web fonts, please enter one URL per line.';
$lang->guide_additional_mobile_css = 'Additional CSS Files for Mobile';

View file

@ -6,8 +6,13 @@ $lang->comment_editor = '댓글 에디터';
$lang->editor_option = '에디터 옵션';
$lang->guide_choose_main_editor = '본문 에디터';
$lang->guide_set_height_main_editor = '본문 에디터 높이';
$lang->guide_set_main_editor_toolbar = '본문 에디터 도구상자';
$lang->guide_choose_comment_editor = '댓글 에디터';
$lang->guide_set_height_comment_editor = '댓글 에디터 높이';
$lang->guide_set_comment_editor_toolbar = '댓글 에디터 도구상자';
$lang->editor_toolbar_default = '기본';
$lang->editor_toolbar_simple = '간단';
$lang->editor_toolbar_hide = '숨김';
$lang->guide_additional_css = 'CSS 파일 추가';
$lang->about_additional_css = '웹폰트 등의 CSS를 에디터 내부에서 추가로 로딩하려면 한 줄에 하나씩 URL을 입력해 주십시오.';
$lang->guide_additional_mobile_css = '모바일 CSS 파일 추가';

View file

@ -134,9 +134,7 @@ var auto_saved_msg = "{$lang->msg_auto_saved}";
settings.loadXeComponent = false;
<!--@endif-->
<!--@if($module_type === 'comment' || Rhymix\Framework\UA::isMobile())-->
settings.ckeconfig.toolbarStartupExpanded = false;
<!--@endif-->
settings.ckeconfig.toolbarStartupExpanded = {$editor_toolbar_hide ? 'false' : 'true'};
<!--@if(!$html_mode)-->
settings.ckeconfig.removeButtons = 'Save,Preview,Print,Cut,Copy,Paste,Source';

View file

@ -1,3 +1,4 @@
<load target="css/editor_module_config.css" />
<load target="js/editor_module_config.js" />
<div class="x_page-header">
<h1>{$lang->editor} <a class="x_icon-question-sign" href="./common/manual/admin/index.html#UMAN_advanced_editor" target="_blank">{$lang->help}</a></h1>
@ -51,8 +52,23 @@
<div class="x_control-group">
<label for="editor_height" class="x_control-label">{$lang->guide_set_height_main_editor}</label>
<div class="x_controls">
<p>{$lang->pc}: <input type="number" name="editor_height" id="editor_height" value="{$editor_config->editor_height}" /> px</p>
<p>{$lang->mobile}: <input type="number" name="mobile_editor_height" id="mobile_editor_height" value="{$editor_config->mobile_editor_height}" /> px</p>
<p><span class="editor_type">{$lang->pc}</span> <input type="number" name="editor_height" id="editor_height" value="{$editor_config->editor_height}" /> px</p>
<p><span class="editor_type">{$lang->mobile}</span> <input type="number" name="mobile_editor_height" id="mobile_editor_height" value="{$editor_config->mobile_editor_height}" /> px</p>
</div>
</div>
<div class="x_control-group">
<label for="editor_height" class="x_control-label">{$lang->guide_set_main_editor_toolbar}</label>
<div class="x_controls">
<p><span class="editor_type">{$lang->pc}</span>
<label class="x_inline"><input type="radio" name="editor_toolbar" value="default" checked="checked"|cond="!$editor_config->editor_toolbar || $editor_config->editor_toolbar === 'default'"> {$lang->editor_toolbar_default}</label>
<label class="x_inline"><input type="radio" name="editor_toolbar" value="simple" checked="checked"|cond="$editor_config->editor_toolbar === 'simple'"> {$lang->editor_toolbar_simple}</label>
<label class="x_inline"><input type="checkbox" name="editor_toolbar_hide" value="Y" checked="checked"|cond="$editor_config->editor_toolbar_hide === 'Y'"> {$lang->editor_toolbar_hide}</label>
</p>
<p><span class="editor_type">{$lang->mobile}</span>
<label class="x_inline"><input type="radio" name="mobile_editor_toolbar" value="default" checked="checked"|cond="!$editor_config->mobile_editor_toolbar || $editor_config->mobile_editor_toolbar === 'default'"> {$lang->editor_toolbar_default}</label>
<label class="x_inline"><input type="radio" name="mobile_editor_toolbar" value="simple" checked="checked"|cond="$editor_config->mobile_editor_toolbar === 'simple'"> {$lang->editor_toolbar_simple}</label>
<label class="x_inline"><input type="checkbox" name="mobile_editor_toolbar_hide" value="Y" checked="checked"|cond="$editor_config->mobile_editor_toolbar_hide === 'Y'"> {$lang->editor_toolbar_hide}</label>
</p>
</div>
</div>
<div class="x_control-group">
@ -75,8 +91,23 @@
<div class="x_control-group">
<label for="comment_editor_height" class="x_control-label">{$lang->guide_set_height_comment_editor}</label>
<div class="x_controls">
<p>{$lang->pc}: <input type="number" name="comment_editor_height" id="comment_editor_height" value="{$editor_config->comment_editor_height}" /> px</p>
<p>{$lang->mobile}: <input type="number" name="mobile_comment_editor_height" id="mobile_comment_editor_height" value="{$editor_config->mobile_comment_editor_height}" /> px &nbsp;</p>
<p><span class="editor_type">{$lang->pc}</span> <input type="number" name="comment_editor_height" id="comment_editor_height" value="{$editor_config->comment_editor_height}" /> px</p>
<p><span class="editor_type">{$lang->mobile}</span> <input type="number" name="mobile_comment_editor_height" id="mobile_comment_editor_height" value="{$editor_config->mobile_comment_editor_height}" /> px &nbsp;</p>
</div>
</div>
<div class="x_control-group">
<label for="editor_height" class="x_control-label">{$lang->guide_set_comment_editor_toolbar}</label>
<div class="x_controls">
<p><span class="editor_type">{$lang->pc}</span>
<label class="x_inline"><input type="radio" name="comment_editor_toolbar" value="default" checked="checked"|cond="!$editor_config->comment_editor_toolbar || $editor_config->comment_editor_toolbar === 'default'"> {$lang->editor_toolbar_default}</label>
<label class="x_inline"><input type="radio" name="comment_editor_toolbar" value="simple" checked="checked"|cond="$editor_config->comment_editor_toolbar === 'simple'"> {$lang->editor_toolbar_simple}</label>
<label class="x_inline"><input type="checkbox" name="comment_editor_toolbar_hide" value="Y" checked="checked"|cond="$editor_config->comment_editor_toolbar_hide === 'Y'"> {$lang->editor_toolbar_hide}</label>
</p>
<p><span class="editor_type">{$lang->mobile}</span>
<label class="x_inline"><input type="radio" name="mobile_comment_editor_toolbar" value="default" checked="checked"|cond="!$editor_config->mobile_comment_editor_toolbar || $editor_config->mobile_comment_editor_toolbar === 'default'"> {$lang->editor_toolbar_default}</label>
<label class="x_inline"><input type="radio" name="mobile_comment_editor_toolbar" value="simple" checked="checked"|cond="$editor_config->mobile_comment_editor_toolbar === 'simple'"> {$lang->editor_toolbar_simple}</label>
<label class="x_inline"><input type="checkbox" name="mobile_comment_editor_toolbar_hide" value="Y" checked="checked"|cond="$editor_config->mobile_comment_editor_toolbar_hide === 'Y'"> {$lang->editor_toolbar_hide}</label>
</p>
</div>
</div>
<div class="x_control-group">

View file

@ -0,0 +1,4 @@
.editor_type {
display: inline-block;
min-width: 60px;
}