-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathj16000addplugin.class.php
557 lines (466 loc) · 21.3 KB
/
j16000addplugin.class.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
<?php
/**
* Core file.
*
* @author Vince Wooll <sales@jomres.net>
*
* @version Jomres 9.9.12
*
* @copyright 2005-2017 Vince Wooll
* Jomres (tm) PHP, CSS & Javascript files are released under both MIT and GPL2 licenses. This means that you can choose the license that best suits your project, and use it accordingly
**/
// ################################################################
defined('_JOMRES_INITCHECK') or die('');
// ################################################################
#[AllowDynamicProperties]
class j16000addplugin
{
public function __construct($componentArgs)
{
// Must be in all minicomponents. Minicomponents with templates that can contain editable text should run $this->template_touch() else just return
$MiniComponents = jomres_singleton_abstract::getInstance('mcHandler');
if ($MiniComponents->template_touch) {
$this->template_touchable = false;
return;
}
$siteConfig = jomres_singleton_abstract::getInstance('jomres_config_site_singleton');
$jrConfig = $siteConfig->get();
$this_jomres_version = explode('.', $jrConfig['version']);
$debugging = false;
if (!defined('JOMRES_INSTALLER')) {
define('JOMRES_INSTALLER', 1);
}
$thirdparty = jomresGetParam($_REQUEST, 'thirdparty', false);
if (!class_exists('ZipArchive')) {
$error_messsage[ 'ERROR' ] = 'Error, ZipArchive not available on this server. Please ask your hosts to rebuild PHP with --enable-zip';
echo $error_messsage[ 'ERROR' ];
return;
}
$pluginName = jomresGetParam($_REQUEST, 'plugin', '');
if (isset($componentArgs[ 'plugin' ])) {
$pluginName = $componentArgs[ 'plugin' ];
}
if (isset($_REQUEST['key'])) {
$license_key = $_REQUEST['key'];
} else {
$license_key = '';
}
$autoupgrade = (bool)jomresGetParam($_REQUEST, 'autoupgrade', false);
if (isset($componentArgs[ 'autoupgrade' ])) {
$autoupgrade = (bool)$componentArgs[ 'autoupgrade' ];
}
$ajax_install = (bool)jomresGetParam($_REQUEST, 'ajax_install', false);
if (isset($componentArgs[ 'ajax_install' ])) {
$ajax_install = (bool)$componentArgs[ 'ajax_install' ];
}
$progress_messages = array();
$error_messsage = array();
$output = array();
$pageoutput = array();
$auto_installation_result = array();
$auto_installation_results = array();
$output[ 'NEXT_STEP' ] = '';
$pluginName = str_replace('<x>', '', $pluginName);
$pluginName = str_replace('<x>', '', $pluginName);
$v = explode('.', PHP_VERSION);
$vprts = array(
'major' => $v[0],
'minor' => $v[1],
'release' => $v[2], );
$php_version = $vprts['major'].'.'.$vprts['minor'];
$key_validation = jomres_singleton_abstract::getInstance('jomres_check_support_key');
$key_validation->check_license_key(true); //only needed if we want to force a recheck
$this->key_valid = $key_validation->key_valid;
$key_to_send = '';
if ($license_key == '') {
if ($this->key_valid) {
$user_allowed_to_download = true;
$key_to_send = $key_validation->key_hash;
}
} else {
$key_to_send = $license_key;
}
$user_allowed_to_download = false;
if ($thirdparty) {
$formElement = $_FILES[ 'pluginfile' ];
$blowdedUp = explode('.', $formElement[ 'name' ]);
$pluginName = $blowdedUp[ 0 ];
}
if ($thirdparty) {
$remote_pluginsDirPath = JOMRES_REMOTEPLUGINS_ABSPATH;
} else {
$remote_pluginsDirPath = JOMRES_COREPLUGINS_ABSPATH;
}
$third_party_remote_plugins_data = json_decode(queryHubServer());
if (strlen($pluginName) == 0 && !$thirdparty) {
$error_messsage[ 'ERROR' ] = 'Error, no plugin name passed';
if ($autoupgrade) {
return false;
}
}
if (!is_dir($remote_pluginsDirPath)) {
if (!mkdir($remote_pluginsDirPath)) {
$error_messsage[ 'ERROR' ] = "Couldn't make $remote_pluginsDirPath folder. Please create it manually and ensure that apache/your web server has write access to that folder.";
if ($autoupgrade) {
return false;
}
} else {
$progress_messages[ ] = array('MESSAGE' => 'Made '.$remote_pluginsDirPath.'');
}
} else {
$progress_messages[ ] = array('MESSAGE' => 'No need to make '.$remote_pluginsDirPath.'');
}
if (!is_dir(JOMRESCONFIG_ABSOLUTE_PATH.JOMRES_ROOT_DIRECTORY.JRDS.'updates')) {
if (!mkdir(JOMRESCONFIG_ABSOLUTE_PATH.JOMRES_ROOT_DIRECTORY.JRDS.'updates')) {
$error_messsage[ 'ERROR' ] = "Couldn't make the folder ".JOMRESCONFIG_ABSOLUTE_PATH.JOMRES_ROOT_DIRECTORY.JRDS.'updates'.' so quitting.';
echo $error_messsage[ 'ERROR' ];
return;
}
}
$updateDirPath = JOMRESCONFIG_ABSOLUTE_PATH.JOMRES_ROOT_DIRECTORY.JRDS.'updates'.JRDS.$pluginName.JRDS;
if (is_dir($updateDirPath)) {
$progress_messages[ ] = array('MESSAGE' => 'Cleaning up '.$updateDirPath.' unpacked for a new installation of the plugin.');
emptyDir($updateDirPath);
rmdir($updateDirPath);
}
if (mkdir($updateDirPath)) {
$progress_messages[ ] = array('MESSAGE' => 'Made '.$updateDirPath.' for a new installation of the plugin.');
} else {
$error_messsage[ 'ERROR' ] = "Couldn't make the folder ".$updateDirPath.' so quitting.';
echo $error_messsage[ 'ERROR' ];
return;
}
if (mkdir($updateDirPath.'unpacked')) {
$progress_messages[ ] = array('MESSAGE' => 'Made '.$updateDirPath.'unpacked for a new installation of the plugin.');
} else {
$error_messsage[ 'ERROR' ] = "Couldn't make the folder ".$updateDirPath.'unpacked so quitting.';
echo $error_messsage[ 'ERROR' ];
return;
}
if ($thirdparty) {
if ((int) $_FILES['pluginfile']['error'] == 0) {
$error = false;
$formElement = $_FILES[ 'pluginfile' ];
$blowdedUp = explode('.', $formElement[ 'name' ]);
$pluginName = $blowdedUp[ 0 ];
if ($formElement[ 'name' ] != '') {
if (strstr($formElement[ 'name' ], '-')) {
$pos = strpos($formElement[ 'name' ], '-');
$temp_file_name = substr($formElement[ 'name' ], $pos + 1);
$newfilename = $updateDirPath.$temp_file_name;
$pos = strpos($temp_file_name, '.zip');
$pluginName = substr($temp_file_name, 0, $pos);
} else {
$newfilename = $updateDirPath.$formElement[ 'name' ].'';
}
if (is_uploaded_file($formElement[ 'tmp_name' ])) {
$plugin_tmp = $formElement[ 'tmp_name' ];
if (!copy($plugin_tmp, $newfilename)) {
$error = true;
$errorDesc = '<b>move_uploaded_file failed</b>';
}
}
}
if ($error) {
$error_messsage[ 'ERROR' ] = $errorDesc;
if ($autoupgrade) {
return false;
}
}
} else {
$error_codes = array(
0 => 'There is no error, the file uploaded with success',
1 => 'The uploaded file exceeds the upload_max_filesize directive in php.ini',
2 => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form',
3 => 'The uploaded file was only partially uploaded',
4 => 'No file was uploaded',
6 => 'Missing a temporary folder',
);
throw new Exception($error_codes [ $_FILES['pluginfile']['error'] ]);
}
} else {
$progress_messages[ ] = array('MESSAGE' => 'Attempting download of '.$pluginName.'');
$newfilename = $updateDirPath.$pluginName.'.zip';
$file_handle = fopen($newfilename, 'wb');
if ($file_handle == false) {
$error_messsage[ 'ERROR' ] = "Couldn't create new file $newfilename. Possible file permission problem?";
if ($autoupgrade) {
return false;
}
}
$p = '&plugin='.$pluginName;
if ( !is_null($third_party_remote_plugins_data->data->response) && property_exists($third_party_remote_plugins_data->data->response,$pluginName)) {
$base_uri = APP_SERVER;
$query_string = 'jomres/api/plugins_hub/plugin_file/'.$pluginName;
} else {
$base_uri = 'https://plugins.jomres.net/';
$query_string = 'index.php?r=gp&cms='._JOMRES_DETECTED_CMS.'&vnw=1&key='.$key_to_send.$p.'&jomresver='.$jrConfig[ 'version' ].'&hostname='.get_showtime('live_site').'&php_version='.$php_version;
}
$progress_messages[ ] = array('MESSAGE' => $base_uri.$query_string);
$content_type = '';
try {
$client = new GuzzleHttp\Client([
'base_uri' => $base_uri
]);
logging::log_message('Starting guzzle call to '.$base_uri.$query_string, 'Guzzle', 'DEBUG');
$response = $client->request('GET', $query_string, ['sink' => $file_handle]);
$content_type = $response->getHeader('Content-Type');
}
catch (Exception $e) {
$jomres_user_feedback = jomres_singleton_abstract::getInstance('jomres_user_feedback');
$jomres_user_feedback->construct_message(array('message'=>"Could not download plugin $pluginName", 'css_class'=>'alert-danger alert-error'));
}
if ($content_type == 'text/html') {
$output2 = array();
$pageoutput2 = array();
$returned_error = json_decode(file_get_contents($newfilename));
$output2['_JOMRES_ERROR'] = jr_gettext('_JOMRES_ERROR', '_JOMRES_ERROR', false, false);
$output2['MESSAGE'] = filter_var($returned_error->message, FILTER_SANITIZE_FULL_SPECIAL_CHARS);
$output2['PLUGIN_MANAGER_LINK'] = JOMRES_SITEPAGE_URL_ADMIN.'&task=showplugins';
$output2['PLUGIN_MANAGER_TEXT'] = jr_gettext('_JOMRES_CUSTOMCODE_PLUGINMANAGER', '_JOMRES_CUSTOMCODE_PLUGINMANAGER', false, false);
$pageoutput2[] = $output2;
$tmpl = new patTemplate();
$tmpl->addRows('pageoutput', $pageoutput2);
$tmpl->setRoot(JOMRES_TEMPLATEPATH_ADMINISTRATOR);
$tmpl->readTemplatesFromInput('plugin_manager_error.html');
$tmpl->displayParsedTemplate();
emptyDir($updateDirPath.'unpacked');
rmdir($updateDirPath.'unpacked');
return;
}
if (is_resource($file_handle)) {
fclose($file_handle);
}
}
if (!file_exists($newfilename) || filesize($newfilename) == 0) {
$error_messsage[ 'ERROR' ] = 'Something went wrong downloading the update files. Quitting';
if ($autoupgrade) {
return false;
}
}
$progress_messages[ ] = array('MESSAGE' => "Downloaded $newfilename");
if (is_dir($updateDirPath.'unpacked')) {
$progress_messages[ ] = array('MESSAGE' => "Starting extraction of $newfilename");
clearstatcache();
$zip = new ZipArchive();
$res = $zip->open($newfilename);
if ($res === true) {
if (!$thirdparty) {
$zip->extractTo($updateDirPath.'unpacked');
} else { // Historically, plugins have been zipped differently than Jomres plugins, so we'll need to unzip the files in 3rd party plugins, then move them up one dir, rather than force plugin devs to change how their files are zipped.
$zip->extractTo($updateDirPath.'unpacked');
// Identify directories
$source = $updateDirPath.'unpacked'.JRDS.$pluginName.JRDS;
$destination = $updateDirPath.'unpacked'.JRDS;
dirmv($source, $destination);
rmdir($source);
}
$zip->close();
} else {
$error_messsage[ 'ERROR' ] = ' Unable to unzip '.$newfilename;
}
if (!unlink($newfilename)) {
$error_messsage[ 'ERROR' ] = "Error removing $newfilename";
}
$progress_messages[ ] = array('MESSAGE' => "Completed extract of $newfilename");
$progress_messages[ ] = array('MESSAGE' => 'Moving contents of '.$updateDirPath.'unpacked to '.$remote_pluginsDirPath.$pluginName.'');
if (file_exists($updateDirPath.'unpacked'.JRDS.'plugin_dependencies_check.php')) {
require_once $updateDirPath.'unpacked'.JRDS.'plugin_dependencies_check.php';
$info = new plugin_check_dependencies();
if (!$info->test_result) {
$this->key_valid = true;
if ($this->key_valid) {
foreach ($info->dependencies as $d) {
$auto_installation_result = array();
if (!$autoupgrade) {
$auto_installation_result[ 'MESSAGE' ] = 'Attempting to auto-install dependancies';
}
$result = $MiniComponents->specificEvent('16000', 'addplugin', array('plugin' => $d, 'autoupgrade' => true));
if (!$autoupgrade) {
$discovery_required = false;
if ($result[ 'success' ]) {
$auto_installation_result[ 'MESSAGE' ] = 'Auto installed '.$d.' as it is required by '.$pluginName.'.';
if ($result[ 'discovery_required' ]) {
$discovery_required = true;
}
} else {
$auto_installation_result[ 'MESSAGE' ] = 'Failed to auto install '.$d.'. Please install the plugin manually through the plugin manager.';
}
$auto_installation_results[ ] = $auto_installation_result;
}
}
}
else {
$error_messsage[ 'ERROR' ] = " Failed dependencies check. Please ensure that you've installed the following plugins before attempting to install this one: ";
foreach ($info->dependencies as $d) {
$error_messsage[ 'ERROR' ] .= '<button type="button" href="'.JOMRES_SITEPAGE_URL_ADMIN.'&task=addplugin&no_html=1&plugin='.$d.'" target="_blank">'.$d.'</button>';
}
}
}
}
$exclusions = array();
if (file_exists($updateDirPath.'unpacked'.JRDS.'plugin_exclusions_check.php')) {
require_once $updateDirPath.'unpacked'.JRDS.'plugin_exclusions_check.php';
$info = new plugin_check_exclusions();
if (!$info->test_result) {
$error_messsage[ 'ERROR' ] = " Failed plugin_check_exclusions check. Please ensure that you've un-installed the following plugins before attempting to install this one: ";
foreach ($info->exclusions as $d) {
$exclusions[ ] = array('MESSAGE' => 'Error, the plugin you are trying to install cannot be installed because '.$d.' is already installed.');
}
//$error_messsage["ERROR"]= " One or more may be installed, this list is a list of plugins that the plugin that you are trying to install will conflict with. ";
if ($autoupgrade) {
return false;
}
}
}
if (!file_exists($updateDirPath.'unpacked'.JRDS.'plugin_info.php')) {
$error_messsage[ 'ERROR' ] = ' Plugin info file does not exist, cannot continue with installation. ';
} else {
$classname = 'plugin_info_'.$pluginName;
if (!class_exists($classname)) {
require_once $updateDirPath.'unpacked'.JRDS.'plugin_info.php';
}
$plugin_class = new $classname();
$min_jomres_ver = explode('.', $plugin_class->data[ 'min_jomres_ver' ]);
if (count($min_jomres_ver) == 3 && count($this_jomres_version) == 3) {
$min_major_version = $min_jomres_ver[ 0 ];
$min_minor_version = $min_jomres_ver[ 1 ];
$min_revis_version = $min_jomres_ver[ 2 ];
$current_major_version = $this_jomres_version[ 0 ];
$current_minor_version = $this_jomres_version[ 1 ];
$current_revis_version = $this_jomres_version[ 2 ];
$error = true;
if ($current_major_version >= $min_major_version && $current_minor_version >= $min_minor_version && $current_revis_version >= $min_revis_version) {
$error = false;
}
if ($current_major_version >= $min_major_version && $current_minor_version > $min_minor_version) {
$error = false;
}
if ($current_major_version > $min_major_version) {
$error = false;
}
if ($error) {
$error_messsage[ 'ERROR' ] = 'Error, this plugin requires at least version '.$plugin_class->data[ 'min_jomres_ver' ].' of Jomres';
if ($autoupgrade) {
return false;
}
}
}
$plugin_installed_successfully = false;
if (is_dir(JOMRES_REMOTEPLUGINS_ABSPATH.$pluginName)) {
emptyDir(JOMRES_REMOTEPLUGINS_ABSPATH.$pluginName);
$progress_messages[ ] = array('MESSAGE' => 'Removing '.JOMRES_REMOTEPLUGINS_ABSPATH.$pluginName.'');
@rmdir(JOMRES_REMOTEPLUGINS_ABSPATH.$pluginName);
}
if (is_dir(JOMRES_COREPLUGINS_ABSPATH.$pluginName)) {
emptyDir(JOMRES_COREPLUGINS_ABSPATH.$pluginName);
$progress_messages[ ] = array('MESSAGE' => 'Removing '.JOMRES_COREPLUGINS_ABSPATH.$pluginName.'');
@rmdir(JOMRES_COREPLUGINS_ABSPATH.$pluginName);
}
if (!is_dir(JOMRES_COREPLUGINS_ABSPATH.$pluginName.JRDS)) {
if (!mkdir(JOMRES_COREPLUGINS_ABSPATH.$pluginName.JRDS)) {
$error_messsage[ 'ERROR' ] = "Couldn't make the folder ".JOMRES_COREPLUGINS_ABSPATH.$pluginName.JRDS.' so quitting.';
if ($autoupgrade) {
return false;
}
}
}
$result = dirmv($updateDirPath.'unpacked', $remote_pluginsDirPath.$pluginName, true, $funcloc = JRDS);
if ($result[ 'success' ]) {
//echo $remote_pluginsDirPath.$pluginName.JRDS."plugin_install.php";exit;
$progress_messages[ ] = array('MESSAGE' => "Moved contents of $newfilename to ".$remote_pluginsDirPath.$pluginName.'');
emptyDir($updateDirPath.'unpacked');
if (!rmdir($updateDirPath.'unpacked')) {
echo 'Error removing '.$updateDirPath.'unpacked';
}
if (!rmdir($updateDirPath)) {
echo "Error removing $updateDirPath";
}
if (file_exists($remote_pluginsDirPath.$pluginName.JRDS.'plugin_install.php')) {
require_once $remote_pluginsDirPath.$pluginName.JRDS.'plugin_install.php';
}
touch($remote_pluginsDirPath.$pluginName.JRDS.'index.html');
if (isset($plugin_class->data[ 'type' ]) && ($plugin_class->data[ 'type' ] == 'mambot' || $plugin_class->data[ 'type' ] == 'module' || $plugin_class->data[ 'type' ] == 'widget')) {
if (this_cms_is_joomla() || this_cms_is_wordpress()) {
if (!$autoupgrade) {
$plugin_installed_successfully = true;
$discovery_required = true;
} else {
$this->retVals = array('success' => true, 'discovery_required' => true);
}
} else {
if (!$autoupgrade) {
$plugin_installed_successfully = true;
if (!isset($discovery_required)) {
$discovery_required = false;
}
} else {
$this->retVals = array('success' => true, 'discovery_required' => false);
}
}
} else {
if (!$autoupgrade) {
$plugin_installed_successfully = true;
if (!isset($discovery_required)) {
$discovery_required = false;
}
} else {
$this->retVals = array('success' => true, 'discovery_required' => false);
}
}
} else {
$error_messsage[ 'ERROR' ] = 'There was an error while unpacking and moving the plugin';
}
}
} else {
$error_messsage[ 'ERROR' ] = 'Error '.$updateDirPath.'unpacked does not exist';
}
$registry = jomres_singleton_abstract::getInstance('minicomponent_registry');
$registry->regenerate_registry();
emptyDir(JOMRES_CACHE_ABSPATH);
if (!$autoupgrade) {
if ($plugin_installed_successfully) {
$success = array();
if ($discovery_required) {
if ($plugin_class->data[ 'type' ] == 'widget') { // It's a wordpress widget
$output[ 'NEXT_STEP' ] = get_showtime('live_site').'/'.JOMRES_ADMINISTRATORDIRECTORY.'/plugins.php';
$success[ ] = array('MESSAGE' => 'Successfully installed the '.$pluginName.' plugin. The next button will take you to the Wordpress plugins page where you can activate the plugin.');
} else {
$output[ 'NEXT_STEP' ] = get_showtime('live_site').'/'.JOMRES_ADMINISTRATORDIRECTORY.'/index.php?option=com_installer&view=discover';
$success[ ] = array('MESSAGE' => 'Successfully installed the '.$pluginName." plugin. The next button will take you to the Extension Discovery page where you can finish the plugin's installation.");
}
} else {
$output[ 'NEXT_STEP' ] = JOMRES_SITEPAGE_URL_ADMIN.'&task=showplugins#'.$pluginName;
$success[ ] = array('MESSAGE' => 'Successfully installed the '.$pluginName.' plugin. The next page will take you back to the Jomres plugin manager.');
}
}
$pageoutput[ ] = $output;
$error_messages[ ] = $error_messsage;
$tmpl = new patTemplate();
$tmpl->addRows('pageoutput', $pageoutput);
$tmpl->addRows('error_messages', $error_messages);
$tmpl->addRows('auto_installation_results', $auto_installation_results);
$tmpl->addRows('progress_messages', $progress_messages);
$tmpl->addRows('exclusions', $exclusions);
$tmpl->addRows('success', $success);
$tmpl->setRoot(JOMRES_TEMPLATEPATH_ADMINISTRATOR);
$tmpl->readTemplatesFromInput('plugin_installation_result.html');
$tmpl->displayParsedTemplate();
} else {
if ( $ajax_install ) {
ob_clean();
$this->retVals ['install_button'] = '<button type="button" onclick="install_plugin(\''.$pluginName.'\');" class="btn btn-primary" id="install_button_content_'.$pluginName.'" >Reinstall</button>';
$this->retVals ['uninstall_button'] = '<button type="button" onclick="uninstall_plugin(\''.$pluginName.'\');" class="btn btn-danger" id="uninstall_button_content_'.$pluginName.'">Uninstall</button>';
echo json_encode($this->retVals);
}
else {
echo '1';
}
}
}
// This must be included in every Event/Mini-component
public function getRetVals()
{
return null;
}
}