Simple way to check access based on content type using php?
| Project: | Content Type Administration by Organic Group |
| Version: | 5.x-1.6 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Hey,
I have a question about being some type of conditional statement being able to be done in php checking to see if a content type is allowed in a group or not. The reason for this is the Organic group add UI isn't all that fantastic, and I'm trying to make an icon menu to replace it, and im wondering if I can do this with this module installed.
I'm not a php developer but I can do basic conditionals and such. So what I'm looking to do is essentially say (in php),
"If node type "event" is allowed to be posted in this group, , , else if node type "blog" is allowed to be posted in this group, and so on, and so on"
What is the function to check to see if "x node type is allowed to be posted in this group"? Is there a simple function that will resolve a boolean value based on what the settings are for that particular group? I'm curious to see if I can get this working.
Many thanks!

#1
Any chance someone has been able to take a look at this?
Thanks
#2
Does anyone have any time to help out here ?
Thanks Paul
#3
Do a print_r($example); in wherever you are trying to work something out, and see what values are available, doing a search (ctrl+f) from there, for words that could be related to the group and see if theres a variable being passed to each content "type" and the organic group. Or what I usually do when I'm trying to find a variable/function that I can't seem to find in drupal API/forums is go into content template and dig through the body variables there and see if the module in question is leaving a hidden value that can be referenced for the purpose I need.
Sorry I can't be more exact since I'm not familiar with what your asking, but I'm trying to assume that same approach could apply to finding the variable you need, and I would imagine you could easily just run a few IF statements off it, or at least hope so. If this doesn't help I can try to give you more feedback through e-mail if I can get some more details from ya, so feel free to private message me and I'll see if I can help more.
#4
To provide a bit better clarification:
Essentially, I want to check to see if a content type is allowed by og content type admin in that particular group. A group administrator might want to not allow content type x and y into their group. (Group admins can still add them).
The reason I need this is because I want to create an icon menu for users to add content to their groups. If I don't do a conditional statement to determine whether or not the user has access to post that content, the icon menu will show the content types the group administrator wishes to disallow in their group, which would not be good for either the user or the group. So I have to be able to have some method which helps me determine whether or not the content type is allowed to be posted in the group before I print the link and the icon to add that specific type of content.
I'll try your variable check, but my php is very limited. If I knew the actual function to check to see if the access was true or not, it would save me alot of trouble.
Many thanks!