Mr. NiceGuy Posted April 22, 2015 Share Posted April 22, 2015 I'm building a knowledge base profile. What I'm currently on: A user with the role guesteditor gets logged in and is allowed to add a page with the parent "drafts". After the guesteditor saves his page I want to notify an admin who then moves the new page if any good to its destination. So far so good. My question now is if I can change the names and behaviour of the Publish and Save+Keep Unpublish Button to a Single "Request Permission from Admin" Button. After the button is clicked I would like to send an email to admin, save a value to the same page that the permission request was sent and display instead of the button a message like "permission requested on xx.xx.2015" How do I do this? I'm planning to write an autoload module like described here https://processwire.com/talk/topic/2331-doing-additional-logic-after-saving-a-new-page/ to populate some fields through the URL that the guesteditor clicks to add a new page. Are there similar methods to do the thing described above? Thanks! Link to comment Share on other sites More sharing options...
LostKobrakai Posted April 22, 2015 Share Posted April 22, 2015 You can use hooks to modify the return value of ProcessPageEdit::buildForm, which generates the button. This will help you get started with the form generating api: https://processwire.com/talk/topic/2089-create-simple-forms-using-api/. 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