<?php

add_hook('settings/CKEDITOR_filemanager', 'add_ckfinder_to_cke');

function add_ckfinder_to_cke($add_opt)
{
    $http_dir = trim(getoption('http_script_dir'));
    if (substr($http_dir, -1, 1) == '/') $http_dir = substr($http_dir, 0, -1);

    $add_opt['filebrowserBrowseUrl']        = $http_dir . "/ckfinder/ckfinder.html";
    $add_opt['filebrowserImageBrowseUrl']   = $http_dir . "/ckfinder/ckfinder.html?type=Images";
    $add_opt['filebrowserFlashBrowseUrl']   = $http_dir . "/ckfinder/ckfinder.html?type=Flash";
    $add_opt['filebrowserUploadUrl']        = $http_dir . "/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files";
    $add_opt['filebrowserImageUploadUrl']   = $http_dir . "/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files";
    $add_opt['filebrowserFlashUploadUrl']   = $http_dir . "/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash";

    return $add_opt;
}

?>