1: <?php
2:
3: 4: 5: 6: 7: 8: 9: 10: 11:
12:
13:
14: define ("FCK_HTMLAREA_DEFID_PREFIX", "fck_form_");
15: define ("FCK_HTMLAREA_DEFAULT_WIDTH", "100%");
16: define ("FCK_HTMLAREA_DEFAULT_HIGHT", "400px");
17: define ("FCK_HTMLAREA_DEFAULT_BASEPATH", "/common/fckeditor/");
18: define ("FCK_HTMLAREA_DEFAULT_TOOLBAR", "Default");
19: define ("FCK_HTMLAREA_DEFAULT_SKIN", "default");
20:
21: function smarty_function_fck_htmlarea($params, &$smarty)
22: {
23:
24: $root = &XCube_Root :: getSingleton();
25: $textFilter = &$root -> getTextFilter();
26:
27: if( ! empty( $params['name'] ) ) {
28:
29:
30:
31: $name = trim($params['name']);
32:
33: $value = isset($params['value']) ? $params['value'] : null;
34: $id = isset($params['id']) ? trim($params['id']) :
35: FCK_HTMLAREA_DEFID_PREFIX . $name;
36:
37:
38: $width = isset($params['width']) ?
39: htmlspecialchars(trim($params['width']), ENT_QUOTES) :
40: FCK_HTMLAREA_DEFAULT_WIDTH;
41: $height = isset($params['height']) ?
42: htmlspecialchars(trim($params['height']), ENT_QUOTES) :
43: FCK_HTMLAREA_DEFAULT_HIGHT;
44: $basepath = isset($params['basepath']) ?
45: htmlspecialchars(trim($params['basepath']), ENT_QUOTES) :
46: FCK_HTMLAREA_DEFAULT_BASEPATH;
47: $toolbar = isset($params['toolbar']) ?
48: htmlspecialchars(trim($params['toolbar']), ENT_QUOTES) :
49: FCK_HTMLAREA_DEFAULT_TOOLBAR;
50: $skin = isset($params['skin']) ?
51: htmlspecialchars(trim($params['skin']), ENT_QUOTES) :
52: FCK_HTMLAREA_DEFAULT_SKIN;
53:
54:
55:
56: include_once XOOPS_ROOT_PATH.'/common/fckeditor/fckeditor.php';
57: ob_start();
58: $oFCKeditor = new FCKeditor($name) ;
59: $oFCKeditor->BasePath = XOOPS_URL. $basepath;
60: $oFCKeditor->Value = $value ;
61: $oFCKeditor->Height = $height ;
62:
63: if (isset($toolbar)) $oFCKeditor->ToolbarSet = $toolbar ;
64: if (isset($skin)) $oFCKeditor->Config['SkinPath'] = XOOPS_URL.
65: $basepath. 'editor/skins/'. $skin. '/' ;
66: $oFCKeditor->Create() ;
67: $editor = ob_get_contents();
68: ob_end_clean();
69:
70:
71: print $editor;
72: }
73: }
74: ?>