 readme  modal frame api module for drupal 6 id readmetxt v 11211 20100514 031039 markuspetrux exp original author markuspetrux http drupalorg user 39593 contents of this file overview requirements installation api reference overview this module provides an api to render an iframe within a modal dialog based on the jquery ui dialog plugin you should not install this module unless another module requires you to or you wish to use it for your own custom modules it is an alternative to popups api ajax dialogs 1 which implements its own library and api to manage popup dialogs on the other hand the modal frame api is based on the jquery ui dialog plugin and it is specially built to deal with iframe elements with very little effort and no particular ajax requirements for themers this module provides a default template for rendering child pages within modal frames modalframepagetplphp that can be copied to the theme directory and customized to suit the particular needs of the site it is also pretty easy to adapt the provided stylesheets to match the look of the site 1 http drupalorg project popups requirements jquery ui module with jquery ui library 17x http drupalorg project jqueryui note that you also need jquery 13x currently provided by the jquery update module 6x2x see http drupalorg project jqueryupdate the onbeforeunload api is not required but recommended it enhances synchronization of parent child windows http drupalorg project onbeforeunload the dirty forms module is not required but supported it warns users if they are about to close a modal dialog with unsaved changes http drupalorg project dirtyforms installation be sure to install all dependent modules copy all contents of this package to your modules directory preserving subdirectory structure go to administer site building modules to install module done api reference modal frame api is pretty simple but powerful at the same time the serverside api looks as follows modalframeparentjs adds the modal frame javascript and stylesheets to the parent page you should use this when you wish to use the clientside api to manage frames within a modal dialog modalframechildjs adds the modal frame javascript and stylesheets to the child page this is necessary for pages and or forms that are rendered within a modal frame modalframeclosedialog args when a form is rendered within a modal frame what we would call the child window you can use this function from your form submit handler to close the clientside dialog you can also give it arguments that will be passed to an optional onsubmit callback that you can provide when opening the modal frame from the parent window the clientside api looks as follows drupalmodalframeopen options use this method to open a modal frame the argument is a javascript object that may contain the following elements o url required the url of the page you wish to render within the modal frame note that this feature is restricted by browser security contexts so you can only open child pages from the same domain where the parent page is located o width and height optional the size in pixels of the dialog o autofit optional enabled by default this option activates an onresize handler that will automatically resize and center the modal frame whenever the browser window is resized or when the child document is fully loaded o draggable optional this option is enabled by default use false to disable o onopen optional this is a callback to invoke when the modal frame is opened o onload optional this is a callback to invoke when the the child document in the modal frame is fully loaded o onsubmit optional a function that will be called when the dialog is closed by the serverside response to a form submit request see modalframeclosedialog args o customdialogoptions optional an object with custom jquery ui dialog options there s also a close method and a few others but these are used internally you don t need to care about them just open a modal dialog and everything should be fine as long as the serverside menu callback invokes the function modalframechildjs when generating pages for the modal dialog the package also contains an optional module that can be used as an example it is also recommended to check out the inline code documentation as it has a lot of information on how it all works  