diff --git a/administrator/components/com_installer/controllers/install.php b/administrator/components/com_installer/controllers/install.php index 4ff949e3cc20d..60fb604e1333e 100644 --- a/administrator/components/com_installer/controllers/install.php +++ b/administrator/components/com_installer/controllers/install.php @@ -66,4 +66,25 @@ public function install() $this->setRedirect($redirect_url); } + + /** + * Install an extension from drag & drop ajax upload. + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + public function ajax_upload() + { + $this->install(); + + $app = JFactory::getApplication(); + $redirect = $this->redirect; + + header('Content-Type: application/json'); + + echo new JResponseJson(array('redirect' => $redirect), $app->getUserState('com_installer.message')); + + exit(); + } } diff --git a/administrator/components/com_installer/views/install/tmpl/default.php b/administrator/components/com_installer/views/install/tmpl/default.php index e28775f96afb9..69787c48ce18a 100644 --- a/administrator/components/com_installer/views/install/tmpl/default.php +++ b/administrator/components/com_installer/views/install/tmpl/default.php @@ -24,7 +24,7 @@ } else { - jQuery("#loading").css("display", "block"); + JoomlaInstaller.showLoading(); form.installtype.value = "url"; form.submit(); @@ -43,14 +43,26 @@ jQuery(document).ready(function($) { var outerDiv = $("#installer-install"); - $("#loading") - .css("top", outerDiv.position().top - $(window).scrollTop()) - .css("left", "0") - .css("width", "100%") - .css("height", "100%") - .css("display", "none") - .css("margin-top", "-10px"); + JoomlaInstaller.getLoadingOverlay() + .css("top", outerDiv.position().top - $(window).scrollTop()) + .css("left", "0") + .css("width", "100%") + .css("height", "100%") + .css("display", "none") + .css("margin-top", "-10px"); }); + + var JoomlaInstaller = { + getLoadingOverlay: function () { + return jQuery("#loading"); + }, + showLoading: function () { + this.getLoadingOverlay().css("display", "block"); + }, + hideLoading: function () { + this.getLoadingOverlay().css("display", "none"); + } + }; ' ); diff --git a/administrator/language/en-GB/en-GB.plg_editors_tinymce.ini b/administrator/language/en-GB/en-GB.plg_editors_tinymce.ini index 6954b47f295be..72ed3b85a4331 100644 --- a/administrator/language/en-GB/en-GB.plg_editors_tinymce.ini +++ b/administrator/language/en-GB/en-GB.plg_editors_tinymce.ini @@ -9,7 +9,7 @@ PLG_TINY_CONFIG_TEXTFILTER_ACL_DESC="If on, the text filter from the Joomla Glob PLG_TINY_CONFIG_TEXTFILTER_ACL_LABEL="Use Joomla Text Filter" PLG_TINY_ERR_CUSTOMCSSFILENOTPRESENT="The file name %s was entered in the TinyMCE Custom CSS field. This file could not be found in the default template folder. No styles are available." PLG_TINY_ERR_EDITORCSSFILENOTPRESENT="Could not find the file 'editor.css' in the template or templates/system folder. No styles are available." -PLG_TINY_ERR_UNSUPPORTEDBROWSER="Drag and drop image upload is not available for your browser. Please consider using a fully HTML5 compatible browser" +PLG_TINY_ERR_UNSUPPORTEDBROWSER="Drag and drop image upload is not available for your browser. Please consider using a fully HTML5 compatible browser." PLG_TINY_FIELD_ADVIMAGE_DESC="Turn on/off a more advanced image dialog." PLG_TINY_FIELD_ADVIMAGE_LABEL="Advanced Image" PLG_TINY_FIELD_ADVLIST_DESC="Turn on/off to enable to set number formats and bullet types in ordered and unordered lists." diff --git a/administrator/language/en-GB/en-GB.plg_installer_packageinstaller.ini b/administrator/language/en-GB/en-GB.plg_installer_packageinstaller.ini index 889642fbcd881..8f3112edc68f1 100644 --- a/administrator/language/en-GB/en-GB.plg_installer_packageinstaller.ini +++ b/administrator/language/en-GB/en-GB.plg_installer_packageinstaller.ini @@ -3,9 +3,11 @@ ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 +PLG_INSTALLER_PACKAGEINSTALLER_DRAG_FILE_HERE="Drag and drop file here to upload." PLG_INSTALLER_PACKAGEINSTALLER_EXTENSION_PACKAGE_FILE="Extension package file" PLG_INSTALLER_PACKAGEINSTALLER_NO_PACKAGE="Please select a package to upload" PLG_INSTALLER_PACKAGEINSTALLER_PLUGIN_XML_DESCRIPTION="This plugin allows you to install packages from your local computer." +PLG_INSTALLER_PACKAGEINSTALLER_SELECT_FILE="Or browse for file" PLG_INSTALLER_PACKAGEINSTALLER_UPLOAD_INSTALL_JOOMLA_EXTENSION="Upload & Install Joomla Extension" PLG_INSTALLER_PACKAGEINSTALLER_UPLOAD_PACKAGE_FILE="Upload Package File" PLG_INSTALLER_PACKAGEINSTALLER_UPLOAD_AND_INSTALL="Upload & Install" diff --git a/plugins/installer/folderinstaller/tmpl/default.php b/plugins/installer/folderinstaller/tmpl/default.php index be7fc0e518e48..da0d13b76068b 100644 --- a/plugins/installer/folderinstaller/tmpl/default.php +++ b/plugins/installer/folderinstaller/tmpl/default.php @@ -25,7 +25,7 @@ } else { - jQuery("#loading").css("display", "block"); + JoomlaInstaller.showLoading(); form.installtype.value = "folder" form.submit(); } diff --git a/plugins/installer/packageinstaller/tmpl/default.php b/plugins/installer/packageinstaller/tmpl/default.php index 416f20ac079c9..95acb8a5ad3e3 100644 --- a/plugins/installer/packageinstaller/tmpl/default.php +++ b/plugins/installer/packageinstaller/tmpl/default.php @@ -23,24 +23,200 @@ } else { - jQuery("#loading").css("display", "block"); + JoomlaInstaller.showLoading(); form.installtype.value = "upload" form.submit(); } }; '); + +// Drag and Drop installation scripts +$token = JSession::getFormToken(); +$return = JFactory::getApplication()->input->getBase64('return'); + +// Drag-drop installation +JFactory::getDocument()->addScriptDeclaration( +<<addStyleDeclaration( +<< -
- -
-
- - + +
+
+
+

+ +

+

+ +

+

+ +

+

+ +

+
+
-
- + + diff --git a/plugins/installer/urlinstaller/tmpl/default.php b/plugins/installer/urlinstaller/tmpl/default.php index cc2350e231729..0b2e2dedca4fe 100644 --- a/plugins/installer/urlinstaller/tmpl/default.php +++ b/plugins/installer/urlinstaller/tmpl/default.php @@ -22,7 +22,7 @@ } else { - jQuery("#loading").css("display", "block"); + JoomlaInstaller.showLoading(); form.installtype.value = "url" form.submit(); }