@@ -90,6 +90,11 @@ function install($parent) {
90
90
$ installer = new JInstaller ();
91
91
$ plgArray = array ();
92
92
93
+ // Joomla 3.0 no longer supports DS
94
+ if (!defined ('DS ' )) {
95
+ define ('DS ' , DIRECTORY_SEPARATOR );
96
+ }
97
+
93
98
foreach ($ manifest ->plugins ->plugin as $ plugin ) {
94
99
$ attributes = $ plugin ->attributes ();
95
100
$ plg = $ source . DS . $ attributes ['folder ' ] . DS . $ attributes ['plugin ' ];
@@ -98,18 +103,33 @@ function install($parent) {
98
103
}
99
104
100
105
$ db = JFactory::getDbo ();
101
- $ tableExtensions = $ db ->nameQuote ("#__extensions " );
102
- $ columnElement = $ db ->nameQuote ("element " );
103
- $ columnType = $ db ->nameQuote ("type " );
104
- $ columnEnabled = $ db ->nameQuote ("enabled " );
106
+
107
+ // In joomla 3.0, they decided to change the below name to quoteName
108
+ // so we'll do a switch and check which fn name to use
109
+ if (method_exists ($ db , 'nameQuote ' )) {
110
+ $ quoteFn = 'nameQuote ' ;
111
+ }
112
+ else if (method_exists ($ db , 'quoteName ' )) {
113
+ $ quoteFn = 'quoteName ' ;
114
+ }
115
+ else {
116
+ echo "Could not determine name of the quote function in Joomla! " ;
117
+ exit ();
118
+ }
119
+
120
+ $ tableExtensions = $ db ->$ quoteFn ("#__extensions " );
121
+ $ columnElement = $ db ->$ quoteFn ("element " );
122
+ $ columnType = $ db ->$ quoteFn ("type " );
123
+ $ columnEnabled = $ db ->$ quoteFn ("enabled " );
105
124
$ plgList = implode (', ' , $ plgArray );
106
125
107
126
// Enable plugins
108
- $ db ->setQuery ("UPDATE $ tableExtensions
109
- SET $ columnEnabled = 1
110
- WHERE $ columnElement IN ( $ plgList)
111
- AND $ columnType = 'plugin' "
112
- );
127
+ $ db ->setQuery ("
128
+ UPDATE $ tableExtensions
129
+ SET $ columnEnabled = 1
130
+ WHERE $ columnElement IN ( $ plgList)
131
+ AND $ columnType = 'plugin'
132
+ " );
113
133
$ db ->query ();
114
134
115
135
echo $ content ;
0 commit comments