8
I found this topic while I was trying to figure out how to do custom templates for the system_redirect.html template.
Short story:
To use custom templates in a theme (/themes/mytheme/modules//), you must set the template set to Default in the System General Preferences. If using custom templates, theme templates will never be used.
The code for selecting templates is in /class/smarty/xoops_plugins/resource.db.php in the function smarty_resource_db_tplinfo and the logic for retrieving a template generally goes like this:
1. If custom template set selected, see if template exists in that set, if it does, return it; else
2. Retrieve the template from the Default set from the database,
3. If the template doesn't exist in the Default set, return false; else
4. Check if template exists in current theme, if not, use the one found in the module templates directory
5. If that doesn't exist, use the one found in the Default set.
I would think that theme templates should over-ride database/file templates no matter what is set as a template set in the preferences. I would suggest logic more like this:
1. If exists, use theme template; else
2. If selected and exists, use template from custom theme set; else
3. If exists, use template from Default theme set; else
4. If exists, use template from module templates directory; else
5. Return false (failure)
Finally, the class/theme.php resourcePath function referenced in this thread won't deal with $path values that start with a full URL starting with http or https (other than pass it back as is), nor does it use the theme-defined template on the admin side (although I don't personally want it to do so for a number of reasons).
XOOPS 2.4.5 on PHP 5.2.14 running CentOS 5.5 with cPanel (Linux 2.6.18-028stab070.2-ent)