faq:using_popup
Joomla 1.5 comes with a popup window manager. The library pops a sized To invoke a popup you must include the javascript library and stylesheet: Typical Practice global $mainframe; $document = &$mainframe->getDocument(); $document->addScript('../includes/js/joomla/popup.js'); $document->addStyleSheet('../includes/js/joomla/popup.css'); or Within a JView display method $document = &$this->getDocument(); $document->addScript('../includes/js/joomla/popup.js'); $document->addStyleSheet('../includes/js/joomla/popup.css');
To display the popup, called var url='index3.php?option=com_content&task=wizard'; document.popup.show(url, 700, 500, null); A typical case might be to link the popup to an Administrator toolbar task. In this case, use something similar to the following: Popup linked to toolbar task <script language="javascript" type="text/javascript"> function submitbutton(task) { var f = document.adminForm; if (task == 'deleteconfirm') { id = radioGetCheckedValue( f.id ); var url='index3.php?option=com_content&task=wizard'; document.popup.show(url, 700, 500, null); } else { submitform(task); } } </script> ... to be continued |


