I Love PHPMaker

... because it gets even more powerful and flexible!!

  • About
  • Terms and Conditions
  • Membership Options
  • Sitemap
  • Downloads
    • PHPMaker Extensions Download
    • PHPMaker Projects Download
    • PHP Report Maker Extensions Download
I Love PHPMaker » Tips and Trick » How to Hide “Add” Link in Websites that Generated by PHPMaker 9.1.0
A Case Study: Making Orders Proceed with Order Details in Websites that Generated by PHPMaker 9.1.0
Smart Search in PHPMaker

January 21, 2013

How to Hide “Add” Link in Websites that Generated by PHPMaker 9.1.0

This following trick will show you how to hide the "Add" link in the web applications that generated by PHPMaker. Sometimes you do not want to show the "Add" link for the certain table since you want to use "Grid Add" link in order to add records using the Grid-Add feature. Well, we can achieve it by using the "Server Events" provided by PHPMaker.

In addition, this trick also will disable the functionality of "Add" page so we can prevent users to access that page by typing its address directly from the browser. In other words, when users are trying to access the "Add" page directly, then they will automatically be redirected to (for example) the "Grid Add" page. This will prevent the cheating users who will try to access the "Add" page directly by typing its URL Address.

We will use "Server Events" for this purpose. The advantage you will get is you can learn how to optimize the "Server Events" in order to hide the certain links on the fly without having to modify the generated script files. Actually, you can also hide the similar links, such as "Delete" that located outside of the table in the List/View page.

In this example, assume we use orders table as provided by PHPMaker in its demo website.

Updated on February 10, 2013: This customization has been implemented in PHPMaker version 9.2.0, it matches to each other, and as a result, it works properly.

[hidepost]

  1. Open your PHPMaker project (.pmp) file using PHPMaker as always.
  2. Click on your desired table, then click on Code (Server Events, Client Scripts and Custom Templates) tab, and expand this location: Server Events -> Table-Specific -> Common -> Row_Rendered, and then insert the following code:

        $this->AddUrl = ""; 
    

    that code will hide the "Add" link in the pages other than the List page.

  3. Still in the Server Events, go to: Table-Specific -> Add/Copy Page -> Page_Load, and then insert the following code:

    if (@$_GET["showdetail"]=="") {
          $this->Page_Terminate("ordersadd.php?showdetail=order_details");     
        }
    

    that code said, if there is no value of showdetail in the URL, which means users are trying to access the normal "Add" page, then redirect them to the Orders/Order Details page. Of course, you can adjust it that suits to your needs.

  4. Still in the Server Events, go to: Table-Specific -> List Page -> ListOptions_Load, and then insert the following code:

        $this->AddUrl = "";
    

    that code will hide the "Add" link in the List page.

  5. Finally, save your project, and then re-generate your script files using PHPMaker as always.

[/hidepost]

Article by Masino Sinaga / Tips and Trick / ListOptions_Load, Page_Load, PHPMaker 9.1.0, PHPMaker 9.2.0, Row_Rendered, Server Events Leave a Comment

A Case Study: Making Orders Proceed with Order Details in Websites that Generated by PHPMaker 9.1.0
Smart Search in PHPMaker

Leave a Reply Cancel reply

You must be logged in to post a comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

  • A New PHPMaker 2025 Project File Is Released
  • PHPMaker 2025 Demo Project File Is Released
  • Masino Extensions for PHPMaker 2025 Is Released!
  • A New PHPMaker 2024 Project File Is Released
  • PHPMaker 2024 Demo Project File Is Released
  • Masino Extensions for PHPMaker 2024 Is Released!
  • PHPMakerProjects.com, For Those Who Need PHPMaker Project Sample
  • A New PHPMaker 2023 Project File Is Released
  • PHPMaker 2023 Demo Project File Is Released
  • Masino Extensions for PHPMaker 2023 Is Released!

Search

Recent Comments

  • Masino Sinaga on Masino Extensions for PHPMaker 2024 Is Released!
  • Masino Sinaga on A New PHPMaker 2024 Project File Is Released
  • Masino Sinaga on PHPMaker 2023 Demo Project File Is Released
  • Edward Babatunde on PHPMaker 2023 Demo Project File Is Released
  • Edward Babatunde on Masino Extensions for PHPMaker 2024 Is Released!

Demo Website

  • Demo of I Love PHPMaker 2025 (MasinoExtensions).
  • Stock Inventory Management for PHPMaker 2025.

Another Demo

The following template are not available in this site (must be purchased separately)

  • PHPMaker v2018 Horizontal Vertical Template.
  • PHPMaker v2017 Horizontal Vertical Template.

Demo Explanation

Stock Inventory Management is the good project for your reference, since it uses the real example in the real world. Many useful features you can use from this project, such as how to add the Thousand and Decimal separator character, and also how to calculate multiple row in Grid-Add when End-Users are entering data into the Grid-Add mode.

Categories

  • Customize Template (103)
  • General (4)
  • PHP Report Maker (17)
  • PHP Report Maker Extensions (2)
  • PHPMaker Extensions (84)
  • PHPMaker Projects (7)
  • Tips and Trick (72)

Articles based on version

  • PHPMaker 2025
  • PHPMaker 2024
  • PHPMaker 2023
  • PHPMaker 2022
  • PHPMaker 2021
  • PHPMaker 2020
  • PHPMaker 2019
  • PHPMaker 2018
  • PHPMaker 2017.0.7
  • PHPMaker 12.0.7
  • PHPMaker 11.0.6
  • PHPMaker 10.0.5
  • PHPMaker 9.2.0
  • PHPMaker 8.0.3
  • PHP Report Maker 12

(c) I Love PHPMaker 2010 - 2025 by Masino Sinaga | WordPress | Log in | Back to top