JButtonPopup 可以很简单生成一个按钮,点击后弹出模态窗口,使用代码如下:
组件的view.html.php
$document =& JFactory::getDocument();
$session = & JFactory::getSession();
$document->addStyleSheet('/administrator/templates/khepri/css/general.css');
include_once($_SERVER['DOCUMENT_ROOT'].'/libraries/joomla/html/toolbar/button/popup.php');
$button = new JButtonPopup();
$html = $button->fetchButton( $type='Popup', $name = 'test', $text = 'test', $url = 'http://www.maycode.com', $width=640, $height=480, $top=0, $left=0 );
$this->assignRef('button',$html);
在模板文件default.php中
echo $this->button;
这样就可以弹出模态窗口了!