Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable the Upload Tab when inserting an image in Opencart's CKEditor?

After I upload an image via Upload tab > Upload, I get this error - apparently the filemanager is opened up in an iframe. Since I don't know how to fix this and I can upload images just fine from Image Info > Browse Server, how would I go about deleting/disabling the Upload tab?

I tried to comment out the last 3 lines but the upload tab still shows up:

CKEDITOR.replace('description<?php echo $language['language_id']; ?>', {
    filebrowserBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
    filebrowserImageBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
    filebrowserFlashBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
    //filebrowserUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
    //filebrowserImageUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
    //filebrowserFlashUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>'
});

I enter image description here

like image 304
Cris Avatar asked Oct 09 '22 20:10

Cris


1 Answers

Just paste this code before CKEDITOR.replace line:

CKEDITOR.on('dialogDefinition', function(ev) {
    var dialogName = ev.data.name,
        dialogDefinition = ev.data.definition;
    if (dialogName === 'image') {
        dialogDefinition.removeContents('Upload');
    }
});
like image 159
antyrat Avatar answered Oct 12 '22 10:10

antyrat