i ran again into an issue. I added to my theme folder a page-node-add.tpl.php to make special changes to the page. After this changes I was surprised that my dialog page presented me the template of the page-node-add.tpl.php file instead of the jquery_ui_dialog-page.tpl.php. So I made a look with the theme developer and found out that my preprocess function was called correctly and also the suggested jquery_ui_dialog-page.tpl.php was inside, but the sorting was in my case that the page-node-add.tpl.php was the last one in the array and has been delivered. I have been taken a look some days ago into the jquery_update module and saw there some interesting sugggestion to order the preprocess of the theme registry. I made some changes to your code and this problem of the wrong delivered template was fixed.
Maybe you can take a look at the changes and include these in your next update to prevent that this will happen to others who use your module..
function jquery_ui_dialog_theme_registry_alter(&$theme_registry) {
if (isset($theme_registry['page']) && isset($theme_registry['page']['theme paths'])) {
$module_path = drupal_get_path('module', 'jquery_ui_dialog');
array_unshift($theme_registry['page']['theme paths'], $module_path);
// See if our preprocess function is loaded, if so remove it.
if ($key = array_search('jquery_ui_dialog_pre_preprocess_page', $theme_registry['page']['preprocess functions'])) {
unset($theme_registry['page']['preprocess functions'][$key]);
}
$theme_registry['page']['preprocess functions'][] = 'jquery_ui_dialog_pre_preprocess_page';
}
}
It just removes the preprocess function and add it to the end that's it.
Comments
Comment #1
broncomania CreditAttribution: broncomania commentedCorrection, I made a mistake. It didn't work...?? So once again. Maybe I forgot to clear the registry.
I solved this problem now in this way.
I removed every template suggestion and just add the jquery template. This is really working for me.
I just commentet the template check out and cleared every suggestion by the core and every other module and add only the jquery dialog template. Is there a better way ?