Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions libraries/src/Document/HtmlDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -775,9 +775,12 @@ protected function _fetchTemplate($params = [])

// 1.5 or core then 1.6
$lang->load('tpl_' . $template, JPATH_BASE)
|| ($inherits !== '' && $lang->load('tpl_' . $inherits, JPATH_BASE))
|| $lang->load('tpl_' . $template, $directory . '/' . $template)
|| ($inherits !== '' && $lang->load('tpl_' . $inherits, $directory . '/' . $inherits));
|| $lang->load('tpl_' . $template, $directory . '/' . $template);

if ($inherits) {
$lang->load('tpl_' . $inherits, $directory . '/' . $inherits)
|| $lang->load('tpl_' . $inherits, JPATH_BASE);
}

// Assign the variables
$this->baseurl = Uri::base(true);
Expand Down
24 changes: 15 additions & 9 deletions libraries/src/MVC/View/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,16 +369,22 @@ public function loadTemplate($tpl = null)
$file = preg_replace('/[^A-Z0-9_\.-]/i', '', $file);
$tpl = isset($tpl) ? preg_replace('/[^A-Z0-9_\.-]/i', '', $tpl) : $tpl;

try {
// Load the language file for the template
$lang = $this->getLanguage();
} catch (\UnexpectedValueException $e) {
$lang = Factory::getApplication()->getLanguage();
}
if (Factory::getApplication()->getDocument()->getType() !== 'html') {
try {
// Load the language file for the template
$lang = $this->getLanguage();
} catch (\UnexpectedValueException $e) {
$lang = Factory::getApplication()->getLanguage();
}

$lang->load('tpl_' . $template->template, JPATH_BASE)
|| $lang->load('tpl_' . $template->template, JPATH_THEMES . '/' . $template->template);

$lang->load('tpl_' . $template->template, JPATH_BASE)
|| $lang->load('tpl_' . $template->parent, JPATH_THEMES . '/' . $template->parent)
|| $lang->load('tpl_' . $template->template, JPATH_THEMES . '/' . $template->template);
if ($template->parent) {
$lang->load('tpl_' . $template->parent, JPATH_THEMES . '/' . $template->parent)
|| $lang->load('tpl_' . $template->parent, JPATH_BASE);
}
}

// Change the template folder if alternative layout is in different template
if (isset($layoutTemplate) && $layoutTemplate !== '_' && $layoutTemplate != $template->template) {
Expand Down