모바일에서도 에디터를 쓸 수 있도록 합니다.

현재는 모바일에서 작성시 nl2br 처리를 피해갈 수 없습니다. 변수(use_editor)를 추가하여 HTML 작성을 가능하게
합니다.
This commit is contained in:
MinSoo Kim 2015-05-25 20:06:38 +09:00
parent ecce7e5efd
commit e445d78dcf

View file

@ -281,6 +281,8 @@ class documentController extends document
// Remove XE's own tags from the contents. // Remove XE's own tags from the contents.
$obj->content = preg_replace('!<\!--(Before|After)(Document|Comment)\(([0-9]+),([0-9]+)\)-->!is', '', $obj->content); $obj->content = preg_replace('!<\!--(Before|After)(Document|Comment)\(([0-9]+),([0-9]+)\)-->!is', '', $obj->content);
if(Mobile::isFromMobilePhone()) if(Mobile::isFromMobilePhone())
{
if($obj->use_editor != 'Y' && $obj->use_html != 'Y')
{ {
if($obj->use_html != 'Y') if($obj->use_html != 'Y')
{ {
@ -288,6 +290,7 @@ class documentController extends document
} }
$obj->content = nl2br($obj->content); $obj->content = nl2br($obj->content);
} }
}
// Remove iframe and script if not a top adminisrator in the session. // Remove iframe and script if not a top adminisrator in the session.
if($logged_info->is_admin != 'Y') $obj->content = removeHackTag($obj->content); if($logged_info->is_admin != 'Y') $obj->content = removeHackTag($obj->content);
// An error appears if both log-in info and user name don't exist. // An error appears if both log-in info and user name don't exist.
@ -479,6 +482,8 @@ class documentController extends document
// Remove XE's own tags from the contents. // Remove XE's own tags from the contents.
$obj->content = preg_replace('!<\!--(Before|After)(Document|Comment)\(([0-9]+),([0-9]+)\)-->!is', '', $obj->content); $obj->content = preg_replace('!<\!--(Before|After)(Document|Comment)\(([0-9]+),([0-9]+)\)-->!is', '', $obj->content);
if(Mobile::isFromMobilePhone()) if(Mobile::isFromMobilePhone())
{
if($obj->use_editor != 'Y' && $obj->use_html != 'Y')
{ {
if($obj->use_html != 'Y') if($obj->use_html != 'Y')
{ {
@ -486,6 +491,7 @@ class documentController extends document
} }
$obj->content = nl2br($obj->content); $obj->content = nl2br($obj->content);
} }
}
// Change not extra vars but language code of the original document if document's lang_code is different from author's setting. // Change not extra vars but language code of the original document if document's lang_code is different from author's setting.
if($source_obj->get('lang_code') != Context::getLangType()) if($source_obj->get('lang_code') != Context::getLangType())
{ {