mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Add admin editor page (not complated lang file)
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9084 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
200b4df6f9
commit
abe7b76c98
14 changed files with 469 additions and 256 deletions
|
|
@ -6,22 +6,21 @@
|
|||
<action name="dispEditorPopup" type="view" standalone="true" />
|
||||
<action name="dispEditorComponentInfo" type="view" standalone="true" />
|
||||
|
||||
<action name="dispEditorAdminIndex" type="view" standalone="true" admin_index="true" />
|
||||
<action name="dispEditorAdminIndex" type="view" standalone="true" menu_name="editor" menu_index="true" admin_index="true" />
|
||||
<action name="dispEditorAdminSetupComponent" type="view" standalone="true" />
|
||||
<action name="dispEditorAdminSkinColorset" type="view" standalone="true" />
|
||||
<action name="dispEditorConfigPreview" type="view" />
|
||||
<action name="dispEditorPreview" type="view" />
|
||||
<action name="dispEditorSkinColorset" type="view" />
|
||||
|
||||
|
||||
<action name="procEditorSaveDoc" type="controller" standalone="true" />
|
||||
<action name="procEditorRemoveSavedDoc" type="controller" standalone="true" />
|
||||
<action name="procEditorCall" type="controller" standalone="true" />
|
||||
<action name="procEditorInsertModuleConfig" type="controller" standalone="true" />
|
||||
|
||||
<action name="procEditorAdminEnableComponent" type="controller" standalone="true" />
|
||||
<action name="procEditorAdminDisableComponent" type="controller" standalone="true" />
|
||||
<action name="procEditorAdminMoveListOrder" type="controller" standalone="true" />
|
||||
<action name="procEditorInsertModuleConfig" type="controller" standalone="true" />
|
||||
|
||||
<action name="procEditorAdminSetupComponent" type="controller" standalone="true" ruleset="setupComponent" />
|
||||
<action name="procEditorAdminGeneralConfig" type="controller" standalone="true" ruleset="generalConfig" />
|
||||
<action name="procEditorAdminCheckUseListOrder" type="controller" standalone="true" ruleset="componentOrderAndUse" />
|
||||
|
||||
<action name="procEditorLoadSavedDocument" type="controller" standalone="true" />
|
||||
</actions>
|
||||
|
|
|
|||
|
|
@ -12,99 +12,69 @@
|
|||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Activate components
|
||||
**/
|
||||
function procEditorAdminEnableComponent() {
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
|
||||
$args->component_name = Context::get('component_name');
|
||||
$args->enabled = 'Y';
|
||||
$args->site_srl = (int)$site_module_info->site_srl;
|
||||
if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $args);
|
||||
else $output = executeQuery('editor.updateSiteComponent', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$oEditorController = &getController('editor');
|
||||
|
||||
/**
|
||||
* @brief 컴포넌트 사용설정, 목록 순서 변경
|
||||
**/
|
||||
function procEditorAdminCheckUseListOrder(){
|
||||
$enables = Context::get('enables');
|
||||
$component_names = Context::get('component_names');
|
||||
$unables = array_diff($component_names, $enables);
|
||||
|
||||
|
||||
$output = $this->editorCheckUse($enables,$unables);
|
||||
if(!$output->toBool()) return new Object();
|
||||
|
||||
$output = $this->editorListOrder($component_names);
|
||||
if(!$output->toBool()) return new Object();
|
||||
|
||||
$oEditorController = &getController('editor');
|
||||
$oEditorController->removeCache($args->site_srl);
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Deactivate components
|
||||
$this->setRedirectUrl(Context::get('error_return_url'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief check use component
|
||||
**/
|
||||
function editorCheckUse($enables,$unables){
|
||||
if(is_array($enables)){
|
||||
$args->enabled = 'Y';
|
||||
foreach($enables as $component_name){
|
||||
$args->component_name = $component_name;
|
||||
$output = executeQuery('editor.updateComponent', $args);
|
||||
}
|
||||
}
|
||||
if(!$output->toBool()) return new Object();
|
||||
|
||||
if(is_array($unables)){
|
||||
$args->enabled = 'N';
|
||||
foreach($unables as $component_name){
|
||||
$args->component_name = $component_name;
|
||||
$output = executeQuery('editor.updateComponent', $args);
|
||||
}
|
||||
}
|
||||
if(!$output->toBool()) return new Object();
|
||||
unset($args->enabled);
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief list order componet
|
||||
**/
|
||||
function procEditorAdminDisableComponent() {
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
|
||||
$args->component_name = Context::get('component_name');
|
||||
$args->enabled = 'N';
|
||||
$args->site_srl = (int)$site_module_info->site_srl;
|
||||
if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $args);
|
||||
else $output = executeQuery('editor.updateSiteComponent', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$oEditorController = &getController('editor');
|
||||
$oEditorController->removeCache($args->site_srl);
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Change a location of the component
|
||||
**/
|
||||
function procEditorAdminMoveListOrder() {
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$args->site_srl = (int)$site_module_info->site_srl;
|
||||
$args->component_name = Context::get('component_name');
|
||||
$mode = Context::get('mode');
|
||||
// Get a full list of components from the DB
|
||||
if(!$args->site_srl) $output = executeQuery('editor.getComponentList', $args);
|
||||
else $output = executeQuery('editor.getSiteComponentList', $args);
|
||||
|
||||
$db_list = $output->data;
|
||||
foreach($db_list as $key => $val) {
|
||||
if($val->component_name == $args->component_name) break;
|
||||
}
|
||||
|
||||
if($mode=="up") {
|
||||
if($key == 2) return new Object(-1,'msg_component_is_first_order');
|
||||
|
||||
$prev_args->component_name = $db_list[$key-1]->component_name;
|
||||
$prev_args->list_order = $db_list[$key]->list_order;
|
||||
$prev_args->site_srl = $args->site_srl;
|
||||
if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $prev_args);
|
||||
else $output = executeQuery('editor.updateSiteComponent', $prev_args);
|
||||
|
||||
$cur_args->component_name = $db_list[$key]->component_name;
|
||||
$cur_args->list_order = $db_list[$key-1]->list_order;
|
||||
if($prev_args->list_order == $cur_args->list_order) $cur_args->list_order--;
|
||||
$cur_args->site_srl = $args->site_srl;
|
||||
if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $cur_args);
|
||||
else $output = executeQuery('editor.updateSiteComponent', $cur_args);
|
||||
} else {
|
||||
if($key == count($db_list)-1) return new Object(-1,'msg_component_is_last_order');
|
||||
|
||||
$next_args->component_name = $db_list[$key+1]->component_name;
|
||||
$next_args->list_order = $db_list[$key]->list_order;
|
||||
$next_args->site_srl = $args->site_srl;
|
||||
if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $next_args);
|
||||
else $output = executeQuery('editor.updateSiteComponent', $next_args);
|
||||
|
||||
$cur_args->component_name = $db_list[$key]->component_name;
|
||||
$cur_args->list_order = $db_list[$key+1]->list_order;
|
||||
$cur_args->site_srl = $args->site_srl;
|
||||
if($next_args->list_order == $cur_args->list_order) $cur_args->list_order++;
|
||||
if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $cur_args);
|
||||
else $output = executeQuery('editor.updateSiteComponent', $cur_args);
|
||||
}
|
||||
|
||||
$oEditorController = &getController('editor');
|
||||
$oEditorController->removeCache($args->site_srl);
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
function editorListOrder($component_names){
|
||||
$list_order_num = '30';
|
||||
if(is_array($component_names)) {
|
||||
foreach($component_names as $name){
|
||||
$args->list_order = $list_order_num;
|
||||
$args->component_name = $name;
|
||||
$output = executeQuery('editor.updateComponent', $args);
|
||||
|
||||
if(!$output->toBool()) return new Object();
|
||||
$list_order_num++;
|
||||
}
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set components
|
||||
|
|
@ -142,6 +112,29 @@
|
|||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Config components
|
||||
**/
|
||||
|
||||
function procEditorAdminGeneralConfig(){
|
||||
$oModuleController = &getController('module');
|
||||
$configVars = Context::getRequestVars();
|
||||
|
||||
$config->editor_skin = $configVars->editor_skin;
|
||||
$config->editor_height = $configVars->editor_height;
|
||||
$config->comment_editor_skin = $configVars->comment_editor_skin;
|
||||
$config->comment_editor_height = $configVars->comment_editor_height;
|
||||
$config->content_style = $configVars->content_style;
|
||||
$config->content_font = $configVars->content_font;
|
||||
$config->content_font_size= $configVars->content_font_size.'px';
|
||||
$config->sel_editor_colorset= $configVars->sel_editor_colorset;
|
||||
$config->sel_comment_editor_colorset= $configVars->sel_comment_editor_colorset;
|
||||
|
||||
$oModuleController->insertModuleConfig('editor',$config);
|
||||
$this->setRedirectUrl(Context::get('error_return_url'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Add a component to DB
|
||||
|
|
|
|||
|
|
@ -17,15 +17,51 @@
|
|||
* @brief Administrator Setting page
|
||||
* Settings to enable/disable editor component and other features
|
||||
**/
|
||||
function dispEditorAdminIndex() {
|
||||
function dispEditorAdminIndex() {
|
||||
$component_count = 0;
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$site_srl = (int)$site_module_info->site_srl;
|
||||
$site_srl = (int)$site_module_info->site_srl;
|
||||
|
||||
// Get a type of component
|
||||
$oEditorModel = &getModel('editor');
|
||||
$component_list = $oEditorModel->getComponentList(false, $site_srl, true);
|
||||
|
||||
Context::set('component_list', $component_list);
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$editor_config = $oModuleModel->getModuleConfig('editor');
|
||||
|
||||
$component_list = $oEditorModel->getComponentList(false, $site_srl, true);
|
||||
$editor_skin_list = FileHandler::readDir(_XE_PATH_.'modules/editor/skins');
|
||||
|
||||
$skin_info = $oModuleModel->loadSkinInfo($this->module_path,$editor_config->editor_skin);
|
||||
|
||||
$contents = FileHandler::readDir(_XE_PATH_.'modules/editor/styles');
|
||||
for($i=0,$c=count($contents);$i<$c;$i++) {
|
||||
$style = $contents[$i];
|
||||
$info = $oModuleModel->loadSkinInfo($this->module_path,$style,'styles');
|
||||
$content_style_list[$style]->title = $info->title;
|
||||
}
|
||||
|
||||
// Get install info, update info, count
|
||||
$oAutoinstallModel = &getModel('autoinstall');
|
||||
foreach($component_list as $component_name => $xml_info) {
|
||||
$component_count++;
|
||||
$xml_info->path = './modules/editor/components/'.$xml_info->component_name;
|
||||
$xml_info->delete_url = $oAutoinstallModel->getRemoveUrlByPath($xml_info->path);
|
||||
$xml_info->package_srl = $oAutoinstallModel->getPackageSrlByPath($xml_info->path);
|
||||
if($xml_info->package_srl) $targetpackages[$xml_info->package_srl] = 0;
|
||||
}
|
||||
$packages = $oAutoinstallModel->getInstalledPackages(array_keys($targetpackages));
|
||||
foreach($component_list as $component_name => $xml_info) {
|
||||
if($packages[$xml_info->package_srl]) $xml_info->need_update = $packages[$xml_info->package_srl]->need_update;
|
||||
}
|
||||
$editor_config_default = array( "editor_height" => "500", "comment_editor_height" => "120","content_font_size"=>"12");
|
||||
|
||||
Context::set('editor_config', $editor_config);
|
||||
Context::set('editor_skin_list', $editor_skin_list);
|
||||
Context::set('editor_colorset_list', $skin_info->colorset);
|
||||
Context::set('content_style_list', $content_style_list);
|
||||
Context::set('component_list', $component_list);
|
||||
Context::set('component_count', $component_count);
|
||||
Context::set('editor_config_default', $editor_config_default);
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('admin_index');
|
||||
}
|
||||
|
|
@ -71,6 +107,5 @@
|
|||
$this->setTemplateFile('setup_component');
|
||||
$this->setLayoutFile("popup_layout");
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -22,14 +22,16 @@
|
|||
/**
|
||||
* @brief Return editor setting for each module
|
||||
**/
|
||||
function getEditorConfig($module_srl) {
|
||||
if(!$GLOBALS['__editor_module_config__'][$module_srl]) {
|
||||
function getEditorConfig($module_srl = null) {
|
||||
if(!$GLOBALS['__editor_module_config__'][$module_srl] && $module_srl) {
|
||||
// Get trackback settings of the selected module
|
||||
$oModuleModel = &getModel('module');
|
||||
$GLOBALS['__editor_module_config__'][$module_srl] = $oModuleModel->getModulePartConfig('editor', $module_srl);
|
||||
}
|
||||
|
||||
$editor_config = $GLOBALS['__editor_module_config__'][$module_srl];
|
||||
$editor_config = $GLOBALS['__editor_module_config__'][$module_srl];
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$editor_default_config = $oModuleModel->getModuleConfig('editor');
|
||||
|
||||
if(!is_object($editor_config)) $editor_config = null;
|
||||
|
||||
|
|
@ -42,14 +44,20 @@
|
|||
if(!is_array($editor_config->enable_component_grant)) $editor_config->enable_component_grant = array();
|
||||
if(!is_array($editor_config->enable_comment_component_grant)) $editor_config->enable_comment_component_grant= array();
|
||||
|
||||
if(!$editor_config->editor_height) $editor_config->editor_height = 500;
|
||||
if(!$editor_config->comment_editor_height) $editor_config->comment_editor_height = 120;
|
||||
if($editor_config->enable_autosave!='N') $editor_config->enable_autosave = "Y";
|
||||
|
||||
if(!$editor_config->editor_skin) $editor_config->editor_skin = 'xpresseditor';
|
||||
if(!$editor_config->comment_editor_skin) $editor_config->comment_editor_skin = 'xpresseditor';
|
||||
if(!$editor_config->content_style) $editor_config->content_style = 'default';
|
||||
|
||||
|
||||
if(!$editor_config->editor_height) if($editor_default_config->editor_height? $editor_config->editor_height = $editor_default_config->editor_height : $editor_config->editor_height = 500);
|
||||
if(!$editor_config->comment_editor_height) if($editor_default_config->comment_editor_height? $editor_config->comment_editor_height = $editor_default_config->comment_editor_height : $editor_config->comment_editor_height = 120);
|
||||
if(!$editor_config->editor_skin) if($editor_default_config->editor_skin? $editor_config->editor_skin = $editor_default_config->editor_skin : $editor_config->editor_skin = 'xpresseditor');
|
||||
if(!$editor_config->comment_editor_skin) if($editor_default_config->comment_editor_skin? $editor_config->comment_editor_skin = $editor_default_config->comment_editor_skin : $editor_config->comment_editor_skin = 'xpresseditor');
|
||||
if(!$editor_config->content_style) if($editor_default_config->content_style? $editor_config->content_style = $editor_default_config->content_style : $editor_config->content_style = 'default');
|
||||
|
||||
if(!$editor_config->content_font && $editor_default_config->content_font) $editor_config->content_font = $editor_default_config->content_font;
|
||||
if(!$editor_config->content_font_size && $editor_default_config->content_font_size) $editor_config->content_font_size = $editor_default_config->content_font_size;
|
||||
|
||||
if(!$editor_config->sel_editor_colorset && $editor_default_config->sel_editor_colorset) $editor_config->sel_editor_colorset = $editor_default_config->sel_editor_colorset;
|
||||
if(!$editor_config->sel_comment_editor_colorset && $editor_default_config->sel_comment_editor_colorset) $editor_config->sel_comment_editor_colorset = $editor_default_config->sel_comment_editor_colorset;
|
||||
if(!$editor_config->comment_content_style && $editor_default_config->comment_content_style) $editor_config->comment_content_style = $editor_default_config->comment_content_style;
|
||||
return $editor_config;
|
||||
}
|
||||
|
||||
|
|
@ -195,7 +203,8 @@
|
|||
// Default font setting
|
||||
Context::set('content_font', $option->content_font);
|
||||
Context::set('content_font_size', $option->content_font_size);
|
||||
// Option setting to allow auto-save
|
||||
|
||||
// Option setting to allow auto-save
|
||||
if(!$option->enable_autosave) $enable_autosave = false;
|
||||
elseif(Context::get($option->primary_key_name)) $enable_autosave = false;
|
||||
else $enable_autosave = true;
|
||||
|
|
|
|||
|
|
@ -120,9 +120,56 @@
|
|||
function dispEditorSkinColorset(){
|
||||
$skin = Context::get('skin');
|
||||
$oModuleModel = &getModel('module');
|
||||
$skin_info = $oModuleModel->loadSkinInfo($this->module_path,$skin);
|
||||
$skin_info = $oModuleModel->loadSkinInfo($this->module_path,$skin);
|
||||
$colorset = $skin_info->colorset;
|
||||
Context::set('colorset', $colorset);
|
||||
|
||||
Context::set('colorset', $colorset);
|
||||
}
|
||||
|
||||
function dispEditorConfigPreview() {
|
||||
$oEditorModel = &getModel('editor');
|
||||
$config = $oEditorModel->getEditorConfig();
|
||||
|
||||
$option->allow_fileupload = false;
|
||||
$option->content_style = $config->content_style;
|
||||
$option->content_font = $config->content_font;
|
||||
$option->content_font_size = $config->content_font_size;
|
||||
$option->enable_autosave = false;
|
||||
$option->enable_default_component = true;
|
||||
$option->enable_component = true;
|
||||
$option->disable_html = false;
|
||||
$option->height = $config->editor_height;
|
||||
$option->skin = $config->editor_skin;
|
||||
$option->content_key_name = 'dummy_content';
|
||||
$option->primary_key_name = 'dummy_key';
|
||||
$option->colorset = $config->sel_editor_colorset;
|
||||
$editor = $oEditorModel->getEditor(0, $option);
|
||||
|
||||
Context::set('editor', $editor);
|
||||
|
||||
$option_com->allow_fileupload = false;
|
||||
$option_com->content_style = $config->content_style;
|
||||
$option_com->content_font = $config->content_font;
|
||||
$option_com->content_font_size = $config->content_font_size;
|
||||
$option_com->enable_autosave = false;
|
||||
$option_com->enable_default_component = true;
|
||||
$option_com->enable_component = true;
|
||||
$option_com->disable_html = false;
|
||||
$option_com->height = $config->comment_editor_height;
|
||||
$option_com->skin = $config->comment_editor_skin;
|
||||
$option_com->content_key_name = 'dummy_content2';
|
||||
$option_com->primary_key_name = 'dummy_key2';
|
||||
$option_com->content_style = $config->comment_content_style;
|
||||
$option_com->colorset = $config->sel_comment_editor_colorset;
|
||||
|
||||
$editor_comment = $oEditorModel->getEditor(0, $option_com);
|
||||
|
||||
Context::set('editor_comment', $editor_comment);
|
||||
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('config_preview');
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@
|
|||
<value xml:lang="ru"><![CDATA[Размер шрифта]]></value>
|
||||
<value xml:lang="tr"><![CDATA[İçerik Yazı Boyutu]]></value>
|
||||
<value xml:lang="vi"><![CDATA[Cỡ chữ của nội dung]]></value>
|
||||
</item>
|
||||
</item>
|
||||
<item name="about_component">
|
||||
<value xml:lang="ko"><![CDATA[컴포넌트 소개]]></value>
|
||||
<value xml:lang="en"><![CDATA[About component]]></value>
|
||||
|
|
@ -547,53 +547,38 @@ Bài viết tự động lưu sẽ tự động hủy sau khi bạn hoàn thành
|
|||
<value xml:lang="tr"><![CDATA[Paragraf Özelliği]]></value>
|
||||
<value xml:lang="vi"><![CDATA[Chức năng Paragraph]]></value>
|
||||
</item>
|
||||
<item name="fontlist" type="array">
|
||||
<item name="Dotum">
|
||||
<value xml:lang="ko"><![CDATA[돋움]]></value>
|
||||
<item name="fontlist" type="array">
|
||||
<item name="arial">
|
||||
<value xml:lang="ko"><![CDATA[Arial, Helvetica, sans-serif]]></value>
|
||||
</item>
|
||||
<item name="Gulim">
|
||||
<value xml:lang="ko"><![CDATA[굴림]]></value>
|
||||
<item name="tahoma">
|
||||
<value xml:lang="ko"><![CDATA[Tahoma, Geneva, sans-serif]]></value>
|
||||
</item>
|
||||
<item name="Batang">
|
||||
<value xml:lang="ko"><![CDATA[바탕]]></value>
|
||||
<item name="verdana">
|
||||
<value xml:lang="ko"><![CDATA[Verdana, Geneva, sans-serif]]></value>
|
||||
</item>
|
||||
<item name="Arial">
|
||||
<value xml:lang="ko"><![CDATA[Arial]]></value>
|
||||
<value xml:lang="en"><![CDATA[Arial]]></value>
|
||||
</item>
|
||||
<item name="Arial Black">
|
||||
<value xml:lang="ko"><![CDATA[Arial Black]]></value>
|
||||
<value xml:lang="en"><![CDATA[Arial Black]]></value>
|
||||
</item>
|
||||
<item name="Tahoma">
|
||||
<value xml:lang="ko"><![CDATA[Tahoma]]></value>
|
||||
<value xml:lang="en"><![CDATA[Tahoma]]></value>
|
||||
</item>
|
||||
<item name="Verdana">
|
||||
<value xml:lang="ko"><![CDATA[Verdana]]></value>
|
||||
<value xml:lang="en"><![CDATA[Verdana]]></value>
|
||||
</item>
|
||||
<item name="Sans-serif">
|
||||
<item name="sans-serif">
|
||||
<value xml:lang="ko"><![CDATA[Sans-serif]]></value>
|
||||
<value xml:lang="en"><![CDATA[Sans-serif]]></value>
|
||||
</item>
|
||||
<item name="Serif">
|
||||
<item name="georgia">
|
||||
<value xml:lang="ko"><![CDATA[Georgia, 'Times New Roman', Times, serif]]></value>
|
||||
</item>
|
||||
<item name="palatinoLinotype">
|
||||
<value xml:lang="ko"><![CDATA['Palatino Linotype', 'Book Antiqua', Palatino, serif]]></value>
|
||||
</item>
|
||||
<item name="timesNewRoman">
|
||||
<value xml:lang="ko"><![CDATA['Times New Roman', Times, serif]]></value>
|
||||
</item>
|
||||
<item name="serif">
|
||||
<value xml:lang="ko"><![CDATA[Serif]]></value>
|
||||
<value xml:lang="en"><![CDATA[Serif]]></value>
|
||||
</item>
|
||||
<item name="Monospace">
|
||||
<value xml:lang="ko"><![CDATA[Monospace]]></value>
|
||||
<value xml:lang="en"><![CDATA[Monospace]]></value>
|
||||
</item>
|
||||
<item name="Cursive">
|
||||
<value xml:lang="ko"><![CDATA[Cursive]]></value>
|
||||
<value xml:lang="en"><![CDATA[Cursive]]></value>
|
||||
</item>
|
||||
<item name="Fantasy">
|
||||
<value xml:lang="ko"><![CDATA[Fantasy]]></value>
|
||||
<value xml:lang="en"><![CDATA[Fantasy]]></value>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
<item name="courierNew">
|
||||
<value xml:lang="ko"><![CDATA['Courier New', Courier, monospace]]></value>
|
||||
</item>
|
||||
<item name="lucidaConsole">
|
||||
<value xml:lang="ko"><![CDATA['Lucida Console', Monaco, monospace]]></value>
|
||||
</item>
|
||||
</item>
|
||||
<item name="header">
|
||||
<value xml:lang="ko"><![CDATA[형식]]></value>
|
||||
<value xml:lang="en"><![CDATA[Style]]></value>
|
||||
|
|
|
|||
7
modules/editor/ruleset/componentOrderAndUse.xml
Normal file
7
modules/editor/ruleset/componentOrderAndUse.xml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ruleset version="1.5.0">
|
||||
<customrules>
|
||||
</customrules>
|
||||
<fields>
|
||||
</fields>
|
||||
</ruleset>
|
||||
9
modules/editor/ruleset/generalConfig.xml
Normal file
9
modules/editor/ruleset/generalConfig.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ruleset version="1.5.0">
|
||||
<customrules>
|
||||
</customrules>
|
||||
<fields>
|
||||
<field name="editor_height" required="true" rule="number" />
|
||||
<field name="comment_editor_height" required="true" rule="number" />
|
||||
</fields>
|
||||
</ruleset>
|
||||
|
|
@ -83,7 +83,7 @@
|
|||
<select class="xpress_xeditor_ui_fontName_select">
|
||||
<option value="">{$lang->edit->fontname}</option>
|
||||
<!--@foreach($lang->edit->fontlist as $key=>$obj)-->
|
||||
<option value="{$key}" style="font-family:{$key}">{$obj}</option>
|
||||
<option value="{$key}" style="font-family:{$obj}">{$obj}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@
|
|||
<select class="xpress_xeditor_ui_fontName_select" disabled="disabled">
|
||||
<option value="">{$lang->edit->fontname}</option>
|
||||
<!--@foreach($lang->edit->fontlist as $key=>$obj)-->
|
||||
<option value="{$key}" style="font-family:{$key}">{$obj}</option>
|
||||
<option value="{$key}" style="font-family:{$obj}">{$obj}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -1,40 +1,170 @@
|
|||
<!--%import("js/editor_admin.js")-->
|
||||
<!--%import("js/editor_module_config.js")-->
|
||||
|
||||
<h3 class="xeAdmin">{$lang->editor} <span class="gray">{$lang->cmd_management}</span></h3>
|
||||
<div class="content" id="content">
|
||||
<h1 class="h1">WYSIWYG Editor</h1>
|
||||
<h2 class="h2">Editor Preview</h2>
|
||||
|
||||
<!-- Editor Preview -->
|
||||
<a href="{getUrl('module', 'admin', 'act', 'dispEditorConfigPreview')}" target="_blank">미리보기</a>
|
||||
<!-- /Editor Preview -->
|
||||
<form action="./" method="post" class="form" ruleset="generalConfig">
|
||||
<input type="hidden" name="act" value="procEditorAdminGeneralConfig " />
|
||||
|
||||
<table cellspacing="0" class="crossTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="half_wide"><div>{$lang->description}</div></th>
|
||||
<th scope="col" class="half_wide"><div>{$lang->component_author}</div></th>
|
||||
<th scope="col" colspan="2"><div>{$lang->component_version}</div></th>
|
||||
<th scope="col"><div>{$lang->component_date}</div></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!--@foreach($component_list as $component_name => $xml_info)-->
|
||||
<tr class="row2">
|
||||
<th colspan="2" scope="row"><div><a href="{getUrl('module','editor','act','dispEditorComponentInfo','component_name',$component_name)}" onclick="popopen(this.href);return false;"><strong>{$xml_info->title}</strong></a> ({$component_name})</div></th>
|
||||
<th><a href="#" onclick="doSetupComponent('{$component_name}'); return false;" title="{htmlspecialchars($lang->cmd_setup)}" class="buttonSet buttonSetting"><span>{$lang->cmd_setup}</span></a></th>
|
||||
<th>
|
||||
<!--@if($xml_info->enabled=='Y')-->
|
||||
<a href="#" onclick="doDisableComponent('{$component_name}');return false;" title="{htmlspecialchars($lang->cmd_enable)}" class="buttonSet buttonActive"><span>{$lang->cmd_enable}</span></a>
|
||||
<!--@else-->
|
||||
<a href="#" onclick="doEnableComponent('{$component_name}');return false;" title="{htmlspecialchars($lang->cmd_disable)}" class="buttonSet buttonDisable"><span>{$lang->cmd_disable}</span></a>
|
||||
<!--@end-->
|
||||
</th>
|
||||
<th><a href="#" onclick="doMoveListOrder('{$component_name}','up');return false;" title="{htmlspecialchars($lang->cmd_move_up)}" class="buttonSet buttonUp"><span>{$lang->cmd_move_up}</span></a><a href="#" onclick="doMoveListOrder('{$component_name}','down');return false;" title="{htmlspecialchars($lang->cmd_move_down)}" class="buttonSet buttonDown"><span>{$lang->cmd_move_down}</span></a></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{nl2br($xml_info->description)}</td>
|
||||
<td class="nowrap">
|
||||
<!--@foreach($xml_info->author as $author)-->
|
||||
<a href="{$author->homepage}" onclick="window.open(this.href);return false;">{$author->name}</a>
|
||||
<!--@endforeach-->
|
||||
</td>
|
||||
<td colspan="2">{$xml_info->version}</td>
|
||||
<td>{$xml_info->date}</td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
</tbody>
|
||||
</table>
|
||||
<fieldset class="section">
|
||||
<h2 class="h2">Editor Option</h2>
|
||||
<ul>
|
||||
<li>
|
||||
<p class="q">본문 에디터를 선택하세요.</p>
|
||||
<p class="a">
|
||||
<!--@foreach($editor_skin_list as $editor)-->
|
||||
<input type="radio" name="editor_skin" value="{$editor}" id="doc_{$editor}" onClick="getEditorSkinColorList(this.value, null, 'document','doc_{$editor}')" <!--@if($editor==$editor_config->editor_skin)-->checked="checked" <!--@end-->/>
|
||||
<label for="doc_{$editor}" value='sdf'>{$editor}</label>
|
||||
<select name="sel_editor_colorset" <!--@if($editor==$editor_config->editor_skin)--> >
|
||||
<!--@foreach($editor_colorset_list as $key => $val)-->
|
||||
<option value="{$val->name}" <!--@if($editor_config->sel_editor_colorset == $val->name)-->selected="selected"<!--@end-->>{$val->title}</option>
|
||||
<!--@end-->
|
||||
<!--@else-->style="display:none"> <!--@end-->
|
||||
</select>
|
||||
<br />
|
||||
<!--@end-->
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="q"><label for="editor_height">본문 에디터의 높이를 설정하세요.</label></p>
|
||||
<p class="a"><input type="text" name="editor_height" id="editor_height" value="<!--@if($editor_config->editor_height)-->{$editor_config->editor_height}<!--@else-->{$editor_config_default['editor_height']}<!--@end-->" style="width:30px" /> px</p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="q">댓글 에디터를 선택하세요.</p>
|
||||
<p class="a">
|
||||
<!--@foreach($editor_skin_list as $editor)-->
|
||||
<input type="radio" name="comment_editor_skin" value="{$editor}" id="com_{$editor}" onclick="getEditorSkinColorList(this.value, null, 'reply','com_{$editor}')" <!--@if($editor == $editor_config->comment_editor_skin)-->checked="checked" <!--@end-->/>
|
||||
<label for="com_{$editor}">{$editor}</label>
|
||||
<select name="sel_comment_editor_colorset" <!--@if($editor==$editor_config->comment_editor_skin)--> >
|
||||
<!--@foreach($editor_colorset_list as $key => $val)-->
|
||||
<option value="{$val->name}" <!--@if($editor_config->sel_comment_editor_colorset == $val->name)-->selected="selected"<!--@end-->>{$val->title}</option>
|
||||
<!--@end-->
|
||||
<!--@else-->style="display:none"> <!--@end-->
|
||||
</select>
|
||||
<br />
|
||||
<!--@end-->
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="q"><label for="comment_editor_height">댓글 에디터의 높이를 설정하세요.</label></p>
|
||||
<p class="a"><input type="text" name="comment_editor_height"id="comment_editor_height" value="<!--@if($editor_config->comment_editor_height)-->{$editor_config->comment_editor_height}<!--@else-->{$editor_config_default['comment_editor_height']}<!--@end-->" style="width:30px" /> px</p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="q">본문 서식을 선택하세요.</p>
|
||||
<p class="a">
|
||||
<!--@foreach($content_style_list as $key => $val)-->
|
||||
<input type="radio" name="content_style" value="{$key}" id="style_{$key}" <!--@if($key==$editor_config->content_style||!$editor_config->content_style&&$key=='default')-->checked="checked"<!--@end-->><label for="style_{$key}">{$key}</label>
|
||||
<!--@end-->
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="q">본문 글꼴을 선택하세요.</p>
|
||||
<textarea rows="3" cols="42" class="fontPreview" title="Font Preview">
|
||||
The quick brown fox jumps over the lazy dog.
|
||||
いろはにほへと / ちりぬるを / わかよたれそ / つねならむ / うゐのおくやま / けふこえて / あさきゆめみし / ゑひもせす
|
||||
키스의 고유 조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다.</textarea>
|
||||
<p class="answer fontSelector">
|
||||
<input type="radio" name="content_font" id="font_noFont" value="" <!--@if(!$editor_config->content_font)-->checked="checked" <!--@end-->/> <label for="font_noFont" style="font-family:''">none(inherit)</label><br />
|
||||
<!--@foreach($lang->edit->fontlist as $name => $detail)-->
|
||||
<input type="radio" name="content_font" id="font_{$name}" value="{$name}" <!--@if($editor_config->content_font==$name)-->checked="checked" <!--@end-->/> <label for="font_{$name}" style="font-family:{$detail}">{$detail}</label><br />
|
||||
<!--@end-->
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="q"><label for="fontSize">본문 글꼴 크기를 선택하세요.</label></p>
|
||||
<textarea rows="3" cols="42" class="fontPreview" title="Font Preview">
|
||||
The quick brown fox jumps over the lazy dog.
|
||||
いろはにほへと / ちりぬるを / わかよたれそ / つねならむ / うゐのおくやま / けふこえて / あさきゆめみし / ゑひもせす
|
||||
키스의 고유 조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다.</textarea>
|
||||
<p class="a"><input type="text" id="fontSize" name="content_font_size" value="<!--@if($editor_config->content_font_size)-->{str_replace('px','',$editor_config->content_font_size)}<!--@else-->{str_replace('px','',$editor_config_default['content_font_size'])}<!--@end-->" style="width:30px" /> px</p>
|
||||
</li>
|
||||
<script type="text/javascript">
|
||||
jQuery(function($){
|
||||
var fontPreview = $('.fontPreview');
|
||||
var fontRadio = $('.fontSelector>:radio');
|
||||
var checkedFont = fontRadio.filter(':checked').next('label').css('fontFamily');
|
||||
fontPreview.css('fontFamily',checkedFont);
|
||||
fontRadio.change(function(){
|
||||
var myFont = $(this).next('label').css('fontFamily');
|
||||
fontPreview.css('fontFamily',myFont);
|
||||
});
|
||||
var changedSize = $('#fontSize').val();
|
||||
fontPreview.css('fontSize',changedSize+'px');
|
||||
$('#fontSize').keyup(function(){
|
||||
var mySize = $(this).val();
|
||||
fontPreview.css('fontSize',mySize+'px');
|
||||
if(mySize.length==0){fontPreview.css('fontSize','')};
|
||||
if(mySize>28){
|
||||
alert('본문에서 사용하기에 글꼴이 너무 큽니다');
|
||||
$(this).val('28');
|
||||
fontPreview.css('fontSize','28px');
|
||||
};
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</ul>
|
||||
<div class="btnArea">
|
||||
<span class="btn"><input type="submit" value="Save" /></span>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
<form action="./" method="post" class="form" ruleset="componentOrderAndUse">
|
||||
<input type="hidden" name="act" value="procEditorAdminCheckUseListOrder" />
|
||||
<fieldset class="section">
|
||||
<h2 class="h2">Editor Component</h2>
|
||||
<div class="table even easyList">
|
||||
<table id="sortable_table" class="sortable"width="100%" border="1" cellspacing="0">
|
||||
<caption>
|
||||
All({$component_count})
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">이동</th>
|
||||
<th scope="col" class="title">{$lang->component_name} {$lang->user_name}</th>
|
||||
<th scope="col">{$lang->version}</th>
|
||||
<th scope="col">{$lang->author}</th>
|
||||
<th scope="col">{$lang->path}</th>
|
||||
<th scope="col">{$lang->use}</th>
|
||||
<th scope="col">{$lang->cmd_delete}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="uDrag">
|
||||
<!--@foreach($component_list as $component_name => $xml_info)-->
|
||||
<tr>
|
||||
<td><div class="wrap" style="height:80px"><button type="button" class="dragBtn">Move to</button></div></td>
|
||||
<td class="title">
|
||||
<input type="hidden" name="component_names[]" value="{$xml_info->component_name}" />
|
||||
<p><b>{$xml_info->title}</b></p>
|
||||
<p>{nl2br($xml_info->description)}</p>
|
||||
<!--@if($xml_info->version && $xml_info->need_update == 'Y')-->
|
||||
<p class="update">이 항목 업데이트가 가능합니다. <a href="#">업데이트 하시겠습니까?</a></p>
|
||||
<!--@end-->
|
||||
</td>
|
||||
<td>{$xml_info->version}</td>
|
||||
<td>
|
||||
<!--@foreach($xml_info->author as $author)-->
|
||||
<a href="{$author->homepage}" target="_blank">{$author->name}</a>
|
||||
<!--@endforeach-->
|
||||
</td>
|
||||
<td>{$xml_info->path}</td>
|
||||
<td><input type="checkbox" name="enables[]" id="enable" value="{$xml_info->component_name}" title="Use this component " <!--@if($xml_info->enabled=='Y')--> checked="checked"<!--@end--> /></td>
|
||||
<td>
|
||||
<!--@if($xml_info->version && $xml_info->delete_url)-->
|
||||
<a href="{$xml_info->delete_url}">Delete</a>
|
||||
<!--@end-->
|
||||
</td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="btnArea">
|
||||
<span class="btn"><input type="submit" value="Save" /></span>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
|||
18
modules/editor/tpl/config_preview.html
Normal file
18
modules/editor/tpl/config_preview.html
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<load target="../../admin/tpl/css/admin.css" />
|
||||
<load target="../../admin/tpl/css/admin_{$lang_type}.css" />
|
||||
<div class="x" style="padding: 10px;">
|
||||
<h2 class="h2">에디터 미리보기</h2>
|
||||
<h2 class="h3">본문 에디터</h2>
|
||||
<form onSubmit="return false">
|
||||
<input type="hidden" name="dummy_content" />
|
||||
<input type="hidden" name="dummy_key" value="1" />
|
||||
|
||||
<p>{$editor}</p>
|
||||
</form><br />
|
||||
<h2 class="h3">댓글 에디터</h2>
|
||||
<form onSubmit="return false">
|
||||
<input type="hidden" name="dummy_content2" />
|
||||
<input type="hidden" name="dummy_key2" value="1" />
|
||||
<p>{$editor_comment}</p>
|
||||
</form>
|
||||
</div>
|
||||
|
|
@ -2,34 +2,8 @@
|
|||
* @author NHN (developers@xpressengine.com)
|
||||
* @version 0.1
|
||||
* @brief 에디터 관리자 페이지용 스크립트
|
||||
**/
|
||||
|
||||
function doEnableComponent(component_name) {
|
||||
var params = new Array();
|
||||
params['component_name'] = component_name;
|
||||
|
||||
exec_xml('editor', 'procEditorAdminEnableComponent', params, completeUpdate);
|
||||
}
|
||||
|
||||
function doDisableComponent(component_name) {
|
||||
var params = new Array();
|
||||
params['component_name'] = component_name;
|
||||
|
||||
exec_xml('editor', 'procEditorAdminDisableComponent', params, completeUpdate);
|
||||
}
|
||||
|
||||
function doMoveListOrder(component_name, mode) {
|
||||
var params = new Array();
|
||||
params['component_name'] = component_name;
|
||||
params['mode'] = mode;
|
||||
|
||||
exec_xml('editor', 'procEditorAdminMoveListOrder', params, completeUpdate);
|
||||
}
|
||||
|
||||
function completeUpdate(ret_obj) {
|
||||
location.reload();
|
||||
}
|
||||
|
||||
**/
|
||||
|
||||
function doSetupComponent(component_name) {
|
||||
popopen(request_uri.setQuery('module','editor').setQuery('act','dispEditorAdminSetupComponent').setQuery('component_name',component_name), 'SetupComponent');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,37 +1,44 @@
|
|||
function getEditorSkinColorList(skin_name,selected_colorset,type){
|
||||
function getEditorSkinColorList(skin_name,selected_colorset,type,testid){
|
||||
if(skin_name.length>0){
|
||||
type = type || 'document';
|
||||
var response_tags = new Array('error','message','colorset');
|
||||
exec_xml('editor','dispEditorSkinColorset',{skin:skin_name},resultGetEditorSkinColorList,response_tags,{'selected_colorset':selected_colorset,'type':type});
|
||||
exec_xml('editor','dispEditorSkinColorset',{skin:skin_name},resultGetEditorSkinColorList,response_tags,{'selected_colorset':selected_colorset,'type':type,'testid':testid});
|
||||
}
|
||||
}
|
||||
|
||||
function resultGetEditorSkinColorList(ret_obj,response_tags, params) {
|
||||
|
||||
var selectbox = null;
|
||||
if(params.type == 'document'){
|
||||
selectbox = xGetElementById("sel_editor_colorset");
|
||||
}else{
|
||||
selectbox = xGetElementById("sel_comment_editor_colorset");
|
||||
}
|
||||
jQuery(function($){
|
||||
selectbox = jQuery("#"+params.testid).next('label').next('select');
|
||||
selectbox.html('');
|
||||
|
||||
if(params.type == 'document'){
|
||||
$("select[name=sel_editor_colorset]").css('display','none');
|
||||
$("select[name=sel_editor_colorset]").removeAttr('name');
|
||||
selectbox.attr('name','sel_editor_colorset');
|
||||
}else{
|
||||
$("select[name=sel_comment_editor_colorset]").css('display','none');
|
||||
$("select[name=sel_comment_editor_colorset]").removeAttr('name');
|
||||
selectbox.attr('name','sel_comment_editor_colorset');
|
||||
}
|
||||
|
||||
if(ret_obj['error'] == 0 && ret_obj.colorset){
|
||||
var it = new Array();
|
||||
var items = ret_obj['colorset']['item'];
|
||||
if(typeof(items[0]) == 'undefined'){
|
||||
it[0] = items;
|
||||
}else{
|
||||
it = items;
|
||||
}
|
||||
var sel = 0;
|
||||
for(var i=0,c=it.length;i<c;i++){
|
||||
selectbox.options[i]=new Option(it[i].title,it[i].name);
|
||||
if(params.selected_colorset && params.selected_colorset == it[i].name) sel = i;
|
||||
}
|
||||
selectbox.options[sel].selected = true;
|
||||
selectbox.style.display="";
|
||||
}else{
|
||||
selectbox.style.display="none";
|
||||
selectbox.innerHTML="";
|
||||
}
|
||||
if(ret_obj['error'] == 0 && ret_obj.colorset){
|
||||
var it = new Array();
|
||||
|
||||
var items = ret_obj['colorset']['item'];
|
||||
if(typeof(items[0]) == 'undefined'){
|
||||
it[0] = items;
|
||||
}else{
|
||||
it = items;
|
||||
}
|
||||
var selectAttr = "";
|
||||
for(var i=0;i<it.length;i++){
|
||||
selectbox.append($('<option value="'+it[i].name+'" >'+it[i].title+'</option>'));
|
||||
}
|
||||
selectbox.css('display','');
|
||||
}else{
|
||||
selectbox.css('display','none');
|
||||
selectbox.innerHTML="";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue