If you remember way back when, we had a good blog post here talking about how to extend the ListView actions menu to put in new action items. But what if there are options on the menu by default that you don’t want there? There’s a way to remove these as well.
Each of these options can be triggered off by setting the properties of the ListView object properly. Here’s the action menu items and the properties that control them.
- Delete – ListViewSmarty::$delete ( also not shown when you don’t have Delete ACL rights on the module )
- Email – ListViewSmarty::$email
- Mass Update – ListViewSmarty::$showMassUpdateFields ( also not shown when you don’t have the Mass Update ACL right on the module, or no fields exist that allow mass updating
- Merge – ListViewSmarty::$mailMerge ( for mail merge ) or ListViewSmarty::$mergeduplicates ( for duplicate merge )
- Add to Target List – ListViewSmarty::$targetlist
- Export – ListViewSmarty::$export
Now to set these properties, you can easily drop in a custom view.list.php file in the custom/modules/YOURMODULENAME/views/ directory to set these properties. It would look something like this…
This would remove the Export and Delete action items from the menu.