mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Implement option to specify additional plugins for CKEditor
This commit is contained in:
parent
0bb8945453
commit
399bebd5c9
7 changed files with 28 additions and 0 deletions
|
|
@ -197,6 +197,17 @@ class editorAdminController extends editor
|
|||
$config->additional_mobile_css = array();
|
||||
}
|
||||
|
||||
if ($configVars->additional_plugins)
|
||||
{
|
||||
$additional_plugins = array_map('trim', explode(',', $configVars->additional_plugins));
|
||||
$additional_plugins = array_filter($additional_plugins, function($str) { return !empty($str); });
|
||||
$config->additional_plugins = $additional_plugins;
|
||||
}
|
||||
else
|
||||
{
|
||||
$config->additional_plugins = array();
|
||||
}
|
||||
|
||||
$config->content_font_size = trim($configVars->content_font_size);
|
||||
$config->content_font_size = ctype_digit($config->content_font_size) ? ($config->content_font_size . 'px') : $config->content_font_size;
|
||||
$config->content_line_height = trim($configVars->content_line_height);
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ class editor extends ModuleObject
|
|||
'autoinsert_image' => 'paragraph',
|
||||
'additional_css' => array(),
|
||||
'additional_mobile_css' => array(),
|
||||
'additional_plugins' => array(),
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -235,6 +235,7 @@ class editorModel extends editor
|
|||
Context::set('content_word_break', $option->content_word_break);
|
||||
Context::set('editor_autoinsert_image', $option->autoinsert_image);
|
||||
Context::set('editor_additional_css', $option->additional_css);
|
||||
Context::set('editor_additional_plugins', $option->additional_plugins);
|
||||
|
||||
// Set the primary key valueof the document or comments
|
||||
Context::set('editor_primary_key_name', $option->primary_key_name);
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ $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';
|
||||
$lang->guide_additional_plugins = 'Load additional plugins';
|
||||
$lang->guide_choose_text_formatting = 'Text formatting style';
|
||||
$lang->guide_choose_font_preview = 'Preview';
|
||||
$lang->guide_choose_font_body = 'Default font';
|
||||
|
|
@ -27,6 +28,7 @@ $lang->guide_choose_autoinsert_image = 'Auto-insert images';
|
|||
$lang->autoinsert_image_paragraph = 'Automatically insert images into editor (after line break at cursor position)';
|
||||
$lang->autoinsert_image_inline = 'Automatically insert images into editor (directly at cursor position)';
|
||||
$lang->autoinsert_image_none = 'Do not auto-insert images into editor';
|
||||
$lang->about_additional_plugins = 'This setting is only effective in editors that support additional plugins.';
|
||||
$lang->about_unit_default_px = 'The unit is px unless otherwise specified.';
|
||||
$lang->about_unit_default_percent = 'The unit is % unless otherwise specified.';
|
||||
$lang->font_preview = 'The quick brown fox jumps over the lazy dog.
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ $lang->editor_toolbar_hide = '숨김';
|
|||
$lang->guide_additional_css = 'CSS 파일 추가';
|
||||
$lang->about_additional_css = '웹폰트 등의 CSS를 에디터 내부에서 추가로 로딩하려면 한 줄에 하나씩 URL을 입력해 주십시오.';
|
||||
$lang->guide_additional_mobile_css = '모바일 CSS 파일 추가';
|
||||
$lang->guide_additional_plugins = '추가 플러그인 로드';
|
||||
$lang->guide_choose_text_formatting = '본문 서식';
|
||||
$lang->guide_choose_font_preview = '미리보기';
|
||||
$lang->guide_choose_font_body = '본문 글꼴';
|
||||
|
|
@ -31,6 +32,7 @@ $lang->guide_choose_autoinsert_image = '이미지 자동 삽입';
|
|||
$lang->autoinsert_image_paragraph = '이미지 첨부시 본문에 자동 삽입 (커서 위치에서 줄을 바꾸고 삽입)';
|
||||
$lang->autoinsert_image_inline = '이미지 첨부시 본문에 자동 삽입 (커서 위치에 직접 삽입)';
|
||||
$lang->autoinsert_image_none = '이미지 첨부시 본문에 자동 삽입하지 않음';
|
||||
$lang->about_additional_plugins = '추가 플러그인을 지원하는 에디터에서만 적용됩니다.';
|
||||
$lang->about_unit_default_px = '단위를 지정하지 않을 경우 px 단위를 사용합니다.';
|
||||
$lang->about_unit_default_percent = '단위를 지정하지 않을 경우 % 단위를 사용합니다.';
|
||||
$lang->font_preview = 'The quick brown fox jumps over the lazy dog.
|
||||
|
|
|
|||
|
|
@ -137,6 +137,10 @@ var auto_saved_msg = "{$lang->msg_auto_saved}";
|
|||
|
||||
settings.ckeconfig.toolbarStartupExpanded = {$editor_toolbar_hide ? 'false' : 'true'};
|
||||
|
||||
<!--@if($editor_additional_plugins)-->
|
||||
settings.extraPlugins = {json_encode(implode(',', $editor_additional_plugins))};
|
||||
<!--@endif-->
|
||||
|
||||
<!--@if($editor_toolbar === 'simple')-->
|
||||
settings.ckeconfig.toolbar = [
|
||||
{ name: 'styles', items: [ 'Font', 'FontSize', '-', 'Bold', 'Italic', 'Underline', 'TextColor', 'BGColor' ] },
|
||||
|
|
|
|||
|
|
@ -160,6 +160,13 @@
|
|||
<p class="x_help-block">{$lang->about_additional_css}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="font_size">{$lang->guide_additional_plugins}</label>
|
||||
<div class="x_controls">
|
||||
<input type="text" id="additional_plugins" name="additional_plugins" value="{implode(', ', $editor_config->additional_plugins)}" />
|
||||
<p class="x_help-block">{$lang->about_additional_plugins}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="font_size">{$lang->guide_choose_font_size_body}</label>
|
||||
<div class="x_controls">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue