Posted by tborrome on January 11, 2009 at 3:07am
| Project: | Classified Ads |
| Version: | 5.x-1.5-8 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
I'm using Classified Ads module in my site but I would like to disable the "My Classified Ads List" tab from the User Account page. How can I do this?
Comments
#1
I would also like to know how to do this.
#2
I would just like to clarify what you're trying to achieve. Is it that you simply want to turn off that tab displaying for all users as a site setting (the permission settings would still allow create/edit/reset depending on what menu options you make available), or is it that you want to disable user ads (presumably because you're running administrator or system generated ads) and by implication then remove that tab for users as it's irrelevant? The answer to that would guide a solution.
Having said that, and bearing in mind that this request is tagged for the 5.x branch, a quick hack is to edit ed_classified.module, and change line 260 from:
if ($user !== FALSE && $account->uid) {to:
if (($user !== FALSE) && ($account->uid==1)) {What this does is say to Drupal to only display that tab if you are the Administrator (uid 1). The attached patch will do it for you. But this is not an official patch, will not be included in the module ever, is purely to answer the original question, and I don't generally ever recommend modifying module or core code manually. I am happy to talk about the intended functionality and either make it a side effect of the combination of user permissions, or an explicit checkbox in the module settings as a feature request for inclusion in a future release of the module.
Cheers,
Miles
#3
#4
Great. Thanks Miles - I'll give it a try.
G
#5
The patch worked.
#6
I was hoping to make the tab visible only to users with site admin privileges:
if (($user !== FALSE) && ($is_admin !== TRUE)) {
But this seems to only hides it for non - logged in users....
#7
User says "the patch worked", so assuming fixed.
Policy for displaying this tab or not changed in 6.x/7.x versions anyway.
#8
Automatically closed -- issue fixed for 2 weeks with no activity.