Hello all,
It would be a big help to know if it is possible to pass alternative variables through CKEditor.
I've got some DIV elements with contents from a database. On a doubleclick, CKEditor replaces the DIV content.
I added a Save button in CKEditor which triggers a PHP mysql update script. But this script must know which ID in the database must be updated. How do I magage this?
The ID of the database object is included as an attribute in the DIV element:
Is there a way to get the attribute content from current element, catid, from insite CKEditor?
The triggered Savebutton-script looks like this:
When there is a better option to manage this, I'll be please to know!
Thank you
It would be a big help to know if it is possible to pass alternative variables through CKEditor.
I've got some DIV elements with contents from a database. On a doubleclick, CKEditor replaces the DIV content.
I added a Save button in CKEditor which triggers a PHP mysql update script. But this script must know which ID in the database must be updated. How do I magage this?
The ID of the database object is included as an attribute in the DIV element:
<div class="editable" id="editor1" catid="123"><span>This is a test.</span></div>
Is there a way to get the attribute content from current element, catid, from insite CKEditor?
The triggered Savebutton-script looks like this:
/**
* @fileSave plugin.
*/
(function() {
if ( CKEDITOR.env.isCompatible )
var a = {
modes: { wysiwyg: 1, source: 1 },
exec: function(editor) {
alert('Save triggered!!!');
var element = CKEDITOR.instances.editor1();
alert( element.getAttribute( 'cat' ) ); // "text"
showUser(encodeURIComponent(editor.getData()));
//editor.setData('You clicked save');
editor.destroy();
editor = null;
//CKEDITOR.config.AjaxSave_Callback(editor);
}
}, b = 'AjaxSave';
CKEDITOR.plugins.add(b,
{ init: function(c) {
var d = c.addCommand(b, a);
d.modes = {
wysiwyg: true
};
c.ui.addButton('AjaxSave', { label: c.lang.save, command: b, icon: this.path + 'save.jpg' });
}
});
})();
CKEDITOR.config.AjaxSave_Callback = null;When there is a better option to manage this, I'll be please to know!
Thank you
