Remove trailing whitespace

This commit is contained in:
Kijin Sung 2023-01-30 21:43:21 +09:00
parent c5267b42fd
commit 37b0d3a1e6
71 changed files with 806 additions and 806 deletions

View file

@ -144,7 +144,7 @@ class editorAdminController extends editor
{
$oModuleController = getController('module');
$configVars = Context::getRequestVars();
$config = new stdClass;
$config->editor_skin = $configVars->editor_skin;
$config->editor_colorset = $configVars->editor_colorset;
@ -166,7 +166,7 @@ class editorAdminController extends editor
$config->mobile_comment_editor_height = $configVars->mobile_comment_editor_height;
$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';
if ($configVars->font_defined === 'Y')
{
$config->font_defined = 'Y';
@ -177,7 +177,7 @@ class editorAdminController extends editor
$config->font_defined = $configVars->font_defined = 'N';
$config->content_font = $configVars->content_font;
}
if ($configVars->additional_css)
{
$additional_css = array_map('trim', explode("\n", $configVars->additional_css));
@ -188,7 +188,7 @@ class editorAdminController extends editor
{
$config->additional_css = array();
}
if ($configVars->additional_mobile_css)
{
$additional_mobile_css = array_map('trim', explode("\n", $configVars->additional_mobile_css));
@ -199,7 +199,7 @@ class editorAdminController extends editor
{
$config->additional_mobile_css = array();
}
if ($configVars->additional_plugins)
{
$additional_plugins = array_map('trim', explode(',', $configVars->additional_plugins));
@ -210,7 +210,7 @@ class editorAdminController extends editor
{
$config->additional_plugins = array();
}
if ($configVars->remove_plugins)
{
$remove_plugins = array_map('trim', explode(',', $configVars->remove_plugins));
@ -221,7 +221,7 @@ class editorAdminController extends editor
{
$config->remove_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);

View file

@ -36,7 +36,7 @@ class editorAdminView extends editor
$editor_config->$key = $val;
}
}
// Get skin info
$editor_skin_list = array();
$skin_dir_list = FileHandler::readDir($this->module_path . 'skins');
@ -46,7 +46,7 @@ class editorAdminView extends editor
{
continue;
}
$skin_info = ModuleModel::loadSkinInfo($this->module_path, $skin);
foreach ($skin_info->colorset ?: [] as $colorset)
{
@ -81,7 +81,7 @@ class editorAdminView extends editor
$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('component_list', $component_list);
@ -108,7 +108,7 @@ class editorAdminView extends editor
throw new Rhymix\Framework\Exceptions\InvalidRequest;
}
Context::set('component', $component);
// Get a group list to set a group
$group_list = MemberModel::getGroups(0);
Context::set('group_list', $group_list);

View file

@ -3,7 +3,7 @@
/**
* @class editorAPI
* @author NAVER (developers@xpressengine.com)
* @brief
* @brief
*/
class editorAPI extends editor
{

View file

@ -3,7 +3,7 @@
/**
* @class editor
* @author NAVER (developers@xpressengine.com)
* @brief high class of the editor odule
* @brief high class of the editor odule
*/
class editor extends ModuleObject
{
@ -17,7 +17,7 @@ class editor extends ModuleObject
'default_paragraph_spacing' => '0',
'default_word_break' => 'normal',
);
/**
* @brief Default editor config
*/
@ -58,7 +58,7 @@ class editor extends ModuleObject
'additional_plugins' => array(),
'remove_plugins' => array('liststyle', 'tabletools', 'tableselection', 'contextmenu', 'exportpdf'),
);
/**
* @brief Implement if additional tasks are necessary when installing
*/
@ -104,7 +104,7 @@ class editor extends ModuleObject
// 2009. 06. 19 Remove unused trigger
if(ModuleModel::getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) return true;
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after')) return true;
return false;
@ -117,7 +117,7 @@ class editor extends ModuleObject
{
$oDB = DB::getInstance();
$oModuleController = getController('module');
// XEVE-17-030
if(!$oDB->isColumnExists('editor_autosave', 'certify_key'))
{
@ -127,23 +127,23 @@ class editor extends ModuleObject
{
$oDB->addIndex('editor_autosave', 'idx_certify_key', 'certify_key');
}
// 2007. 10. 17 Add a trigger to delete automatically saved document whenever the document(insert or update) is modified
if(!ModuleModel::getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'))
if(!ModuleModel::getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'))
$oModuleController->insertTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
if(!ModuleModel::getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'))
if(!ModuleModel::getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'))
$oModuleController->insertTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
// 2007. 10. Add an editor trigger on the module addition setup
if(!ModuleModel::getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before'))
if(!ModuleModel::getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before'))
$oModuleController->insertTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before');
// 2009. 04. 14 Add a trigger from compiled codes of the editor component
if(!ModuleModel::getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before'))
if(!ModuleModel::getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before'))
$oModuleController->insertTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before');
// 2009. 06. 19 Remove unused trigger
if(ModuleModel::getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before'))
if(ModuleModel::getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before'))
$oModuleController->deleteTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before');
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after'))
{
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after');

View file

@ -87,7 +87,7 @@ class editorController extends editor
{
// Get request vars
$vars = Context::getRequestVars();
// To configure many of modules at once
$target_module_srl = $vars->target_module_srl;
$target_module_srl = array_map('trim', explode(',', $target_module_srl));
@ -119,7 +119,7 @@ class editorController extends editor
{
$config->default_editor_settings = 'N';
}
// Apply module-specific editor settings.
$config->editor_skin = $vars->editor_skin;
$config->editor_colorset = $vars->editor_colorset;
@ -152,7 +152,7 @@ class editorController extends editor
$config->font_defined = $vars->font_defined = 'N';
$config->content_font = $vars->content_font;
}
$config->content_font_size = trim($vars->content_font_size);
$config->enable_autosave = $vars->enable_autosave ?: 'Y';
$config->auto_dark_mode = $vars->auto_dark_mode ?: 'Y';
@ -217,7 +217,7 @@ class editorController extends editor
{
$editor_config = getModel('module')->getModuleConfig('editor');
}
if ($editor_config)
{
$default_font_config = self::$default_font_config;
@ -457,7 +457,7 @@ class editorController extends editor
{
$xml_info->mid_list = $extra_vars->mid_list;
}
// Check the configuration of the editor component
if(!empty($xml_info->extra_vars))
{
@ -469,7 +469,7 @@ class editorController extends editor
}
$component_list->{$component_name} = $xml_info;
// Get buttons, icons, images
$icon_file = RX_BASEDIR . 'modules/editor/components/'.$component_name.'/icon.gif';
$component_icon_file = RX_BASEDIR . 'modules/editor/components/'.$component_name.'/component_icon.gif';
@ -500,7 +500,7 @@ class editorController extends editor
{
Rhymix\Framework\Cache::set('editor:components:all', $component_list, 0, true);
}
return $component_list;
}

View file

@ -12,7 +12,7 @@ class editorModel extends editor
*/
protected static $_module_config = array();
protected static $_loaded_component_list = array();
/**
* @brief Return the editor
*
@ -45,7 +45,7 @@ class editorModel extends editor
{
$editor_config = new stdClass;
}
// Fill in some other values.
$grant_vars = array(
'enable_html_grant',
@ -64,10 +64,10 @@ class editorModel extends editor
$editor_config->{$var} = [];
}
}
// Load the default config for editor module.
$editor_default_config = ModuleModel::getModuleConfig('editor') ?: new stdClass;
// Check whether we should use the default config.
if(!isset($editor_config->default_editor_settings) || $editor_config->default_editor_settings !== 'Y')
{
@ -80,7 +80,7 @@ class editorModel extends editor
{
$editor_config->default_editor_settings = 'Y';
}
// Apply the default config for missing values.
foreach (self::$default_editor_config as $key => $val)
{
@ -89,7 +89,7 @@ class editorModel extends editor
$editor_config->$key = isset($editor_default_config->$key) ? $editor_default_config->$key : $val;
}
}
return $editor_config;
}
@ -99,7 +99,7 @@ class editorModel extends editor
public static function getSkinConfig($skin_name)
{
$skin_config = new stdClass;
if($skin_info = ModuleModel::loadSkinInfo('./modules/editor', $skin_name))
{
foreach ($skin_info->extra_vars as $val)
@ -107,7 +107,7 @@ class editorModel extends editor
$skin_config->{$val->name} = $val->value;
}
}
return $skin_config;
}
@ -120,12 +120,12 @@ class editorModel extends editor
{
// Load language files.
Context::loadLang('./modules/editor/lang');
// Initialize options.
if (!is_object($option))
{
$option = new stdClass;
}
// Set editor sequence and upload options.
if ($upload_target_srl)
@ -140,7 +140,7 @@ class editorModel extends editor
Context::set('allow_fileupload', $option->allow_fileupload = toBool($option->allow_fileupload));
Context::set('upload_target_srl', $upload_target_srl);
Context::set('editor_sequence', $option->editor_sequence);
// Check that the skin exist.
if (!$option->editor_skin)
{
@ -173,7 +173,7 @@ class editorModel extends editor
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
Context::set('content_font', $option->content_font);
Context::set('content_font_size', $option->content_font_size);
@ -185,13 +185,13 @@ class editorModel extends editor
Context::set('editor_additional_css', $option->additional_css);
Context::set('editor_additional_plugins', $option->additional_plugins);
Context::set('editor_remove_plugins', $option->remove_plugins);
// Set the primary key valueof the document or comments
Context::set('editor_primary_key_name', $option->primary_key_name);
// Set content column name to sync contents
Context::set('editor_content_key_name', $option->content_key_name);
// Set autosave (do not use if the post is edited)
$option->enable_autosave = toBool($option->enable_autosave) && !Context::get($option->primary_key_name);
if ($option->enable_autosave)
@ -199,12 +199,12 @@ class editorModel extends editor
Context::set('saved_doc', self::getSavedDoc($upload_target_srl));
}
Context::set('enable_autosave', $option->enable_autosave);
// Set allow html and focus
Context::set('allow_html', ($option->allow_html === false || $option->allow_html === 'N') ? false : true);
Context::set('editor_focus', toBool($option->editor_focus));
Context::set('editor_auto_dark_mode', $option->auto_dark_mode !== 'N');
// Load editor components.
if($option->enable_component)
{
@ -241,7 +241,7 @@ class editorModel extends editor
{
$file_config->allowed_chunk_size = floor($file_config->allowed_chunk_size / 65536) * 65536;
}
// Do not allow chunked uploads in IE < 10, Android browser, and Opera
$browser = Rhymix\Framework\UA::getBrowserInfo();
if (($browser->browser === 'IE' && version_compare($browser->version, '10', '<')) || $browser->browser === 'Android' || $browser->browser === 'Opera')
@ -268,7 +268,7 @@ class editorModel extends editor
// Compile and return the editor skin template.
$tpl_path = Context::get('editor_path');
Context::loadLang($tpl_path.'lang');
$oTemplate = TemplateHandler::getInstance();
return $oTemplate->compile($tpl_path, 'editor.html');
}
@ -287,7 +287,7 @@ class editorModel extends editor
// Check mobile status
$is_mobile = Mobile::isFromMobilePhone() || \Rhymix\Framework\UA::isMobile();
// Initialize options
$option = new stdClass();
$option->module_type = $type;
@ -335,7 +335,7 @@ class editorModel extends editor
$option->additional_css = $option->additional_mobile_css;
}
}
// Check a group_list of the currently logged-in user for permission check
if(Context::get('is_logged'))
{
@ -346,7 +346,7 @@ class editorModel extends editor
{
$group_list = array();
}
// Permission check for file upload
if($module_srl)
{
@ -367,7 +367,7 @@ class editorModel extends editor
}
}
}
// Permission check for using default components
if ($logged_info->is_admin === 'Y' || !count($option->enable_default_component_grant))
{
@ -385,7 +385,7 @@ class editorModel extends editor
}
}
}
// Permisshion check for using extended components
if($logged_info->is_admin === 'Y' || !count($option->enable_component_grant))
{
@ -403,7 +403,7 @@ class editorModel extends editor
}
}
}
// HTML editing privileges
if($logged_info->is_admin === 'Y' || !count($option->enable_html_grant))
{
@ -421,7 +421,7 @@ class editorModel extends editor
}
}
}
// Other settings
$option->primary_key_name = $primary_key_name;
$option->content_key_name = $content_key_name;
@ -468,7 +468,7 @@ class editorModel extends editor
{
$saved_doc = array_first($saved_doc);
}
// Return null if certify key does not match
if($saved_doc->certify_key && !isset($auto_save_args->certify_key))
{
@ -683,7 +683,7 @@ class editorModel extends editor
$xml_file = sprintf('%sinfo.xml', $component_path);
$xml_mtime = filemtime($xml_file);
$lang_type = Context::getLangType();
// Get from cache
$cache_key = sprintf('editor:component:%s:%s:%d', $component, $lang_type, $xml_mtime);
$info = Rhymix\Framework\Cache::get($cache_key);
@ -691,15 +691,15 @@ class editorModel extends editor
{
return $info;
}
// Parse XML file
$info = Rhymix\Framework\Parsers\EditorComponentParser::loadXML($xml_file, $component, $lang_type);
// Set to cache and return
Rhymix\Framework\Cache::set($cache_key, $info, 0, true);
return $info;
}
/**
* Return converted content
* @param object $obj
@ -709,7 +709,7 @@ class editorModel extends editor
{
$converter = null;
$config = self::getEditorConfig($obj->module_srl);
// Get editor skin
if (in_array($type, array('document', 'comment')))
{
@ -720,13 +720,13 @@ class editorModel extends editor
$converter = $obj->converter;
$skin = $obj->editor_skin ?: $config->editor_skin;
}
// if not inserted converter, Get converter from skin
if (!$converter)
{
$converter = self::getSkinConfig($skin)->converter;
}
// if not inserted converter, Check
if (!$converter)
{
@ -743,7 +743,7 @@ class editorModel extends editor
$converter = 'nl2br';
}
}
// Convert
if ($converter)
{
@ -751,13 +751,13 @@ class editorModel extends editor
{
// Remove Tag
$obj->content = strip_tags($obj->content);
// Trim space
$obj->content = utf8_trim($obj->content);
// Escape
$obj->content = escape($obj->content, false);
// Insert HTML line
$obj->content = nl2br($obj->content);
}
@ -778,7 +778,7 @@ class editorModel extends editor
$obj->content = nl2br($obj->content);
}
}
return $obj->content;
}
}

View file

@ -24,7 +24,7 @@ class editorView extends editor
$parent_input_id = Context::get('parent_input_id');
Context::set('parent_input_id', preg_replace('/[^a-z0-9_]/i', '', $parent_input_id));
Context::addBodyClass('disable_debug_panel');
// Load editor
$oEditorModel = getModel('editor');
$option = $oEditorModel->getEditorConfig();
@ -40,7 +40,7 @@ class editorView extends editor
$option->editor_focus = 'Y';
$editor = $oEditorModel->getEditor(0, $option);
Context::set('editor', $editor);
// Set template
$this->setLayoutPath('./common/tpl/');
$this->setLayoutFile("default_layout");
@ -124,7 +124,7 @@ class editorView extends editor
$current_module_srl = $current_module_info->module_srl;
if(!$current_module_srl) return new BaseObject();
}
// Get editors settings
$oEditorModel = getModel('editor');
$editor_config = $oEditorModel->getEditorConfig($current_module_srl);
@ -151,7 +151,7 @@ class editorView extends editor
{
continue;
}
$skin_info = ModuleModel::loadSkinInfo($this->module_path, $skin);
foreach ($skin_info->colorset ?: [] as $colorset)
{
@ -162,7 +162,7 @@ class editorView extends editor
Context::set('editor_config', $editor_config);
Context::set('editor_skin_list', $editor_skin_list);
// Get a group list
$group_list = MemberModel::getGroups();
Context::set('group_list', $group_list);
@ -195,7 +195,7 @@ class editorView extends editor
{
throw new Rhymix\Framework\Exceptions\InvalidRequest();
}
$skin_info = ModuleModel::loadSkinInfo($this->module_path,$skin);
$colorset = $skin_info->colorset ?? null;
Context::set('colorset', $colorset);
@ -204,7 +204,7 @@ class editorView extends editor
function dispEditorConfigPreview()
{
Context::set('editor', getModel('editor')->getModuleEditor(Context::get('type'), 0, 0, 'dummy_key', 'dummy_content'));
$this->setLayoutFile('default_layout');
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('config_preview');