printAdminToolbox()

vincent3569 Member, Translator
hi

the `printAdminToolbox()` function has been deprecated (since 1.4.5).
now, the AdminToolbox link is generated by `zp_apply_filter('theme_body_close');`

is there another way to add this AdminToolbox, and the link provided ?
for example, I wish to add it in the footer of my theme, or in the header.
maybe, use a specific icon with popover, to login, register and access to some tools, as the links provided by AdminToolbox)

Comments

  • acrylian Administrator, Developer
    Not without removing the filter. The idea behind this is that you don't need to care about the toolbox as it is not direclty part of the theme but the backend. The original plan was to have even standard CSS styles for it just like the tool bar on WordPress.
  • vincent3569 Member, Translator
    what other things are doing by this filter `zp_apply_filter('theme_body_close');`?

    If I supress it, how can I access to admintoolbox links ?
  • acrylian Administrator, Developer
    Plugins or theme functions can use it. There is no fixed usage for filters by definition. I don't remember off hand which official plugin does use them right now but for sure my preloadImage plugin does.

    What is the problem with the tool box being fixed on the corner? No normal visitor sees it anyway.
  • vincent3569 Member, Translator
    in my previous release of zpBoostrap, the link was included in the footer.
    it is no longer possible with the next release of zenphoto, and I have to change my theme accordingly.
  • acrylian Administrator, Developer
    No, we thought it makes more sense to do it this way. One thing less you have to think of when doing a theme especially since it is not really theme functionality but admin. The admin toolbox was of course never just "a" link ;-)
  • vincent3569 Member, Translator
    what other things are doing by this filter `zp_apply_filter('theme_body_close');`?
    in other words, if the only thing is to a add the admintoolbox, can I insert this filter anywhere in my code (in my header for example)?
  • acrylian Administrator, Developer
    I think I already answered that. It may currently only the tool box but whatever we will do will rely on the filter being in the right place. You therefore should not place it anywhere else because also other plugins may rely on it. The name is for a reason, you know.

    Of course it is your theme so you "can" place it anywhere or even remove it else but then you may have to deal with complains if things may not work as expected.

    Sorry, Vincent, I really don't understand why this is so important, The toolbox is a admin helper and not part of the theme actually.
  • Here is what I did in my (currently in process of development) theme:
    Add the following to your css file:
    `
    #admin, #admin_data {
    display: none;
    }
    `
    Now you have divs with id #admin and #admin_data in body of your page, but they're not visible. You can now do whatever you want with that div - provided you're not afraid to use javascript :)
  • Or, you can remove that filter:
    `zp_remove_filter('theme_body_close', 'adminToolbox');`

    On the admin overview page there is a list of filters. This will show you which are registered. (Be sure you are on the 1.4.6 release since prior to that some filters were not properly shown.)
  • vincent3569 Member, Translator
    Sorry, Vincent, I really don't understand why this is so important, The toolbox is a admin helper and not part of the theme actually.
    as the theme is responsive, with collapsing menu items, I want to manage this link
  • acrylian Administrator, Developer
    @vincent: Ok, I just wanted to know. But since the display of the tool box is CSS styled you can do that via mediaqueries. Usually it is fixed postioned but of course that does not work on all mobile devices.

    @sbillard: Ah, I somehow always forget you can do that…
Sign In or Register to comment.