Skip to content

Commit

Permalink
Merge pull request #9 from zero-24/patch-6
Browse files Browse the repository at this point in the history
  • Loading branch information
roland-d committed May 8, 2016
2 parents 7dbd742 + d7b7c88 commit fe64206
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 112 deletions.
206 changes: 96 additions & 110 deletions administrator/components/com_installer/views/install/tmpl/default.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
/**
* @package Joomla.Administrator
* @package Joomla.Administrator
* @subpackage com_installer
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('_JEXEC') or die;
Expand All @@ -15,62 +15,62 @@

JFactory::getDocument()->addScriptDeclaration(
'
Joomla.submitbutton4 = function() {
var form = document.getElementById("adminForm");
Joomla.submitbutton4 = function() {
var form = document.getElementById("adminForm");
// do field validation
if (form.install_url.value == "" || form.install_url.value == "http://" || form.install_url.value == "https://") {
alert("' . JText::_('COM_INSTALLER_MSG_INSTALL_ENTER_A_URL', true) . '");
}
else
{
jQuery("#loading").css("display", "block");
form.installtype.value = "url";
form.submit();
}
};
// do field validation
if (form.install_url.value == "" || form.install_url.value == "http://" || form.install_url.value == "https://") {
alert("' . JText::_('COM_INSTALLER_MSG_INSTALL_ENTER_A_URL', true) . '");
}
else
{
jQuery("#loading").css("display", "block");
form.installtype.value = "url";
form.submit();
}
};
Joomla.submitbuttonInstallWebInstaller = function() {
var form = document.getElementById("adminForm");
form.install_url.value = "https://appscdn.joomla.org/webapps/jedapps/webinstaller.xml";
Joomla.submitbutton4();
};
Joomla.submitbuttonInstallWebInstaller = function() {
var form = document.getElementById("adminForm");
form.install_url.value = "https://appscdn.joomla.org/webapps/jedapps/webinstaller.xml";
Joomla.submitbutton4();
};
// Add spindle-wheel for installations:
jQuery(document).ready(function($) {
var outerDiv = $("#installer-install");
$("#loading")
.css("top", outerDiv.position().top - $(window).scrollTop())
.css("left", outerDiv.position().left - $(window).scrollLeft())
.css("width", outerDiv.width())
.css("height", outerDiv.height())
.css("display", "none");
});
'
// Add spindle-wheel for installations:
jQuery(document).ready(function($) {
var outerDiv = $("#installer-install");
$("#loading")
.css("top", outerDiv.position().top - $(window).scrollTop())
.css("left", outerDiv.position().left - $(window).scrollLeft())
.css("width", outerDiv.width())
.css("height", outerDiv.height())
.css("display", "none");
});
'
);

JFactory::getDocument()->addStyleDeclaration(
'
#loading {
background: rgba(255, 255, 255, .8) url(\'' . JHtml::_('image', 'jui/ajax-loader.gif', '', null, true, true) . '\') 50% 15% no-repeat;
position: fixed;
opacity: 0.8;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity = 80);
filter: alpha(opacity = 80);
margin: -10px -50px 0 -50px;
overflow: hidden;
}
.j-jed-message {
margin-bottom: 40px;
line-height: 2em;
color:#333333;
}
'
#loading {
background: rgba(255, 255, 255, .8) url(\'' . JHtml::_('image', 'jui/ajax-loader.gif', '', null, true, true) . '\') 50% 15% no-repeat;
position: fixed;
opacity: 0.8;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity = 80);
filter: alpha(opacity = 80);
margin: -10px -50px 0 -50px;
overflow: hidden;
}
.j-jed-message {
margin-bottom: 40px;
line-height: 2em;
color:#333333;
}
'
);

?>
Expand All @@ -91,74 +91,60 @@
</script>

<div id="installer-install" class="clearfix">
<form enctype="multipart/form-data" action="<?php echo JRoute::_('index.php?option=com_installer&view=install'); ?>"
method="post" name="adminForm" id="adminForm" class="form-horizontal">
<?php if (!empty($this->sidebar)) : ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<?php else : ?>
<div id="j-main-container">
<?php endif; ?>

<!-- Render messages set by extension install scripts here -->
<?php if ($this->showMessage) : ?>
<?php echo $this->loadTemplate('message'); ?>
<?php elseif ($this->showJedAndWebInstaller) : ?>
<div class="alert alert-info j-jed-message"
style="margin-bottom: 40px; line-height: 2em; color:#333333;">
<form enctype="multipart/form-data" action="<?php echo JRoute::_('index.php?option=com_installer&view=install'); ?>"
method="post" name="adminForm" id="adminForm" class="form-horizontal">
<?php if (!empty($this->sidebar)) : ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<?php else : ?>
<div id="j-main-container">
<?php endif; ?>
<!-- Render messages set by extension install scripts here -->
<?php if ($this->showMessage) : ?>
<?php echo $this->loadTemplate('message'); ?>
<?php elseif ($this->showJedAndWebInstaller) : ?>
<div class="alert alert-info j-jed-message"
style="margin-bottom: 40px; line-height: 2em; color:#333333;">
<?php echo JHtml::_(
'link',
JRoute::_('index.php?option=com_installer&view=discover' . urlencode(base64_encode(JUri::getInstance()))),
'&times;',
'class="close hasTooltip" data-dismiss="alert" title="' . str_replace('"', '&quot;', JText::_('COM_INSTALLER_SHOW_JED_INFORMATION_TOOLTIP')) . '"'
);
?>
<p><?php echo JText::_('COM_INSTALLER_INSTALL_FROM_WEB_INFO'); ?>
&nbsp;&nbsp;<?php echo JText::_('COM_INSTALLER_INSTALL_FROM_WEB_TOS'); ?></p>
<input class="btn" type="button"
value="<?php echo JText::_('COM_INSTALLER_INSTALL_FROM_WEB_ADD_TAB'); ?>"
onclick="Joomla.submitbuttonInstallWebInstaller()"/>
</div>
<?php endif; ?>

<?php echo JHtml::_('bootstrap.startTabSet', 'myTab'); ?>

<?php
// Show installation tabs at the start
$firstTab = JEventDispatcher::getInstance()->trigger('onInstallerViewBeforeFirstTab', array());
?>
<?php
// Show installation tabs
$tabs = JEventDispatcher::getInstance()->trigger('onInstallerAddInstallationTab', array());
?>
<?php
// Show installation tabs at the end
$lastTab = JEventDispatcher::getInstance()->trigger('onInstallerViewAfterLastTab', array());
?>

<?php
$tabs = array_merge($firstTab, $tabs, $lastTab);

if (!$tabs)
{
JFactory::getApplication()->enqueueMessage(JText::_('COM_INSTALLER_NO_INSTALLATION_PLUGINS_FOUND'), 'warning');
}
?>
<p><?php echo JText::_('COM_INSTALLER_INSTALL_FROM_WEB_INFO'); ?>
&nbsp;&nbsp;<?php echo JText::_('COM_INSTALLER_INSTALL_FROM_WEB_TOS'); ?></p>
<input class="btn" type="button"
value="<?php echo JText::_('COM_INSTALLER_INSTALL_FROM_WEB_ADD_TAB'); ?>"
onclick="Joomla.submitbuttonInstallWebInstaller()"/>
</div>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.startTabSet', 'myTab'); ?>
<?php // Show installation tabs at the start ?>
<?php $firstTab = JEventDispatcher::getInstance()->trigger('onInstallerViewBeforeFirstTab', array()); ?>
<?php // Show installation tabs ?>
<?php $tabs = JEventDispatcher::getInstance()->trigger('onInstallerAddInstallationTab', array()); ?>
<?php // Show installation tabs at the end ?>
<?php $lastTab = JEventDispatcher::getInstance()->trigger('onInstallerViewAfterLastTab', array()); ?>
<?php $tabs = array_merge($firstTab, $tabs, $lastTab); ?>
<?php if (!$tabs) : ?>
<?php JFactory::getApplication()->enqueueMessage(JText::_('COM_INSTALLER_NO_INSTALLATION_PLUGINS_FOUND'), 'warning'); ?>
<?php endif; ?>

<?php if ($this->ftp) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'ftp', JText::_('COM_INSTALLER_MSG_DESCFTPTITLE', true)); ?>
<?php echo $this->loadTemplate('ftp'); ?>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php if ($this->ftp) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'ftp', JText::_('COM_INSTALLER_MSG_DESCFTPTITLE', true)); ?>
<?php echo $this->loadTemplate('ftp'); ?>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>

<input type="hidden" name="installtype" value=""/>
<input type="hidden" name="task" value="install.install"/>
<?php echo JHtml::_('form.token'); ?>
<input type="hidden" name="installtype" value=""/>
<input type="hidden" name="task" value="install.install"/>
<?php echo JHtml::_('form.token'); ?>

<?php echo JHtml::_('bootstrap.endTabSet'); ?>
</div>
</form>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
</div>
</form>
</div>
<div id="loading"></div>
2 changes: 1 addition & 1 deletion plugins/installer/packageinstaller/packageinstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class PlgInstallerPackageInstaller extends JPlugin
* Recognized key values include 'name', 'group', 'params', 'language'
* (this list is not meant to be comprehensive).
*
* @since 1.5
* @since 3.6.0
*/
public function __construct(&$subject, $config = array())
{
Expand Down
2 changes: 1 addition & 1 deletion plugins/installer/urlinstaller/urlinstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class PlgInstallerUrlInstaller extends JPlugin
* Recognized key values include 'name', 'group', 'params', 'language'
* (this list is not meant to be comprehensive).
*
* @since 1.5
* @since 3.6.0
*/
public function __construct(&$subject, $config = array())
{
Expand Down

0 comments on commit fe64206

Please sign in to comment.