今天在研究AlphaUserPoints组建的时候,想把里面的用户页面(user profile)里面的一些不需要的东西去掉,这个比较简单,就是编辑/components/com_alphauserpoints/views/account/tmpl/default.php文件就可以了,对应的修改别的页面就修改views下别的文件夹下的default.php文件。无意中我发现了joomla的JPane classes,在官网上看看它的介绍,
This page's content makes references relevant only for Joomla! CMS Version(s) and earlier →
The use of "JPane" has been deprecated from and later Versions, please use: JHTLTabs.
JPane class types include 'Tabs' and 'Sliders'.
Sliders implement the mootools accordian effect. Examples are the Joomla Admin parameters settings. Tabs also implement mootools (but in which degree?)
startPane and endPane() require a string identifier.
JPanes contain Panels
startPanel() and endPanel() require name and ID parameters.
You can set some options in the getInstance method.
翻译下:
JPane类的类型包括“标签”和“滑块”。
滑块实现MooTools的手风琴效果。例子是Joomla管理参数设置。标签也实现了mootools的(但在何种程度呢?)
startPane和endPane()需要一个字符串标识符。
JPanes包含面板
startPanel()和endPanel()的名称和ID参数。
您可以设置一些选项中的getInstance方法。
什么情况,都已经停用了嘛,搞不懂AlphaUserPoints软件组怎么没改一下,呵呵。不过竟然使用的时候没有什么大的问题。上面的类随便就略过了,反正也不被支持了,我们直接来看看它的替代类吧:
JHtmlTabs类的选项 Options for JHtmlTabs
onActive: A callback function when a tab is activated with two params. 'title' is the tab itself, and 'description' is the tab content.
这个tab被点击时触发的回调函数,有两个参数:title(tab标题)description(tab描述)
onBackground: A callback function when a tab is backgrounded
当一个tab被隐藏后的回调函数;
startOffset: The default tab to start with (zero based index).
默认打开的tab
useCookie: Whether or not to use cookies to store tab active state. (boolean) (true | false) // This is not a string. Don't use quotes.
是否使用cookies储存tab的活动信息,属性:布尔,不要使用引号,因为它不是字符串。
Example
$options = array( 'onActive' => 'function(title, description){ description.setStyle("display", "block"); title.addClass("open").removeClass("closed"); }', 'onBackground' => 'function(title, description){ description.setStyle("display", "none"); title.addClass("closed").removeClass("open"); }', 'startOffset' => 0, // 0 starts on the first tab, 1 starts the second, etc... 'useCookie' => true, // this must not be a string. Don't use quotes. ); echo JHtml::_('tabs.start', 'tab_group_id', $options); echo JHtml::_('tabs.panel', JText::_('PANEL_1_TITLE'), 'panel_1_id'); echo 'Panel 1 content can go here.'; echo JHtml::_('tabs.panel', JText::_('PANEL_2_TITLE'), 'panel_2_id'); echo 'Panel 2 content can go here.'; echo JHtml::_('tabs.end');
现在问题出现了,joomla的官网就这么一点东西,那slider呢?升级了怎么就智能tab不能滑动了呢,伤心,我继续研究一下再说。