Currently only the user themeselves can easily create a content profile node if non exists. We need to be able to allow some of our users to create content profile nodes for any user. (The issue here marginally touches this one.)
I am attaching an extension module for content_profile that aims to achieve that. It
- Displays the create-content-profile-type link for users with necessary permissions and
- Alters the type_node_form to put in the correct user in the author field. This is achieved by passing uid in the url. (See the respective theme function.)
- When adding a transaltion for a content profile node, the module will put in the user of the master node in the author field of the form.
| Comment | File | Size | Author |
|---|---|---|---|
| content_profile_other.tar_.gz | 1.25 KB | vitalie |
Comments
Comment #1
fagothanks for sharing.
Unfortunately the code quality could be better. I think you also forgot to add the theme file.
Perhaps we should add a "contrib" directory to content profile for extensions like this? Or even get directly into the module?
But for both I'd like to see the code to be cleaned up.
Comment #2
vitalie commentedok, I will add a contrib directory. Please help, apart from code style issues, in what ways can the code quality be improved?
Comment #3
fagohm,
* make sure to code E_ALL complicant.
* in line 16, you pass a variable from $_GET directly in user_load, when it's a string it will give errors or might be miss-used.
* Why is this module_load_include() call need? If it's needed, I think it should be documented by a comment.
* Remove unnecessary commented code lines
* I'm not sure about the theme username strip tags part - perhaps better just use the user name?
* I'd say the translation part would belong into the content profile base module
The last points leads me to another one - perhaps we should add this all as to the base module and activate it when the "add link" is activated? What are the opinions here?
Comment #4
tobbe_s commented+1 vote for adding this functionality to the module itself!
I'm currently "tearing my hair" on how to enable creating profile nodes for other users. This functionality would enable me to use Content profile as a system for managing members in a organisation (an amateur orchestra), and ride on all the power of CCK to do this. E.g. I would allow users to change some fields in their own profile, like address, whereas editing of other fields in the profile should be limited to administrators, e.g. membership expiration date.
It would also be nice to have the possibility to limit the numbers of nodes that can be created for each user (i.e. I would only want 1 profile node for each user, not more than 1). But maybe this functionality is already there?
Comment #5
fagoyes, this limit is already there.
Comment #6
daniorama commentedJust change the author to the user in the creation of the content. Any user with enough permissions would be able to do it.
Comment #7
fagoyes, but this approach tries to make it easier.
Comment #8
vitalie commentedMany thanks fago for your help.
I would be very happy if this goes to the module itself. In this case let me know if there is still anything for me to do, otherwise I will certainly improve on those points.
Comment #9
michellezeedru commented"perhaps we should add this all as to the base module and activate it when the "add link" is activated"
I vote yes - that would be very helpful to what I'm doing. Thanks!
Comment #10
fago>In this case let me know if there is still anything for me to do, otherwise I will certainly improve on those points.
Have a look at the issues I mentioned and provide a patch. That would be great!
Comment #11
fagoI've just added support for the UID get parameter and fixed the author for translations directly into the module.
TODO is just showing an appropriate link for admins.
Comment #12
fagoI had a look at the TODO and just added it to the module. So if there is the "create link" activated, it's also shown for admins with the UID parameter.
Comment #14
redijedi commentedHas this been added to the code base yet? I don't want to install the dev mod and find out its not even there.