Admin Bar View

Dynamics99 Member
edited July 2023 in Themes

Hi,

I made a clone of the basic theme. How do enable or disable the top admin bar when I go to view the gallery? How would I customize what the options are for the user based on the privileges (like if a guest user should only have the log-out option in the admin bar dropdown)?

Tags:

Comments

  • acrylian Administrator, Developer
    edited July 2023

    How do enable or disable the top admin bar when I go to view the gallery?

    Try zp_remove_filter('theme_body_close', 'adminToolbox'); via a plugin

    How would I customize what the options are for the user based on the privileges (like if a guest user should only have the log-out option in the admin bar dropdown)?

    "Guest users" in Zenphoto terms has no right to login to the site at all because they have no user account. He can only login to specific password protected items with a guest user name and password.

    The toolbar shows the options according to the rights the current user has. While there are filters to add things to the toolbar, you cannot modify or remove the general elements. That might be possible in some future version but not for the near future. You could create your own version though, see the template function adminToolbox().

  • Okay,

    The clone I was working with was customized by someone a while ago for version 1.5.9 which is cloned off the base theme and edited to simplify the login page and display some hard drive parameters for admins. I don't think anything much changed for the base theme from 1.5.9 to 1.6.0. I found this in the inc-footer.php:

    if (zp_loggedin(ADMIN_RIGHTS) && $_zp_current_admin_obj->master) {zp_apply_filter('theme_body_close'); }
    // else if (zp_loggedin(UPLOAD_RIGHTS)) {zp_apply_filter('theme_body_close'); }
    else {zp_remove_filter('theme_body_close', 'adminToolBox');}

    When I applied the theme the only issue I have at the moment was the admin bar does not appear. If I remove this code nothing happens. Should I check if the template-functions.php file has any edits on it?

  • acrylian Administrator, Developer

    You should never completely remove the theme_body_close filter as it might be use by other things as well. You only want to remove the admintoolbox hooked to it:

    if(…) {
          zp_remove_filter('theme_body_close', 'adminToolBox');
    }
    zp_apply_filter('theme_body_close');
    

    If the toolbox generally does not appear that could be a lot. Try if it works with the standard theme version etc and if you need to find what is different. I also think that not that much changed in this area from 1.5.9. But since there are many small changes in many places you never know if not some affect things somewhere…

Sign In or Register to comment.