RoxyFilename Ckeditor更改目录图像

时间:2015-08-24 15:48:00

标签: javascript php html ckeditor

我尝试用ckeditor实现Roxyfileman。有效。但是当我尝试更改图像默认目录时,它似乎无法正常工作。 有什么想法吗?

谢谢你。

我的配置ckeditor ===>运作良好

CKEDITOR.editorConfig = function( config ) {

//roxyFileman
    var roxyFileman = '/myapplication/boutique/admin/ext/RoxyFileman_143/index.html';
    config.filebrowserBrowseUrl='roxyFileman';
    config.filebrowserImageBrowseUrl =roxyFileman+'?type=image';
    config.removeDialogTabs= 'link:upload;image:upload';
// end roxyFileman
};

Roxyfilename的脚本:不起作用

      <script>
          $(function(){
        FileSelected(file) {

          // Set the value of field sent to Fileman via URL param "field".
    //opener.document.getElementById(RoxyUtils.GetUrlParam('field')).value = file.fullPath;   
   opener.document.getElementById(RoxyUtils.GetUrlParam('home/workspace/myapplication/sources/')).value = file.fullPath;
          // Set the source of an image which id is sent to Fileman via URL param "img".
    //      opener.document.getElementById(RoxyUtils.GetUrlParam('img')).src = file.fullPath;
          opener.document.getElementById(RoxyUtils.GetUrlParam('image')).src = file.fullPath;
          // Close file manager if it's opened in separate window.
          self.close();
          // Close file manager if it's opened in JQuery dialog.
          $(opener.document).find('#dialog_element_id').dialog('close');

        }
        }
        </script>

2 个答案:

答案 0 :(得分:0)

这对我有用:

function FileSelected(file){
    window.opener.CKEDITOR.tools.callFunction(1, file.fullPath);
    self.close();
}

从这篇文章中了解到: https://zerokspot.com/weblog/2009/09/09/custom-filebrowser-callbacks-ckeditor/

答案 1 :(得分:0)

在roxyfileman根文件夹中有conf.json文件,在这个配置文件中有&#34; SESSION_PATH_KEY&#34;:属性,你可以像这样给这个属性一个值&#34; SESSION_PATH_KEY&#34;: &#34; roxy_path&#34;在你的代码中你可以做

 $_SESSION['roxy_path']="your arbitrary directory";

然后roxyfileman将图像上传到您设置的这个目录。