1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Hook Node Permission Manager

Discussion in 'XenForo Development Discussions' started by Vincent Gabriel, Jan 11, 2014.

  1. Vincent Gabriel

    Vincent Gabriel Active Member

    Is there any way to hook into the node permission manager without actually modifying any files or templates. I am talking about adding another input field in the following location:

    Screen Shot 2014-01-11 at 12.01.15 AM.png

    Thank You.
     
  2. Daniel Hood

    Daniel Hood Well-Known Member

    Enable debug mode
    Go to admit panel
    Click development tab
    Click "permission definitions"
     
  3. Vincent Gabriel

    Vincent Gabriel Active Member

    Thank You. That was it.
     
    Daniel Hood likes this.
  4. Vincent Gabriel

    Vincent Gabriel Active Member

    Here is another one, How would you add aN html field in the forum edit screen? something like a plain text field or a text box?

    In this section:

    Screen Shot 2014-01-12 at 9.55.45 PM.png

    Thank You.
     
  5. Brogan

    Brogan XenForo Moderator Staff Member

    You can use data type string or a named template.
     
  6. Vincent Gabriel

    Vincent Gabriel Active Member

    Thanks, I tried searching for named template got one result but it was talking about the admin style properties in particular. I am not sure how the data type string is used, Searching for that came up with nothing.

    Thanks Again.
     
  7. Jeremy

    Jeremy XenForo Moderator Staff Member

    If you would like to create a style property, it is basically the same steps as the permissions, just within the style properties section.
     
  8. Vincent Gabriel

    Vincent Gabriel Active Member

    The thing is that i don't want to create a style property. In this case i'd like to add an additional field right under the Description field in the screenshot above. When that form is saved it should save the additional field i'll add as well. I assume i'll need to add a field to the xf_forum table for that work that way. I am just not sure how to get the field in there, make it save when the form is saved, and how to properly add an additional column to the table.

    Thanks again.
     
  9. Jeremy

    Jeremy XenForo Moderator Staff Member

    That's a bit more involved. You'll need to utilize an admin template edit to add the field to the page, and then modify the datawriter's & controllers via the Class Proxy System to save and retrieve the information.
     
  10. Vincent Gabriel

    Vincent Gabriel Active Member

    By admin template edit you mean i'll have to actually edit an existing template? i'm not going to be able to do this using a hook for example?
     
  11. Daniel Hood

    Daniel Hood Well-Known Member

    There should be a hook available. First you need to find the template that is being called. Look under development - admin templates. I'm on my phone so I can't give you the exact name but there is most likely a hook in there.

    As for the db field it is recommended to prefix your field as to avoid conflict. Then as Jeremy said, you'll have to extend the data writer the same way you did the controller or model (I forget which but I remember you doing it from one of your posts).
     
  12. Bob

    Bob Well-Known Member

    Im sure Jeremy was referring to TM's/ATM's/ETM's. Admin templates have their own 'Admin Template Mods' just like Templates (frontend) and Email Templates do. I'd suggest using ATM's for what you want to do instead of hooks as hooks have been depreciated.
     
    Jeremy likes this.
  13. Vincent Gabriel

    Vincent Gabriel Active Member

    Got it. Yeah i extended the controller not the model or data writer yet. Thanks.

    Thank You. I'll do some research for the admin template modifications.
     
  14. Vincent Gabriel

    Vincent Gabriel Active Member

    Just an FYI, admin template modification did the trick. works great so far.
     

Share This Page