Skip to content

Commit

Permalink
Update HtmlView.php
Browse files Browse the repository at this point in the history
This efectivelly disables the possibility to copy templates if they're namespaced extensions.
  • Loading branch information
thednp committed Feb 10, 2021
1 parent 6241ce1 commit 3e6c451
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,13 @@ protected function addToolbar()
// Add a copy template button
elseif ($this->type === 'home')
{
ToolbarHelper::modal('copyModal', 'fas fa-copy', 'COM_TEMPLATES_BUTTON_COPY_TEMPLATE');
$templateDetails = JPATH_SITE.DIRECTORY_SEPARATOR.'templates'.DIRECTORY_SEPARATOR.($this->template->name).DIRECTORY_SEPARATOR.'templateDetails.xml';
$templateXML = simplexml_load_file($templateDetails);

if ( (string) $templateXML->namespace === null || (string) $templateXML->namespace === '' )
{
ToolbarHelper::modal('copyModal', 'icon-copy', 'COM_TEMPLATES_BUTTON_COPY_TEMPLATE');
}
}
}

Expand Down

0 comments on commit 3e6c451

Please sign in to comment.