Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
20c93706
Commit
20c93706
authored
12 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
New: Support the mode readonly of ckeditor
parent
e24fb9f4
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/comm/mailing/fiche.php
+2
-2
2 additions, 2 deletions
htdocs/comm/mailing/fiche.php
htdocs/core/class/doleditor.class.php
+7
-1
7 additions, 1 deletion
htdocs/core/class/doleditor.class.php
with
9 additions
and
3 deletions
htdocs/comm/mailing/fiche.php
+
2
−
2
View file @
20c93706
...
...
@@ -1004,7 +1004,7 @@ else
{
// Editeur wysiwyg
require_once
DOL_DOCUMENT_ROOT
.
'/core/class/doleditor.class.php'
;
$doleditor
=
new
DolEditor
(
'body'
,
$object
->
body
,
''
,
320
,
'dolibarr_readonly'
,
''
,
false
,
true
,
empty
(
$conf
->
global
->
FCKEDITOR_ENABLE_MAILING
)
?
0
:
1
,
20
,
70
);
$doleditor
=
new
DolEditor
(
'body'
,
$object
->
body
,
''
,
320
,
'dolibarr_readonly'
,
''
,
false
,
true
,
empty
(
$conf
->
global
->
FCKEDITOR_ENABLE_MAILING
)
?
0
:
1
,
20
,
120
,
1
);
$doleditor
->
Create
();
}
else
print
dol_htmlentitiesbr
(
$object
->
body
);
...
...
@@ -1130,7 +1130,7 @@ else
print
'<td colspan="3">'
;
// Editeur wysiwyg
require_once
DOL_DOCUMENT_ROOT
.
'/core/class/doleditor.class.php'
;
$doleditor
=
new
DolEditor
(
'body'
,
$object
->
body
,
''
,
320
,
'dolibarr_mailings'
,
''
,
true
,
true
,
$conf
->
global
->
FCKEDITOR_ENABLE_MAILING
,
20
,
7
0
);
$doleditor
=
new
DolEditor
(
'body'
,
$object
->
body
,
''
,
320
,
'dolibarr_mailings'
,
''
,
true
,
true
,
$conf
->
global
->
FCKEDITOR_ENABLE_MAILING
,
20
,
12
0
);
$doleditor
->
Create
();
print
'</td></tr>'
;
...
...
This diff is collapsed.
Click to expand it.
htdocs/core/class/doleditor.class.php
+
7
−
1
View file @
20c93706
...
...
@@ -42,6 +42,7 @@ class DolEditor
var
$cols
;
var
$height
;
var
$width
;
var
$readonly
;
/**
...
...
@@ -60,8 +61,9 @@ class DolEditor
* @param int $okforextendededitor True=Allow usage of extended editor tool (like fckeditor)
* @param int $rows Size of rows for textarea tool
* @param int $cols Size of cols for textarea tool
* @param int $readOnly 0=Read/Edit, 1=Read only
*/
function
__construct
(
$htmlname
,
$content
,
$width
=
''
,
$height
=
200
,
$toolbarname
=
'Basic'
,
$toolbarlocation
=
'In'
,
$toolbarstartexpanded
=
false
,
$uselocalbrowser
=
true
,
$okforextendededitor
=
true
,
$rows
=
0
,
$cols
=
0
)
function
__construct
(
$htmlname
,
$content
,
$width
=
''
,
$height
=
200
,
$toolbarname
=
'Basic'
,
$toolbarlocation
=
'In'
,
$toolbarstartexpanded
=
false
,
$uselocalbrowser
=
true
,
$okforextendededitor
=
true
,
$rows
=
0
,
$cols
=
0
,
$readonly
=
0
)
{
global
$conf
,
$langs
;
...
...
@@ -75,6 +77,7 @@ class DolEditor
$defaulteditor
=
'ckeditor'
;
$this
->
tool
=
empty
(
$conf
->
global
->
FCKEDITOR_EDITORNAME
)
?
$defaulteditor
:
$conf
->
global
->
FCKEDITOR_EDITORNAME
;
$this
->
uselocalbrowser
=
$uselocalbrowser
;
$this
->
readonly
=
$readonly
;
// Check if extended editor is ok. If not we force textarea
if
(
empty
(
$conf
->
fckeditor
->
enabled
)
||
!
$okforextendededitor
)
$this
->
tool
=
'textarea'
;
...
...
@@ -156,6 +159,7 @@ class DolEditor
if
(
in_array
(
$this
->
tool
,
array
(
'textarea'
,
'ckeditor'
)))
{
$found
=
1
;
//$out.= '<textarea id="'.$this->htmlname.'" name="'.$this->htmlname.'" rows="'.$this->rows.'" cols="'.$this->cols.'"'.($this->readonly?' disabled="disabled"':'').' class="flat">';
$out
.
=
'<textarea id="'
.
$this
->
htmlname
.
'" name="'
.
$this
->
htmlname
.
'" rows="'
.
$this
->
rows
.
'" cols="'
.
$this
->
cols
.
'" class="flat">'
;
$out
.
=
$this
->
content
;
$out
.
=
'</textarea>'
;
...
...
@@ -177,7 +181,9 @@ class DolEditor
/* should be editor=CKEDITOR.replace but what if serveral editors ? */
CKEDITOR.replace(\''
.
$this
->
htmlname
.
'\',
{
/* property:xxx is same than CKEDITOR.config.property = xxx */
customConfig : ckeditorConfig,
readOnly : '
.
(
$this
->
readonly
?
'true'
:
'false'
)
.
',
htmlEncodeOutput :'
.
$htmlencode_force
.
',
toolbar: \''
.
$this
->
toolbarname
.
'\',
toolbarStartupExpanded: '
.
(
$this
->
toolbarstartexpanded
?
'true'
:
'false'
)
.
',
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment