Joomla 自定义工具栏按钮消息 [英] Joomla custom toolbar button message
问题描述
标准的管理工具栏按钮可以让您向它们发送消息.例如:一条真的删除"的消息什么的......
The standard admin toolbar buttons have the possibility that you can give them a message. For example: a "really delete" message or something...
JToolBarHelper::deleteList('Do you wanna really delete?', 'controller.delete');
这也适用于自定义按钮吗?在文档中没有这个参数.http://docs.joomla.org/JToolBarHelper/custom
Is that also possible for a custom button? In the documentation is no parameter for this. http://docs.joomla.org/JToolBarHelper/custom
Joomla 有其他解决方案吗?向用户显示一条消息,并在他确认后……执行我的代码!这可能吗?
Did Joomla have another solution? Show the user a message and after his confirmation... execute my code! Is that possible?
抱歉我的英语不好:)谢谢!
Sorry for my bad english :) thanks!
推荐答案
当然有可能 :)
只需添加到您的组件模板视图(例如:)
Simply add to your component template view (for example:)
administrator/components/com_yourcomponent/views/your_view/tmpl/default.php
此代码:
<script type="text/javascript">
Joomla.submitbutton = function(task)
{
if (task == 'customcontroller.delete')
{
if (confirm(Joomla.JText._('Do you really want to delete these items?'))) {
Joomla.submitform(task);
} else {
return false;
}
}
}
</script>
只需更改任务并编辑消息即可开始
Just change the task and edit the message and you should be ready to go
这篇关于Joomla 自定义工具栏按钮消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!