How to Hide PreviewRow Tab of the Restricted Detail Pages in Websites that Generated by PHPMaker 9.2.0

PreviewRow extension (only for the registered PHPMaker users) is one of the best extensions that provided by PHPMaker. It will turn your List pages which have some detail pages in it into several tabs. The tabs are hidden by default, and replaced by only plus (+) icon. When you click on the icon, then the detail pages that represented by tabs will be shown. This is very good if you have more than one detail pages. In addition it will save the space in your web application, it also makes the look and view of your web application becomes more professional.

Unfortunately, up to PHPMaker 9.2.0, it has not the ability to hide the certain tabs you want. For example, I want to hide the certain tab by using the certain Server Events for the certain user levels which do not have permission to access the detail pages. I think this ability should be provided by PHPMaker by default, especially if the current user is forbidden to display the certain detail pages. The existing condition, the tab that belong to such restricted detail pages are still being shown, and below it will be shown “You do not have permission to access the page” message. I think this is not a good condition, and also so funny. It often makes your users get confused. They must be asking by themselves: “If this detail cannot be accessed, why then the tab was being displayed?”. Indeed! LoL.

Well, I have successfully customized the extension to overcome this issue. After implementing the customization below, then all of the preview row tabs that belong to the restricted/forbidden details pages will be hidden automatically. You don’t need to use any Server Events anymore for this! You don’t need also to customize the generated script files at all as I always avoid it all the time! All we have to do is by customizing the template, so you can use it for your future PHPMaker projects.

Please Login or register to read the rest of this content.

Comments

  1. keithh0427 says:

    Masino,

    Is there a way to change the “plus sign” icon to something that is a bit more descriptive? Something like “Linked Detail” or something like it?

    • Yes. Simply customize the renderoption.php file that belongs to the previewrow extension, around line 102. There you can see the code to display the link with the “plus sign” in it. You can customize it to whatever you want.

Speak Your Mind