0

I am struggling with this integration. Any help greatly appreciated.

I want to have the file browser option only on the link tab of the image dialog. In addition, I want it to default to a specific folder.

I've downloaded both filebrowser and popup plugins (4.3 standard did not list them in the plugins folder) and modified config.js with:

// enable plugin
    config.extraPlugins = 'filebrowser';
    config.extraPlugins = 'popup';

I call the CK instance from an include(contentEditor.js)

    var config3 = {
        toolbar:
            [
                [ 'Paste', 'PasteFromWord', '-', 'Bold', 'Italic', 'Underline', '-', 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Source' , 'Templates', 'Link', 'Image' ]
            ],
            uiColor: "#dafb3f",
            height: "570px",
            resize_enabled: false,
            extraPlugins:'templates,filebrowser,popup',
            on: { change: CKonChange }
    };

    // Initialize the editor.
    // Callback function can be passed and executed after full instance creation.
    $( 'textarea#nodeContents' ).ckeditor(config3); // nodeContents for city,state,country,resources editors
});

Now, I'm lost. How do I activate the browser button and pass the image path back to the instance?

1/28 UPDATE

As I could not find any documentation on how to integrate filebrowser plugin, I am looking at integrating a custom browse script.

So, in my config.js fle, I've got:

// Custom template files referenced in this array
config.templates_files = [ 'http://dev.wtpcentral.com/js/CK_templates_city.js' ];

// Image browser
       config.filebrowserImageBrowseLinkUrl : "/include/filebrowser/browse.php?type=Images&dir="+encodeURIComponent('content/images');
    // config.filebrowserImageBrowseUrl : "/include/filebrowser/browse.php?type=Images&dir="+encodeURIComponent('content/images');

 // Custom Image upload
config.filebrowserUploadUrl ='/include/classUpload/upload_CK.php';


// enable plugin
    // config.extraPlugins = 'filebrowser,popup';

And, I put browse.php into my /include/filebrowser folder.

BUT, this throws an error: SyntaxError: invalid label config.filebrowserImageBrowseUrl : "/include/filebrowser/browse.php

AND my custom image upload script now does not load.

As you might see in my inline notes, I tried config.filebrowserImageBrowseUrl with the same results.

Any help greatly appreciated.

royhink
  • 49
  • 1
  • 9

1 Answers1

0

In this case you must use "=" instead of ":". Change this line

config.filebrowserImageBrowseLinkUrl: "/include/filebrowser/browse.php?type=Images&dir="+encodeURIComponent('content/images');

to

config.filebrowserImageBrowseLinkUrl = "/include/filebrowser/browse.php?type=Images&dir="+encodeURIComponent('content/images');
ChrisF
  • 134,786
  • 31
  • 255
  • 325
user3281733
  • 111
  • 2