Skip to content

Commit

Permalink
Adapt to Joomla 3.5.0 JDocumentHTML class name and folder change
Browse files Browse the repository at this point in the history
  • Loading branch information
danyj committed Mar 22, 2016
1 parent 8553f62 commit ddce6f2
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions yjsg.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,7 @@ protected function YjsgCleanup() {
*/

public function yjsgExtendJoomla() {



if (version_compare(JVERSION, '3.0', '<')) {

$IsJversion = '25';
Expand All @@ -357,7 +356,11 @@ public function yjsgExtendJoomla() {
}
$YjsgJViewDefaultRead = JPATH_LIBRARIES . '/legacy/view/legacy.php';
$YjsgJPaginationDefaultRead = JPATH_LIBRARIES . '/cms/pagination/pagination.php';
$YjsgJDocumentHTMLDefaultRead = JPATH_LIBRARIES . '/joomla/document/html/html.php';
if(version_compare(JVERSION, '3.5', '>=')){//@since 2.2.3
$YjsgJDocumentHTMLDefaultRead = JPATH_LIBRARIES . '/joomla/document/html.php';
}else{
$YjsgJDocumentHTMLDefaultRead = JPATH_LIBRARIES . '/joomla/document/html/html.php';
}
$YjsgJFormFieldDefaultRead = JPATH_LIBRARIES . '/joomla/form/field.php';
$YjsgJLayoutFileDefaultRead = JPATH_LIBRARIES . '/cms/layout/file.php';
}
Expand Down Expand Up @@ -426,7 +429,11 @@ public function yjsgExtendJoomla() {

if (!JFile::exists($YjsgJDocumentHTMLDefaultFile)) {
$YjsgJDocumentHTMLDefault = JFile::read($YjsgJDocumentHTMLDefaultRead);
$YjsgJDocumentHTMLDefault = str_replace('class JDocumentHTML', 'class YjsgJDocumentHTMLDefault', $YjsgJDocumentHTMLDefault);
if(version_compare(JVERSION, '3.5', '>=')){//@since 2.2.3
$YjsgJDocumentHTMLDefault = str_replace('class JDocumentHtml', 'class YjsgJDocumentHTMLDefault', $YjsgJDocumentHTMLDefault);
}else{
$YjsgJDocumentHTMLDefault = str_replace('class JDocumentHTML', 'class YjsgJDocumentHTMLDefault', $YjsgJDocumentHTMLDefault);
}
JFile::write($YjsgJDocumentHTMLDefaultFile, $YjsgJDocumentHTMLDefault);
}
if (!class_exists('YjsgJDocumentHTMLDefault')){
Expand Down

0 comments on commit ddce6f2

Please sign in to comment.