CKEditor imgbrowse - set plugin address

justanumber
Posts: 7

CKEditor imgbrowse - set plugin address

Great feature! Replaced the version downloaded from CKEditor site with the zip version from this page: http://coursesweb.net/forum/ckeditor-delete-option-imgbrowse-t156.htm#p467

No longer loads the images directory I have set on page.
The version from CKEditor works fine with these settings?

In my setup, really like to use the feature like:

Code: Select all

'../ckeditor/plugins/imgbrowse/imgbrowse.html?imgroot=mathtest/images',


Thank you for great plugin,

Admin
Hello,
If you want to use the plugin with address set in JS code, with this format:

Code: Select all

'../ckeditor/plugins/imgbrowse/imgbrowse.html?imgroot=dir_in_root/dir_images',

- in the version from the ZIP archive from that page, replace this code in "imgbrowse.php" file:

Code: Select all

function __construct() {
  if(isset($_SESSION['user'])) $this->root = trim($this->root, '/') .'/'. $_SESSION['user'] .'/';
  else $this->root = trim($this->root, '/') .'/';
  $this->imgdr = isset($_POST['imgdr']) ? trim(trim(strip_tags($_POST['imgdr'])), '/') .'/' : '';
}

With this:

Code: Select all

function __construct() {
  if(isset($_SESSION['user'])) $this->root = trim($this->root, '/') .'/'. $_SESSION['user'] .'/';
  else{
    if(isset($_POST['imgroot'])) $this->root = trim(strip_tags($_POST['imgroot']));
    $this->root = trim($this->root, '/') .'/';
  }
  $this->imgdr = isset($_POST['imgdr']) ? trim(trim(strip_tags($_POST['imgdr'])), '/') .'/' : '';
}

- Or download again that zip (it is updated with this modification).

justanumber
Thank you! Works great. The delete feature is very useful.

Sorry if my original request was posted in wrong thread/area.

Cheers!

Adv. Posts: 01

Similar Topics