How to use
This plugin allows you to install Joomla extensions by AJAX, on the same website where this plugin is installed.
You must call this plugin by this URL: index.php?option=com_ajax&plugin=digiinstaller&format=json, sending needed data by POST method.
In the AJAX call, these two variables should be passed:
- Extension Name variable should contain the system name of the extension to install (for example "mod_digi_showcase").
- Extension URL variable should contain the URL where to download the extension to install.
Below an example code to make the AJAX call using jQuery.
- MY_BUTTON should be replaced with the identifier of the element to trigger the function.
- EXTENSION_NAME should be replaced with the system name of the extension.
- EXTENSION_URL should be replaced with the URL where to download the extension to install.
jQuery(document).ready(function() {
jQuery("MY_BUTTON").click(function(e) {
e.preventDefault();
var extensionName = "EXTENSION_NAME";
var extensionUrl = "EXTENSION_URL";
var scriptUrl = "index.php?option=com_ajax&plugin=digiinstaller&format=json";
var message = "";
jQuery.ajax({
type: "POST",
url: scriptUrl,
data: { name: extensionName, url: extensionUrl },
success: function(data) { message = data["data"]; }
});
});
});