Commit bd446706 authored by Aaron Wells's avatar Aaron Wells Committed by Gerrit Code Review
Browse files

Support for plugin's custom pieforms templates in /theme

Bug 1383995

Change-Id: I97710ed51fd1944e871383b3331c95b534c1413a
parent ff42bce2
......@@ -2158,7 +2158,18 @@ function pieform_element_textarea_configure($element) {
function pieform_template_dir($file, $pluginlocation='') {
global $THEME;
$filepath = get_config('docroot') . 'local/theme/pieforms/' . $file;
if (is_readable($filepath)) {
return dirname($filepath);
}
foreach ($THEME->inheritance as $themedir) {
// Check under the theme directory first
$filepath = get_config('docroot') . 'theme/' . $themedir . '/' . $pluginlocation . '/pieforms/' . $file;
if (is_readable($filepath)) {
return dirname($filepath);
}
// Then check under the plugin directory
$filepath = get_config('docroot') . $pluginlocation . '/theme/' . $themedir . '/pieforms/' . $file;
if (is_readable($filepath)) {
return dirname($filepath);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment