Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 748535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:19:53+00:00 2026-05-14T14:19:53+00:00

I’ve got a problem with a CKEditor plugin. I need PHP code to make

  • 0

I’ve got a problem with a CKEditor plugin.
I need PHP code to make use of a MySQL database and several variables the CMS (WebsiteBaker) gives me. The CKEditor plugin should open a new dialog, gives several links defined in the PHP part you can choose of.
In the plugin.js the code

CKEDITOR.dialog.add('wbdropletsdlg', this.path + 'dialogs/wbdroplets.php');

works good – but not on “real” UNIX server, only on XAMPP (Windows7). In the wblink.php there’s the PHP part and the necessary JavaScript part for CKEditor.

I tried to change in the plugin.js the code to

CKEDITOR.dialog.add('wbdropletsdlg', this.path + 'dialogs/wbdroplets.js');

put in there the JavaScript

CKEDITOR.dialog.add( 'wbdropletsdlg', function( editor ) {
CKEDITOR.scriptLoader.load(this.path + "wbdroplets.php");
return {
    title: editor.lang.wbdroplets.name,
    minWidth: 280,
    minHeight: 80,
    contents: [ 
        {
            id: 'tab1',
            label: 'Tab1',        
            title: 'Tab1',
            elements : [{
                    id: 'wbdroplets',
                    type: 'select',
                    label: "Droplets",
                    labelLayout:'horizontal',
                    widths:['20%','80%'],
                    style: 'width: 150px; margin-left: 10px; margin-top:-3px;',
                    validate : function() { },
                    items: list,
                    onMouseUp: function() { 
                        /** 
                         *    code to display the description of the droplets ... 
                         *
                         */
                        desc_list;
                        var droplet_name = this.getValue();
                        var ref = document.getElementById("droplet_info");
                        ref.innerHTML = info[droplet_name];
                    },
                    onShow: function() { 
                        this.onMouseUp();
                    }
                } , {
                    id: 'droplet_info_box',
                    type: 'html',
                    label: 'Info',
                    labelLayout:'horizontal',
                    widths:['20%','80%'],
                    style:    "display: inline; " +
                            "float: left; " +
                            "margin-left: 0; " +
                            "padding-left: 10px; " +
                            "width: 250px !important; " +
                            "height: 100px;" +
                            "white-space: normal !important;",
                    html: "<div id='droplet_info'>Hello</div>"
                } ] 
        }
        ],
     onOk: function() {

         /**
          *    Getting the value of our droplet-select
          *
          */
         var droplet_name = this.getContentElement("tab1", "wbdroplets").getInputElement().getValue();

         editor = this.getParentEditor();
         editor.fire('paste', { 'text' : droplet_name } );

        return true;
     },

     resizable: 2
};
} );

In the PHP-file the code

require(WB_PATH.'/framework/class.admin.php');
admin = new admin('Pages', 'pages_modify', false);

global $database;
$get_droplet = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_droplets` where `active`=1 ORDER BY `name`");

$list = "[";
$desc_list = "var info = new Array();";

if($get_droplet->numRows() > 0) {

while($droplet = $get_droplet->fetchRow()) {

    $title  = stripslashes($droplet['name']);
    $desc   = stripslashes($droplet['description']);
    $comm   = stripslashes($droplet['comments']);

    $list .= "\n['".$title."', '[[".$title."]]'],";
    $desc_list .= "info['[[".$title."]]']='".trim($desc)."<br /><br />".trim($comm)."';"; 

}
$list = substr( $list, 0, -1 );
 }
 $list .= "]";
 $desc_list .= "\n";

function script($list)
{
    $out = "<script type=\"text/javascript\">";
    $out .= "//<![CDATA[\n";
    $out .= $list;
    $out .= $desc_list;
    $out .= "\n//]]>";
    $out .= "</script>\n";

    return $out;
}

But the CKEditor plugin is not opening – Firefox console says “list is not defined”.

Thanks very much for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T14:19:53+00:00Added an answer on May 14, 2026 at 2:19 pm

    The scriptLoader has a second parameter that it’s the callback function to execute when the requested script has been loaded. If you develop in your computer it might return the data fast enough, but in a production environment it’s expected to have some delay so that’s the explanation about why it works in one situation and fails in the other.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i got an object with contents of html markup in it, for example: string
I've got a string that has curly quotes in it. I'd like to replace
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I need to clean up various Word 'smart' characters in user input, including but
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.