') ) { //textarea로 작성되고, html 내용이 없다면 $content = nl2br($content); } } $editor_url = G5_EDITOR_URL.'/'.$config['cf_editor']; $html = ""; $html .= "웹에디터 시작"; if (!$is_mobile && $is_dhtml_editor) { $html .= ''; } if ($is_dhtml_editor && $js) { switch($id) { case "wr_content": $editor_height = 350; break; default : $editor_height = 200; break; } $html .= "\n".''; $html .= "\n".''; $html .= "\n".''; $html .= "\n"; $js = false; } // 로딩상태 띄우기 (에디터 사용상태일때만) if($is_dhtml_editor) { // 에디터 사용상태일때 textarea 숨기기 $editor_taDisplay = "border:none;"; $html .= " "; $html .= "
".PHP_EOL; // 로딩이미지 출력 부 $html .= " "; } $ckeditor_class = $is_dhtml_editor ? "ckeditor" : ""; $html .= "\n"; $html .= "\n웹 에디터 끝"; // 현재 폼이름 GET $html .= ""; return $html; } // textarea 로 값을 넘긴다. javascript 반드시 필요 function get_editor_js($id, $is_dhtml_editor=true) { $print_js = ""; if ($is_dhtml_editor) { $print_js .= "var {$id}_editor_data = CKEDITOR.instances.{$id}.getData();\n"; } else { $print_js .= "var {$id}_editor = document.getElementById('{$id}');\n"; } return $print_js; } // textarea 의 값이 비어 있는지 검사 function chk_editor_js($id, $is_dhtml_editor=true) { $print_js = ""; if ($is_dhtml_editor) { $print_js .= "if (!{$id}_editor_data) { alert(\"내용을 입력해 주십시오.\"); CKEDITOR.instances.{$id}.focus(); return false; }\n"; $print_js .= "if (typeof(f.{$id})!=\"undefined\") f.{$id}.value = {$id}_editor_data;\n"; // 썸네일 이미지경로 원본파일로 변경 $print_js .= " var temp_data = {$id}_editor_data.replace(/thumb\-([_\d\.]+)_\d+x\d+/gim, function(res1, res2) { return res2; }); CKEDITOR.instances.wr_content.setData(temp_data);".PHP_EOL; } else { $print_js .= "if (!{$id}_editor.value) { alert(\"내용을 입력해 주십시오.\"); {$id}_editor.focus(); return false; }\n"; } $print_js .= "if(typeof(editor_chk_upload) != \"undefined\" && !editor_chk_upload) { alert(\"이미지가 업로드 중 입니다.\"); return false; }\n"; return $print_js; } ?>