Mutt
Well-known member
1/2 because I wanted it & 1/2 because I wanted to learn how to do it, I hacked the code to add a usergroup description field. so far it's only seen in the AdminCP on the add/edit usergroup page & the usergroup list page. if you're wondering why, it's so I could decide how to set the permissions.
to do it I did the following
- edited "user_group_edit" admin template to add "description" field
- edited "user_group_list" admin template to add "description" to usergroup snippet
- phrase "description" was already in the vocab so I didn't have to add that
- edited ControllerAdmin\UserGroup.php in 2 spots to read & save description field
- edited DataWriter\UserGroup.php in 1 spot to list description as a valid field
- used phpmyadmin to add the "description" field to the "xf_user_group" table
my question is, would it have been possible to do this as an addon instead of a code hack? if so, could someone point me in the right direction? the code hacks are attached as screenshots. for obvious reasons I'd rather not hack code & edit templates but I have to learn to crawl before I can walk so getting the damn thing to work was step 1. it took me long enough to figure out the valid field thing.
anyway, thanks in advance for the help
to do it I did the following
- edited "user_group_edit" admin template to add "description" field
- edited "user_group_list" admin template to add "description" to usergroup snippet
- phrase "description" was already in the vocab so I didn't have to add that
- edited ControllerAdmin\UserGroup.php in 2 spots to read & save description field
- edited DataWriter\UserGroup.php in 1 spot to list description as a valid field
- used phpmyadmin to add the "description" field to the "xf_user_group" table
my question is, would it have been possible to do this as an addon instead of a code hack? if so, could someone point me in the right direction? the code hacks are attached as screenshots. for obvious reasons I'd rather not hack code & edit templates but I have to learn to crawl before I can walk so getting the damn thing to work was step 1. it took me long enough to figure out the valid field thing.
anyway, thanks in advance for the help