상수 _DEFINED_ 가 선언된 경우에만 ckeditor 실행
This commit is contained in:
@ -7,4 +7,6 @@ $editor = (object)array(
|
|||||||
'config_js' => $g4['path']."/plugin/ckeditor/config.js",
|
'config_js' => $g4['path']."/plugin/ckeditor/config.js",
|
||||||
'data' => "data/editor"
|
'data' => "data/editor"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
include_once($editor->lib);
|
||||||
?>
|
?>
|
||||||
@ -4,19 +4,27 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
|||||||
function editor_textarea($id, $content="", $class="")
|
function editor_textarea($id, $content="", $class="")
|
||||||
{
|
{
|
||||||
global $g4;
|
global $g4;
|
||||||
$upload_url = $g4['path']."/plugin/ckeditor/upload.php?type=Images";
|
//$upload_url = $g4['path']."/plugin/ckeditor/upload.php?type=Images";
|
||||||
$str = "<textarea id=\"$id\" name=\"$id\" class=\"ckeditor $class\" rows=\"10\" style=\"width:100%;\">$content</textarea>\n";
|
$str = "<textarea id=\"$id\" name=\"$id\" class=\"ckeditor $class\" rows=\"10\" style=\"width:100%;\">$content</textarea>\n";
|
||||||
//$str .= "<script> CKEDITOR.replace('$id',{ filebrowserUploadUrl : '$upload_url'}); </script>\n";
|
//$str .= "<script> CKEDITOR.replace('$id',{ filebrowserUploadUrl : '$upload_url'}); </script>\n";
|
||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// textarea 로 값을 넘김
|
||||||
function editor_getdata($id)
|
function editor_getdata($id)
|
||||||
{
|
{
|
||||||
return "var {$id}_data = CKEDITOR.instances.{$id}.getData();\n";
|
if (defined('_EDITOR_'))
|
||||||
|
return "var {$id}_data = CKEDITOR.instances.{$id}.getData();\n";
|
||||||
|
else
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// textarea 의 값이 비어 있는지 검사
|
||||||
function editor_empty($id, $textarea_name="내용을")
|
function editor_empty($id, $textarea_name="내용을")
|
||||||
{
|
{
|
||||||
return "if (!{$id}_data) { alert(\"$textarea_name 입력해 주십시오.\"); return false; }\n";
|
if (defined('_EDITOR_'))
|
||||||
|
return "if (!{$id}_data) { alert(\"$textarea_name 입력해 주십시오.\"); return false; }\n";
|
||||||
|
else
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
Reference in New Issue
Block a user