Skip to content

Commit b3b3a80

Browse files
committed
Further limiting isis.js to only core Joomla edits.
in contiunes effort to fix the js conflict for other extensions using component.php for layout. related to #49
1 parent 5e93394 commit b3b3a80

File tree

1 file changed

+40
-8
lines changed

1 file changed

+40
-8
lines changed

astroid/astroid-template-zero/component.php

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<?php
22
/**
3-
* @package Joomla.Administrator
4-
* @subpackage Templates.isis
5-
*
6-
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
7-
* @license GNU General Public License version 2 or later; see LICENSE.txt
3+
* @package Astroid Framework
4+
* @author JoomDev https://www.joomdev.com
5+
* @copyright Copyright (C) 2009 - 2019 JoomDev.
6+
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or Later
87
*/
98
defined('_JEXEC') or die;
109

@@ -27,11 +26,44 @@
2726
$option = $jinput->get('option', '', 'STR');
2827
$function = $jinput->get('function', '', 'STR');
2928
$layout = $jinput->get('layout', '', 'STR');
30-
if($option == 'com_media' || $function == 'jSelectArticle' || $layout == 'modal' || $layout == 'pagebreak') {
31-
// Add template js
29+
30+
$view = $jinput->get('view','','STR');
31+
$tmpl = $jinput->get('tmpl','','STR');
32+
$e_name = $jinput->get('e_name','','STR');
33+
$editor = $jinput->get('editor','','STR');
34+
35+
$addtemplatejs = false;
36+
37+
//Editor Module button
38+
if($view == 'modules' && $layout =='modal' && $option =='com_modules' && $editor == 'jform_articletext'){
39+
$addtemplatejs = true;
40+
}
41+
//Editor Menu button
42+
if($view == 'items' && $layout =='modal' && $option =='com_menus' && $editor=='jform_articletext'){
43+
$addtemplatejs = true;
44+
}
45+
//Editor Contact button
46+
if($view == 'contacts' && $layout =='modal' && $option =='com_contact'){
47+
$addtemplatejs = true;
48+
}
49+
//Editor Article button
50+
if($view == 'articles' && $layout =='modal' && $option=='com_content' && $editor=='jform_articletext'){
51+
$addtemplatejs = true;
52+
}
53+
//Editor Image button
54+
if($option == 'com_media' && $tmpl =='component'){
55+
$addtemplatejs = true;
56+
}
57+
//Editor Page break button
58+
if($view == 'article' && $option == 'com_content' && $layout == 'pagebreak' && $e_name=='jform_articletext'){
59+
$addtemplatejs = true;
60+
}
61+
62+
if($addtemplatejs){
3263
JHtml::_('script', 'isis.js', array('version' => 'auto', 'relative' => true));
33-
JHtml::_('stylesheet', 'isis/isis.css', array('version' => 'auto', 'relative' => true));
64+
JHtml::_('stylesheet', 'isis/isis.css', array('version' => 'auto', 'relative' => true));
3465
}
66+
3567
// Add html5 shiv
3668
JHtml::_('script', 'jui/html5.js', array('version' => 'auto', 'relative' => true, 'conditional' => 'lt IE 9'));
3769

0 commit comments

Comments
 (0)