Skip to content

Commit 14a4be8

Browse files
authored
[5.3] Template Override Plugins Compare (joomla#44588)
--------- Signed-off-by: BrianTeeman <[email protected]>
1 parent 174347f commit 14a4be8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

administrator/components/com_templates/src/Model/TemplateModel.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ public function getCoreFile($file, $client_id)
489489
$componentPath = Path::clean($client->path . '/components/');
490490
$modulePath = Path::clean($client->path . '/modules/');
491491
$layoutPath = Path::clean(JPATH_ROOT . '/layouts/');
492+
$pluginPath = Path::clean(JPATH_ROOT . '/plugins/');
492493

493494
// For modules
494495
if (stristr($type, 'mod_') !== false) {
@@ -500,6 +501,18 @@ public function getCoreFile($file, $client_id)
500501
return $coreFile;
501502
}
502503

504+
// For plugins
505+
if (stristr($type, 'plg_') !== false) {
506+
$pluginFolder = explode('_', $explodeArray['2']);
507+
$folder = $pluginFolder['1'];
508+
$subFolder = $pluginFolder['2'];
509+
$htmlPath = Path::clean($pluginPath . $folder . '/' . $subFolder . '/tmpl/');
510+
$fileName = $this->getSafeName($fileName);
511+
$coreFile = Path::find($htmlPath, $fileName);
512+
513+
return $coreFile;
514+
}
515+
503516
if (stristr($type, 'com_') !== false) {
504517
// For components
505518
$folder = $explodeArray['2'];

0 commit comments

Comments
 (0)