Fork me on GitHub

Popup Window  Bottom

  • Hello from a newbie... my module needs to popup a separate browser window where I have full control of the output, but still need to be able to access PN APIs from the PHP code. Right now it seems I can only do this by placing the PHP file in the PN home directory so that I can include all necessary PN stuf. How can I keep the PHP file with my module?

    Thanks for any hints!
  • Write your module function as normal except using the display method of pnRender rather than fetch then return true from your module function. This will display your module output not wrapped in your theme (the true return lets the core know that you've performed all the necessary output).

    For an example see the 'viewinstanceinfo' function in the permissions module admin panel.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • That is a good example, however it is not going to work for me. I need more control on the output, cannot use pnRenderer... i.e. I have to use PHP flush APIs to display messages as they are generated, etc...
  • You can do whatever you need to do in the PHP code including using (or not) pnRender. The real key is you directly display your output and then return true back to the core.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • Yes, it works. Thank you very much!
  • Mark,

    I see alot of sites use javascript to pop-up windows with certain dimensions, without toolbars, etc... Do we have anything like that in the Core? Is that possible with the pnRender->display() method described above?

    Chris

    --
    Chris Stevens, CEO
    OpenTaxi Systems LLC
    866.OPENTAXI
    www.opentaxi.com
    On-Demand Air Taxi Reservations Platform, Flight Reservations, Consulting.
  • Chris,

    There's nothing in the code i've referenced that does or doesn't limit the window like this. This is more about how you format the content of that window without the theme.

    What you need to look at is *how* you create the popup window. In your case a simple link with a target won't work. You'd need to use some javascript to limit the window. Take a look, for example, at this article from A List Apart.

    -Mark

    --
    Visit My homepage and Zikula themes.

This list is based on users active over the last 60 minutes.