Jump to content

How to get form value while saving a page ?


adrianmak
 Share

Recommended Posts

There is a member template which has a checkbox approval field.

When user login, this field will be checked. if true the login session will go ahead otherwise a message will display "your account is not approved yet".

To approve a member, administrator will update this field at the pw backend admin ui.

Something like that

post-2272-0-20860500-1462764438_thumb.pn

When a page saved, a email will send to the user to notify your account is approved.

I add a page saved hook in /sites/ready.php

But how could I get the admin form data ?

/sites/ready.php

function isMemberUserTemplate($tpl) {
    return ($tpl == 'member-user');
}

$pages->addHookAfter("saved", function($event) {
    $page = $event->object;

    $is_MemberUser = isMemberUserTemplate($page->template);
    
   if ($is_MemberUser) {
      // how to get the admin form page approval field ?
   }

});
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...