Content last modified Monday 6 March 2017
hop to #bottom
Categories:
Author:
Current version:
0.1
About It:
Get it:
Rate it:
  • Helpful?
  • 0 Yes
  • 0 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!

bot_admin_body_class

This micro-plugin let’s you hide items in txp backend based on the logged user name and privilege level, via css.
Once activated it simply adds two classes to the body tag of each tab via jquery:

  • One indicates the user group of the current logged user
  • Another indicates the logged user

For example if I log in as “Donald Swain” with “managing editor” privileges, the “body” tag for every txp admin page will now have two more classes: “managing_editor” and “donald_swain”.
Please note that the user name will be lowercased and spaces will be replaced with an underscore.

Privileges can be one of the following:

  • publisher
  • managing_editor
  • copy_editor
  • staff_writer
  • freelancer
  • designer
  • none

Once done that, you can easily hide items in the admin adding some css rules in your textpattern.css file.

For example:

body.managing_editor .override-form {display:none;}

will hide the “override form” field for each user logged as managing editor.
In the same vein

body.donald_swain .override-form {display:none;}

Will do the same but only if you are logged in as Donald Swain.

The idea for this plugin comes from sacripant

Info and download

Article Request Count:
Posted here:
27 Feb 2011
Article modified:
27 Feb 2011

If there is a comment form at the Information URL, you may want to leave your comments/questions there or at the Forum thread for quicker feedback. Otherwise, comment away:

Your comment will NOT be submitted until you click the 'Submit' button on the next pageload.

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

You know you want to visit the Archives.

Browse

Categories


Articles

There are also tag clouds, 'cause those are fun.
Published with Textpattern