benbyf Posted August 5, 2016 Share Posted August 5, 2016 Hi, I've managed to add a new button to the edit page but i'm finding it difficult to catch when it's been clicked. I've attached an image with the new publish later button with the name pdp_pub_later, but when I message() the action its always ProcessPageEdit – who would I find out that my new button has been clicked? public function init() { $this->addHookAfter("ProcessPageEdit::execute", $this, 'publishLaterAndRedirect'); } public function publishLaterAndRedirect(HookEvent $e){ $page = $e->page; $action = $e->action; $this->message('action:' . $this->process); } 1 Link to comment Share on other sites More sharing options...
LostKobrakai Posted August 5, 2016 Share Posted August 5, 2016 Just use the same hook and test (if it's a post request and) if your button was clicked – it's name is present in the post data. If so execute something. If not go one without it. 1 Link to comment Share on other sites More sharing options...
benbyf Posted August 10, 2016 Author Share Posted August 10, 2016 Thanks @LostKobrakai I was able to pull my button name as a bool from the page input. $this->postPubLater = $this->input->post('my-submit-btn-name'); 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now