Hooks/admin theme header

This hook is fired by the header.php script, which is loaded by a call to head() while it is populating the <head> tag for the admin theme. Functions attaching to this hook can directly output HTML into the <head>, or use functions like queue_css() and queue_js().

Plugins will likely not need to add content to the admin-side `<head>` for every page, but the passed request object can be used to include content on particular pages only.

Arguments

Zend_Controller_Request_Http $request {{#if
| (optional)}}
{{#if: | Default: {{{default}}}}}

Example(s)

The following example adds an external javascript file to only the items/edit page.

add_plugin_hook('admin_theme_header', 'my_plugin_admin_theme_header');
function my_plugin_admin_theme_header($request)
{
    if ($request->getController() == 'items' && $request->getAction() == 'edit') {
        queue_js('my-script');
    }
}