(90 replies, posted in Third party plugins)

dhh wrote:

Well, I made a testcase now as I'm not back working again.  I tried this:

echo '<?xml version="1.0" encoding="UTF-8"?>'
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

and the same without the xml header:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

The onclick event now works correctly - but the contents are not centered yet, this is my content:

    $msg = "<div id='msg'>"
         . $msg."<br />"
         . "<img src='images/ajax_processing.gif' alt='please wait />"
         . "</div>";

The $msg var only contains text without formatting, is then surrounded by divs and the ajax processing gif as you can see in the code before, and this is my modalwindow command

    $objResponse->clsmodalWindow->addWindow($msg, array('color' => '#000000',
            'opacity' => 90,
            'frame' => 'parent',
            'bOverlay' => true,
            'bOverlayClick' => true,
            'classname' => "msg"

Any idea why the content isn't centered correctly?

What does your CSS look like for the msg div?

Here is CSS I use for the div that contains information / onloading:

.info {
    position: absolute;
    text-align: center;
    padding: 5px;
    top: 50%;
    left: 50%;
    display: block;
    z-index: 1200;
    width: 400px;
    background-color: #666666;
    border: 1px solid #FFFFFF;
    color: #FFFFFF;

With that CSS it centers it just fine, once I put in the doc header.

I do not put the box in with the main html, instead I just let the model box insert the div into the page.

Here is what my doc header looks like:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
      <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />

Sorry, for such a late reply, but I have been busy with work and other things.

I hope this helps,

P.S. forgot one other thing:

This is what my call to the model window looks like:

$response->clsmodalWindow->addWindow($html, array('color' => '#000000', 'opacity' => 50, 'frame' => 'parent', 'bOverlay' => true, 'bOverlayClick' => true));


(90 replies, posted in Third party plugins)

dhh wrote:

Hey metric, I think there's kind of a bug in your "bOverlayClick" extension - in firefox there's no problem but in internet explorer 7 / 8 i won't get it working. Everythings ok, the plugin works great and the modal window is closable by clicking the close link but the eventhandler somehow somehow doesn't work (I don't get any report or error message, neither by activatiing xajax debug mode nor in the internet explorer error console).

Regardless of this I'll still keep using the modalwindow plugin. I only use it in an administation utility, so I'm ok with clicking on a close link... ;-)

Thanks for this great work to all of you!

dhh, I noticed that also. It is due to not having propery <!doctype> at the top of the html page. The page must be in proper standards mode for it to work properly. You may have also noticed that the box is not properly centered when the proper doctype is not defined at the top of the html.

See: http://hsivonen.iki.fi/doctype/ for more info on the different standards.

Firefox has a feature that automatically determines the page doctype if one is not specified, but IE 8, 7, and 6 do not.


(90 replies, posted in Third party plugins)

Hey guys, finally got around to looking at this thread again.

I took a look into the problem y'all were having and I have fixed the bug that was causing it.

There was an error in the way the PHP code was setup to issue the ajax command. I also updated the javascript a bit to reflect the new changes in the PHP file.

You can grab the fixed version at: www.gfx-null.com/MW/modalWindow.zip



(90 replies, posted in Third party plugins)

So m[e]ntor I just grabbed the latest version, since I see that you cleaned up the code and made it far more object oriented in the javascript part. It really is nice, but there was just one thing that was bugging me. Why have you never implemented an option to allow for if the overlay is up to click on the overlay to close the window?

Therefore, I took the opportunity to implement this into the newest version ;].

The zip I am posting contains the new files. However, the modalWindow.js is not compressed. I am going to leave that up to who ever wants to compress it.

You can grab the new files at:

By default the new option is set to false. So even if you put the new version in, you will not have to change your code unless you want to be able to click the overlay to close the window.

Here is an example of how to enable it:


$Response->clsmodalWindow->addWindow($window, array('color' => '#000000', 
                                                                        'opacity' => 50,
                                                                        'frame' => 'parent',
                                                                        'bOverlay' => true,
                                                                        'bOverlayClick' => true));

Do note that $Response is the xajax response, and $window is just a variable containing the window content etc.

Basically to enable it just add 'bOverlayClick' => true in the array after 'bOverlay' => true. Otherwise if you do not want to be able to click to close just do not include 'bOverlayClick' => true or set it to 'bOverlayClick' => false. Either it doesn't matter, because it is defaulted to FALSE if it isn't included in the array.

Enjoy the new feature.

Thanks m[e]ntor for the great plugin. I just felt it could be a little more user friendly for the end user instead of having to search directly for a close button in the window. Most sites with popups these days just allow you to close the window by clicking off of it.


(90 replies, posted in Third party plugins)

Ah, well I asked my brother what php version he had and he said he had the latest. However, I found otherwise when I ran phpinfo(). Instead, his server is running php 4.3.9. PHP 4.3.9 does not support the private declaration and the construct method. Now, I just have to grind it into my brother to install the latest php on his unix server. As there will be functions I want to use from php 5.

Thanks for the quick response.

Oh and I created the code myself. Even though I am a beginner to php, I have a programming background with C#, VB, LUA. So, I can easily catch on with what is wrong quite fast, just took a bit to understand what was going wrong in the php error. Plus, I just made it more object oriented and made it fit the php 4.3.9 standard, since that is how I program in C# and VB.


(90 replies, posted in Third party plugins)

hey, it looks to be I am using the latest php version. I was able to get it to work by changing these lines of code:

     *  Used to store the base URI for where the javascript files are located.  This
     *    enables the plugin to generate a script reference to it's javascript file
     *    if the javascript code is NOT inlined.
     * @var string
    var $sJavascriptURI; //used to be null right here and was private: changed to var
     *  Used to store the value of the inlineScript configuration option.  When true,
     *    the plugin will return it's javascript code as part of the javascript header
     *    for the page, else, it will generate a script tag referencing the file by
     *    using the <clsTableUpdater->sJavascriptURI>.
     * @var boolean
    var $bInlineScript; //had a default value assigned here plus was private: changed it to just be var
     * String: sDefer
     * Configuration option that can be used to request that the
     * javascript file is loaded after the page has been fully loaded.
    var $sDefer; //used to be private: changed to var
     * clsmodalWindow constructor

//modified the constructor to reflect OO programming.
    function clsmodalWindow()
         $this->sDefer = '';
        $this->sJavascriptURI = '';
        $this->bInlineScript = false;


(90 replies, posted in Third party plugins)


I am trying to use modal window with the latest version of Xajax and I am receiving the following error:

Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /var/www/vhosts/gfx-null.com/subdomains/warcraft-players/httpdocs/main/xajax/xajax_plugins/response/modalWindow/modalWindow.inc.php on line 38

Would be nice to know if this will be fixed soon as I really would like to use it.