forked from leonardoxc/leonardoxc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFN_editor.php
120 lines (92 loc) · 3.94 KB
/
FN_editor.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?
//************************************************************************
// Leonardo XC Server, https://github.com/leonardoxc/leonardoxc
//
// Copyright (c) 2004-2010 by Andreadakis Manolis
//
// This program is free software. You can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License.
//
// $Id: FN_editor.php,v 1.11 2010/11/23 11:41:06 manolis Exp $
//
//************************************************************************
// require_once dirname(__FILE__)."/js/fckeditor/fckeditor.php";
require_once dirname(__FILE__)."/CL_pilot.php";
?>
<script type="text/javascript" src="<?=moduleRelPath()?>/js/ckeditor/ckeditor.js"></script>
<?
function createTextArea($userServerID,$userID,$name,$value,
$where,$toolbarSet,$allowUploads=false,$width=750,$height=800) {
global $CONF,$PREFS;
$useTextArea=false;
if ( ! $CONF['editor']['use_wysiwyg'][$where] ) $useTextArea=true;
else if ( ! $PREFS->useEditor) $useTextArea=true;
$cols=floor($width/10);
$rows=floor($height/40);
if ($rows<3) $rows=3;
echo "<textarea name='$name' cols='$cols' rows='$rows'>$value</textarea>";
if ( $useTextArea) {
return;
}
// $oFCKeditor->Config['DefaultLanguage']=$lang2isoEditor[$currentlang];
echo "<script type='text/javascript'> $(document).ready(function(){ CKEDITOR.replace('$name'); } ); \n</script>\n";
}
/*
function createTextArea_OLD($userServerID,$userID,$name,$value,
$where,$toolbarSet,$allowUploads=false,$width=750,$height=800) {
global $CONF,$PREFS;
$useTextArea=false;
if ( ! $CONF['editor']['use_wysiwyg'][$where] ) $useTextArea=true;
else if ( ! $PREFS->useEditor) $useTextArea=true;
if ( $useTextArea) {
$cols=floor($width/10);
$rows=floor($height/40);
if ($rows<3) $rows=3;
echo "<textarea name='$name' cols='$cols' rows='$rows'>$value</textarea>";
return;
}
global $oFCKeditor;
global $moduleRelPath,$baseInstallationPath;
global $currentlang,$lang2isoEditor;
$sBasePath = getRelMainDir(1)."js/fckeditor/";
if ($userServerID==0 && $userID==0) {
$FCKEuploadPath =getRelMainDir(1)."data/files/";
} else {
// no uploads allowed
// $thisPilot=new pilot ($userServerID,$userID);
// $FCKEuploadPath =$thisPilot->getRelPath().'/files/';
// if ( !is_dir($FCKEuploadPath) ) $thisPilot->createDirs();
$FCKEuploadPath ='';
}
$_SESSION['FCKEuploadPath']=$FCKEuploadPath;
$oFCKeditor = new FCKeditor($name);
$oFCKeditor->Config['CustomConfigurationsPath'] =getRelMainDir(1)."site/config_editor.js";
$oFCKeditor->Width = $width;
$oFCKeditor->Height = $height;
$oFCKeditor->ToolbarSet = $toolbarSet;
$oFCKeditor->Value = $value;
$oFCKeditor->BasePath = $sBasePath ;
if (! $allowUploads) {
$oFCKeditor->Config['LinkBrowser']=false;
$oFCKeditor->Config['ImageBrowser']=false;
$oFCKeditor->Config['FlashBrowser']=false;
$oFCKeditor->Config['LinkUpload']=false;
$oFCKeditor->Config['ImageUpload']=false;
$oFCKeditor->Config['FlashUpload']=false;
}
$oFCKeditor->Config['ImageBrowserURL']=$sBasePath. 'editor/filemanager/browser/default/browser.html?Type=Image&Connector=../../connectors/php/connector.php';
$oFCKeditor->Config['LinkBrowserURL']=$sBasePath. 'editor/filemanager/browser/default/browser.html?Connector=../../connectors/php/connector.php';
$oFCKeditor->Config['QuickUploadLanguage']='php';
$oFCKeditor->Config['FileBrowserLanguage']='php';
$oFCKeditor->Config['AutoDetectLanguage']=false;
$oFCKeditor->Config['DefaultLanguage']=$lang2isoEditor[$currentlang];
$oFCKeditor->Config['EnableXHTML'] = false;
$oFCKeditor->Config['EnableSourceXHTML'] = false;
$oFCKeditor->Config['IncludeGreekEntities'] = false;
// office2003 silver default
$oFCKeditor->Config['SkinPath'] = $sBasePath . 'editor/skins/default/' ;
$oFCKeditor->Create();
}
*/
?>