From f6313d44d983c292578ccc2c78123a7ad05badfc Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 14 May 2025 01:09:59 +0900 Subject: [PATCH] Use iframe instead of popup window to display editor components in mobile --- modules/editor/editor.view.php | 13 +++++++++++- modules/editor/tpl/component_not_founded.html | 2 ++ modules/editor/tpl/js/editor_common.js | 20 ++++++++++++++++++- modules/editor/tpl/popup.html | 2 ++ modules/editor/tpl/popup_iframe.blade.php | 15 ++++++++++++++ 5 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 modules/editor/tpl/popup_iframe.blade.php diff --git a/modules/editor/editor.view.php b/modules/editor/editor.view.php index 2acfb5220..6021a1870 100644 --- a/modules/editor/editor.view.php +++ b/modules/editor/editor.view.php @@ -55,12 +55,23 @@ class EditorView extends Editor { // add a css file Context::loadFile($this->module_path."tpl/css/editor.css", true); + // List variables $editor_sequence = Context::get('editor_sequence'); - $component = Context::get('component'); + $iframe_sequence = Context::get('iframe_sequence'); + if (empty($editor_sequence) || !ctype_alnum($editor_sequence)) + { + return new BaseObject(-1, 'msg_invalid_request'); + } + if (isset($iframe_sequence) && !ctype_alnum($iframe_sequence)) + { + return new BaseObject(-1, 'msg_invalid_request'); + } + $component = Context::get('component'); $site_module_info = Context::get('site_module_info'); $site_srl = (int)$site_module_info->site_srl; + // Get compoenet object $oComponent = EditorModel::getComponentObject($component, $editor_sequence, $site_srl); if(!$oComponent->toBool()) diff --git a/modules/editor/tpl/component_not_founded.html b/modules/editor/tpl/component_not_founded.html index 2ce7608e1..bbbb13df7 100644 --- a/modules/editor/tpl/component_not_founded.html +++ b/modules/editor/tpl/component_not_founded.html @@ -1,3 +1,5 @@ + + + +@endif