I want to output the built in Drupal "search" block inside of my "primary links" menu, which is built by the theme function framework_primary_links() inside template.php. The menu should end up looking like the StackOverflow menu: [chat | meta | about | faq | __search__], so the "search" field is inside the menu <ul> itself.
So I'm not just printing the search block inside a region like normal.
Currently I'm doing:
$search_block = (object) module_invoke('search', 'block', 'view', 0);
$output .= '<li id="searchContainer">' . theme('block', $search_block) . '</li>';
But Drupal is applying the "block.tpl.php" template and not the "block-search.tpl.php" template like I want it to.
How do I get Drupal to apply the "block-search.tpl.php" template file to my programmatically rendered block?