mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 11:11:39 +09:00
* 기본 에디터 스타일과 기본 스타일 설정이 충돌하는 경우가 많았습니다. - 기본 스타일을 지정했는데, 기본 에디터 스타일 내의 스타일 지정이 있는 경우 반영이 안되는 경우, 또는 기본 에디터 스타일을 변경했는데 기본 스타일 설정 때문에 반영이 적절하게 되지 않는 경우 등. * 기본 에디터 스타일에서도 less 또는 sass를 사용하도록 하고 싶었지만, 위지윅 에디터에서 본문에 나타날 스타일을 그대로 보여주는데 한계가 있었습니다. - 기본 에디터 스타일을 위지윅 에디터 내에서 나타내기 위해서 변칙적인 방법이 많이 활용되었습니다. 때문에 실제 본문에서 적용되는 스타일 시트의 우선순위와 위지윅 에디터 내에서 적용되는 스타일 시트의 우선순위에 차이가 있었습니다. 이 차이는 실제 보여지는 스타일과 작성하는 에디터 내의 스타일 차이를 크게 만들 가능성이 있었습니다. * 기능의 의미가 많이 퇴색되었고, 의미 전달이 명확하지 않은 기능이었습니다. - 기능상 기본 에디터 스타일과 기본 스타일은 서로 겹치는 영역의 기능입니다. 기본으로 포함된 두 에디터 스타일 간에 차이가 크지 않기도 해서 어떤 기능인지 사용자가 알아채기도 어려웠습니다. 자료실에 배포되고 있는 에디터 스타일도 대단히 적었습니다. * 게시판이나 각 글의 모듈 스킨에서 지정하는 스타일과 충돌할 가능성도 있습니다. 따라서, 에디터 스타일이 의도한 것 처럼 글의 스타일에 대한 관리자 통제 기능은 유지하면서, 다른 기능과 중복되거나 충돌할 수 있는 기능을 정리합니다. 가능한 많은 환경에서 테스트 하였으나, 추가로 이와 관련한 의견이 있을 경우 merge 후에도 계속 반영 해나가겠습니다.
145 lines
4.6 KiB
PHP
145 lines
4.6 KiB
PHP
<?php
|
|
/* Copyright (C) NAVER <http://www.navercorp.com> */
|
|
/**
|
|
* @class editorAdminView
|
|
* @author NAVER (developers@xpressengine.com)
|
|
* @brief editor admin view of the module class
|
|
*/
|
|
class editorAdminView extends editor
|
|
{
|
|
/**
|
|
* @brief Initialization
|
|
*/
|
|
function init()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @brief Administrator Setting page
|
|
* Settings to enable/disable editor component and other features
|
|
*/
|
|
function dispEditorAdminIndex()
|
|
{
|
|
$component_count = 0;
|
|
$site_module_info = Context::get('site_module_info');
|
|
$site_srl = (int)$site_module_info->site_srl;
|
|
|
|
// Get a type of component
|
|
$oEditorModel = getModel('editor');
|
|
$oModuleModel = getModel('module');
|
|
$editor_config = $oModuleModel->getModuleConfig('editor');
|
|
|
|
if(!$editor_config)
|
|
{
|
|
$editor_config = new stdClass();
|
|
}
|
|
|
|
// Use default config for missing values.
|
|
foreach ($this->default_editor_config as $key => $val)
|
|
{
|
|
if (!isset($editor_config->$key))
|
|
{
|
|
$editor_config->$key = $val;
|
|
}
|
|
}
|
|
|
|
$component_list = $oEditorModel->getComponentList(false, $site_srl, true);
|
|
$editor_skin_list = FileHandler::readDir(_XE_PATH_.'modules/editor/skins');
|
|
$editor_skin_list = array_filter($editor_skin_list, function($name) { return !starts_with('xpresseditor', $name) && !starts_with('dreditor', $name); });
|
|
|
|
$skin_info = $oModuleModel->loadSkinInfo($this->module_path,$editor_config->editor_skin);
|
|
$comment_skin_info = $oModuleModel->loadSkinInfo($this->module_path,$editor_config->comment_editor_skin);
|
|
|
|
// 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;
|
|
}
|
|
|
|
if(is_array($targetpackages)) $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;
|
|
}
|
|
|
|
Context::set('editor_config', $editor_config);
|
|
Context::set('editor_skin_list', $editor_skin_list);
|
|
Context::set('editor_colorset_list', $skin_info->colorset);
|
|
Context::set('comment_editor_colorset_list', $comment_skin_info->colorset);
|
|
Context::set('component_list', $component_list);
|
|
Context::set('component_count', $component_count);
|
|
|
|
$security = new Security();
|
|
$security->encodeHTML('component_list....');
|
|
|
|
$this->setTemplatePath($this->module_path.'tpl');
|
|
$this->setTemplateFile('admin_index');
|
|
}
|
|
|
|
/**
|
|
* @brief Component setup
|
|
*/
|
|
function dispEditorAdminSetupComponent()
|
|
{
|
|
$site_module_info = Context::get('site_module_info');
|
|
$site_srl = (int)$site_module_info->site_srl;
|
|
|
|
$component_name = Context::get('component_name');
|
|
// Get information of the editor component
|
|
$oEditorModel = getModel('editor');
|
|
$component = $oEditorModel->getComponent($component_name,$site_srl);
|
|
|
|
if(!$component->component_name)
|
|
{
|
|
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
|
}
|
|
|
|
Context::set('component', $component);
|
|
// Get a group list to set a group
|
|
$oMemberModel = getModel('member');
|
|
$group_list = $oMemberModel->getGroups($site_srl);
|
|
Context::set('group_list', $group_list);
|
|
// Get a mid list
|
|
$oModuleModel = getModel('module');
|
|
|
|
$args =new stdClass();
|
|
$args->site_srl = $site_srl;
|
|
$columnList = array('module_srl', 'mid', 'module_category_srl', 'browser_title');
|
|
$mid_list = $oModuleModel->getMidList($args, $columnList);
|
|
// Combination of module_category and module
|
|
if(!$args->site_srl)
|
|
{
|
|
// Get a list of module category
|
|
$module_categories = $oModuleModel->getModuleCategories();
|
|
|
|
if(!is_array($mid_list)) $mid_list = array($mid_list);
|
|
foreach($mid_list as $module_srl => $module)
|
|
{
|
|
if($module) $module_categories[$module->module_category_srl]->list[$module_srl] = $module;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
$module_categories[0]->list = $mid_list;
|
|
}
|
|
|
|
Context::set('mid_list',$module_categories);
|
|
|
|
//Security
|
|
$security = new Security();
|
|
$security->encodeHTML('group_list..title');
|
|
$security->encodeHTML('component...', 'component_name');
|
|
$security->encodeHTML('mid_list..title','mid_list..list..browser_title');
|
|
|
|
$this->setTemplatePath($this->module_path.'tpl');
|
|
$this->setTemplateFile('setup_component');
|
|
}
|
|
}
|
|
/* End of file editor.admin.view.php */
|
|
/* Location: ./modules/editor/editor.admin.view.php */
|