Joomla!-开源天空

2008-12-05
首页 专栏热点 Joomla! 源代码分析 Joomla!源代码探析续(三十六) JButtonPopup使用


Joomla!源代码探析续(三十六) JButtonPopup使用

E-mail

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;

 这样就可以弹出模态窗口了!

相关文章:
Joomla!源代码探析续(三十七) JToolbarhelper类常用函数手册
Joomla!源代码探析续(三十五) JFilterOutput类参考
Joomla!源代码探析续(三十四) JDatabaseMySQL类参考
joomla源代码探析续(三十三) JHTMLImage类参考
joomla源代码探析续(三十二) JString 类参考
joomla源代码探析续(三十一) JHTML 类常用的方法
joomla源代码探析续(三十) JDate类参考
joomla源代码探析续(二十九) JHTML 与JHTMLSelect 类的使用
如何判断Joomla!组件、插件是否发布
使用JProfiler调试你的Joomla!代码


收藏此文章:
Digg! Reddit! Del.icio.us! JoomlaVote! Google! Live! Facebook! StumbleUpon! Yahoo! Free social bookmarking plugins and extensions for Joomla! websites!

发表您的文章评论

您的姓名 (昵称)
标题:
评分: 很差一般较好很好
评论:
验证码:
请输入验证码