01.
<?php
02.
if
(!defined(
‘BASEPATH’
))
exit
(
‘No direct script access allowed’
);
03.
04.
function
form_ckeditor(
$data
)
05.
{
06.
07.
switch
(
$data
[
‘toolbar’
]){
08.
case
(
‘reply’
):
09.
$tool_bar
= ‘
10.
[
11.
[
“Font”
,
“FontSize”
], [
“TextColor”
,
“BGColor”
],
12.
[
“Bold”
,
“Italic”
,
“Underline”
],
13.
[
“JustifyLeft”
,
“JustifyCenter”
,
“JustifyRight”
,
“JustifyBlock”
],
14.
[
“Link”
,
“Unlink”
],
15.
[
“Image”
,
“Flash”
,
“Table”
,
“HorizontalRule”
,
“Smiley”
,
“SpecialChar”
],
16.
[
“Preview”
,
“Source”
,
“Maximize”
]
17.
]
18.
‘;
19.
break
;
20.
case
(
‘basic’
):
21.
$tool_bar
= ‘
22.
[
23.
[
“Source”
,
“-“
,
“Preview”
],
24.
[
“Bold”
,
“Italic”
,
“Underline”
],
25.
[
“Link”
,
“Unlink”
]
26.
]
27.
‘;
28.
break
;
29.
30.
default
:
31.
$tool_bar
= ‘
32.
[
33.
[
“Source”
,
“-“
,
“Save”
,
“NewPage”
,
“Preview”
,
“-“
,
“Templates”
],
34.
[
“Cut”
,
“Copy”
,
“Paste”
,
“PasteText”
,
“PasteFromWord”
,
“-“
,
“Print”
,
“SpellChecker”
,
“Scayt”
],
35.
[
“Undo”
,
“Redo”
,
“-“
,
“Find”
,
“Replace”
,
“-“
,
“SelectAll”
,
“RemoveFormat”
],
36.
[
“Form”
,
“Checkbox”
,
“Radio”
,
“TextField”
,
“Textarea”
,
“Select”
,
“Button”
,
“ImageButton”
,
“HiddenField”
],
37.
“/”
,
38.
[
“Bold”
,
“Italic”
,
“Underline”
,
“Strike”
,
“-“
,
“Subscript”
,
“Superscript”
],
39.
[
“NumberedList”
,
“BulletedList”
,
“-“
,
“Outdent”
,
“Indent”
,
“Blockquote”
],
40.
[
“JustifyLeft”
,
“JustifyCenter”
,
“JustifyRight”
,
“JustifyBlock”
],
41.
[
“Link”
,
“Unlink”
,
“Anchor”
],
42.
[
“Image”
,
“Flash”
,
“Table”
,
“HorizontalRule”
,
“Smiley”
,
“SpecialChar”
,
“PageBreak”
],
43.
“/”
,
44.
[
“Styles”
,
“Format”
,
“Font”
,
“FontSize”
],
45.
[
“TextColor”
,
“BGColor”
],
46.
[
“Maximize”
,
“ShowBlocks”
,
“-“
,
“About”
]
47.
]
48.
‘;
49.
break
;
50.
}
51.
52.
53.
$data
[
‘language’
] = isset(
$data
[
‘language’
]) ?
$data
[
‘language’
] :
‘ko’
;
54.
55.
$size
= isset(
$data
[
‘width’
]) ?
‘width: “‘
.
$data
[
‘width’
].
‘”, ‘
:
”
;
56.
$size
.= isset(
$data
[
‘height’
]) ?
‘height: “‘
.
$data
[
‘height’
].
‘”, ‘
:
”
;
57.
58.
$options
=
‘{‘
.
59.
$size
.
60.
‘language: “‘
.
$data
[
‘language’
].'”,
61.
62.
startupOutlineBlocks: false,
63.
entities: false,
64.
entities_latin: false,
65.
entities_greek: false,
66.
forcePasteAsPlainText: false,
67.
68.
69.
70.
71.
filebrowserImageUploadUrl :
“/include/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images”
,
72.
filebrowserFlashUploadUrl :
“/include/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash”
,
73.
74.
toolbar :
‘.$tool_bar.’
75.
76.
}’;
77.
78.
return
79.
80.
‘<script type=”text/javascript” src=”‘
.INCLUDE_DIR.
‘/ckeditor/ckeditor.js”></script>’
.
81.
82.
83.
‘<script type=”text/javascript”>CKEDITOR.replace(“‘
.
$data
[
‘id’
].
‘”, ‘
.
$options
.
‘);</script>’
;
84.
}
85.
?>