First, you may combine the 3 lines:
PHP Code:
vB_Template::preRegister('header', array('notifications_menubits' => $notifications_menubits));
vB_Template::preRegister('header', array('notifications_total' => $notifications_total));
vB_Template::preRegister('header', array('ubermenu' => $ubermenu));
as follows:
PHP Code:
vB_Template::preRegister('header', array('notifications_menubits' => $notifications_menubits, 'notifications_total' => $notifications_total, 'ubermenu' => $ubermenu));
However, I am thinking this is more along the lines of what you want to do:
PHP Code:
$templater = vB_Template::create('ubermenu');
$templater->register('notifications_menubits', $notifications_menubits);
$templater->register('notifications_total', $notifications_total);
$ubermenu = $templater->render();
vB_Template::preRegister('header', array('ubermenu' => $ubermenu));
This way you are registering the two variables your "ubermenu" template needs to render its output correctly, and then you can register that output (stored in $ubermenu) for use in the header template.