reenadak

Adding CKEDITOR in MATE

Mar 24th, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.51 KB | None | 0 0
  1. // Add following in Javascript section.
  2.     function addCkEditor(id)
  3.     {
  4.         if(CKEDITOR.instances[id])
  5.         {
  6.         CKEDITOR.remove(CKEDITOR.instances[id]);
  7.         }
  8.         CKEDITOR.replace(id);
  9.     }
  10.  
  11. // Use following function
  12. public function addCkEditor()
  13. {
  14.   $this->Editor->addJavascript('addCkEditor("'.$this->mateInstances[0].'notes");');
  15. }
  16.  
  17. // define, when to use this CKEditor.
  18. $this->Editor->setConfig('addScreenFun',array(&$this,'addCkEditor'));
  19. $this->Editor->setConfig('editScreenFun',array(&$this,'addCkEditor'));
Advertisement
Add Comment
Please, Sign In to add comment