Forums » SEPHP Help and Tips

Creating Custom Module to Plug-Into Member Edit Form

    • 29 posts
    February 4, 2021 4:27 PM EST

    I need to be able to create a new entry in users fields.

    You know like email, password, my_custom_field.

    To do this, I think I have two options:

    I either directly update the form in admin/user/manage/edit modal box or, i create a custom module.

    I prefer the custom module option.

     

     

    Now, to do that, I need a way to plug-into when the edit modal box is rendered.

    But so far, I have not been able to figure it out.

    So the question is, is this possible via a custom module?

    If so, any idea on how to go about this?

    Another thought is, perhaps if i can get my JS script to run on either admin/user/manage or admin/user/manage/editModal

    then I can manipulate the DOM by inserting my fields in the form and using ajax to submit the data to the controllers.

    I'll appreciate some guiding lights here...

     

    Thanks everyone!

    • Moderator
    • 64 posts
    February 5, 2021 1:38 AM EST

    Hi Wale

    I need to be able to create a new entry in users fields. You know like email, password, my_custom_field.
    >> Your requirement is a bit unclear, still I will try to help you out. Are you referring to adding additional fields in this pop-up?

     

    If yes then, there is no need to work on JS for adding any field in the Edit form. You may simply add fields here:

    Custom fields can be added from here in Edit Form:-
    application/modules/User/Form/Admin/Manage/Edit.php

    Functionality related to the added custom fields can be added here:-
    application/modules/User/controllers/AdminManageController.php : editAction()

    Note- Code added in editAction will be depend on which type of functionality you want to implement in the Edit form.


    Thanks!


    This post was edited by Ritika (SocialApps.tech) at February 5, 2021 1:39 AM EST
    • 29 posts
    February 5, 2021 2:59 AM EST
    Thanks Ritikia!
    Apologies I was not too explicit!
    But yes! You're right!
    I want to edit that modal form and inject my own custom fields there.
    The catch, I want to do it from my own module.
    I wouldn't want directly edit SE files.
    For you know, when updates happen.
    But that's one way, another idea is to do this via JS.
    So, my 2nd question is, can my module somehow have access to any page on the admin back-end?
    That is, can the JS scripts of my module be loaded whenever any chosen page is loaded, so, meaning, can I load it globally?

    Thanks.
    • Moderator
    • 64 posts
    February 10, 2021 11:55 AM EST

    Hi Wale, 

    If you want to create a custom module then, what you can do is create a module and redirect the edit member functionality (pop-up which appears on clicking 'edit' option under Manage Users in the admin panel) in it. You will need to build a controller + tpl + form file to achieve this.

    By this the work will remain intact even after upgrade of SocialEngine PHP.

    Thanks!

    • Moderator
    • 5976 posts
    February 10, 2021 1:51 PM EST

    Please be aware that you'll want to stay in the loop when v6 releases as much will change. We have already removed mootools for that version which is very exciting. It will mean changes to various things. We'll post more once it releases.

  • TJ
    • 8 posts
    February 10, 2021 3:39 PM EST
    Donna said:

    Please be aware that you'll want to stay in the loop when v6 releases as much will change. We have already removed mootools for that version which is very exciting. It will mean changes to various things. We'll post more once it releases.

    I know its not policy and unpredictable when v6 will be ready, but do you have a ball park/rough idea when that might be? I'd hate to invest too much time with changes early on in my project if we're talking a month or two from now...

     

    Thanks, TJ

    • Moderator
    • 5976 posts
    February 11, 2021 5:31 AM EST

    Hi TJ, please ask that in a different thread as I don't want to get this one off track with v6 questions. :) 

    • Moderator
    • 5976 posts
    February 12, 2021 5:47 AM EST

    https://www.socialengine.com/support/article/5505090/socialengine-php-development I forgot to link our developer guides. In the Technical overview is a hello world sample module.