default_upload.php
5.19 KB
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
<?php
/**
* @package Joomla.Administrator
* @subpackage com_joomlaupdate
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/** @var JoomlaupdateViewDefault $this */
$errSelectPackage = JText::_('COM_INSTALLER_MSG_INSTALL_PLEASE_SELECT_A_PACKAGE', true);
$js = <<< JS
Joomla.submitbuttonUpload = function() {
var form = document.getElementById("uploadForm");
// do field validation
if (form.install_package.value == "") {
alert("$errSelectPackage");
}
else
{
jQuery("#loading").css("display", "block");
form.submit();
}
};
// Add spindle-wheel for installations:
jQuery(document).ready(function($) {
var outerDiv = $("#joomlaupdate-wrapper");
$("#loading")
.css("top", outerDiv.position().top - $(window).scrollTop())
.css("left", "0")
.css("width", "100%")
.css("height", "100%")
.css("display", "none")
.css("margin-top", "-10px");
});
JS;
JFactory::getDocument()->addScriptDeclaration($js);
$ajaxLoaderImage = JHtml::_('image', 'jui/ajax-loader.gif', '', null, true, true);
$css = <<< CSS
#loading {
background: rgba(255, 255, 255, .8) url('$ajaxLoaderImage') 50% 15% no-repeat;
position: fixed;
opacity: 1;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity = 80);
filter: alpha(opacity = 80);
overflow: hidden;
}
CSS;
JFactory::getDocument()->addStyleDeclaration($css);
?>
<div class="alert alert-info">
<p>
<span class="icon icon-info" aria-hidden="true"></span>
<?php echo JText::sprintf('COM_JOOMLAUPDATE_VIEW_DEFAULT_UPLOAD_INTRO', 'https://downloads.joomla.org/latest'); ?>
</p>
</div>
<?php if (count($this->warnings)) : ?>
<fieldset>
<legend>
<?php echo JText::_('COM_INSTALLER_SUBMENU_WARNINGS'); ?>
</legend>
<?php $i = 0; ?>
<?php echo JHtml::_('bootstrap.startAccordion', 'warnings', array('active' => 'warning' . $i)); ?>
<?php foreach ($this->warnings as $message) : ?>
<?php echo JHtml::_('bootstrap.addSlide', 'warnings', $message['message'], 'warning' . ($i++)); ?>
<?php echo $message['description']; ?>
<?php echo JHtml::_('bootstrap.endSlide'); ?>
<?php endforeach; ?>
<?php echo JHtml::_('bootstrap.addSlide', 'warnings', JText::_('COM_INSTALLER_MSG_WARNINGFURTHERINFO'), 'furtherinfo'); ?>
<?php echo JText::_('COM_INSTALLER_MSG_WARNINGFURTHERINFODESC'); ?>
<?php echo JHtml::_('bootstrap.endSlide'); ?>
<?php echo JHtml::_('bootstrap.endAccordion'); ?>
</fieldset>
<?php endif; ?>
<form enctype="multipart/form-data" action="index.php" method="post" id="uploadForm" class="form-horizontal">
<fieldset class="uploadform">
<legend><?php echo JText::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_TAB_UPLOAD'); ?></legend>
<table class="table table-striped">
<tbody>
<tr>
<td>
<?php echo JText::_('COM_JOOMLAUPDATE_VIEW_UPLOAD_PACKAGE_FILE'); ?>
</td>
<td>
<input class="input_box" id="install_package" name="install_package" type="file" size="57" /><br>
<?php $maxSize = JHtml::_('number.bytes', JUtility::getMaxUploadSize()); ?>
<?php echo JText::sprintf('JGLOBAL_MAXIMUM_UPLOAD_SIZE_LIMIT', '‎' . $maxSize); ?>
</td>
</tr>
<tr>
<td>
<?php echo JText::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_METHOD'); ?>
</td>
<td>
<?php echo $this->methodSelectUpload; ?>
</td>
</tr>
<tr id="upload_ftp_hostname" <?php echo $this->ftpFieldsDisplay; ?>>
<td>
<?php echo JText::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_FTP_HOSTNAME'); ?>
</td>
<td>
<input type="text" name="ftp_host" value="<?php echo $this->ftp['host']; ?>" />
</td>
</tr>
<tr id="upload_ftp_port" <?php echo $this->ftpFieldsDisplay; ?>>
<td>
<?php echo JText::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_FTP_PORT'); ?>
</td>
<td>
<input type="text" name="ftp_port" value="<?php echo $this->ftp['port']; ?>" />
</td>
</tr>
<tr id="upload_ftp_username" <?php echo $this->ftpFieldsDisplay; ?>>
<td>
<?php echo JText::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_FTP_USERNAME'); ?>
</td>
<td>
<input type="text" name="ftp_user" value="<?php echo $this->ftp['username']; ?>" />
</td>
</tr>
<tr id="upload_ftp_password" <?php echo $this->ftpFieldsDisplay; ?>>
<td>
<?php echo JText::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_FTP_PASSWORD'); ?>
</td>
<td>
<input type="password" name="ftp_pass" value="<?php echo $this->ftp['password']; ?>" />
</td>
</tr>
<tr id="upload_ftp_directory" <?php echo $this->ftpFieldsDisplay; ?>>
<td>
<?php echo JText::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_FTP_DIRECTORY'); ?>
</td>
<td>
<input type="text" name="ftp_root" value="<?php echo $this->ftp['directory']; ?>" />
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>
</td>
<td>
<button class="btn btn-primary" type="button" onclick="Joomla.submitbuttonUpload()"><?php echo JText::_('COM_INSTALLER_UPLOAD_AND_INSTALL'); ?></button>
</td>
</tr>
</tfoot>
</table>
</fieldset>
<input type="hidden" name="task" value="update.upload" />
<input type="hidden" name="option" value="com_joomlaupdate" />
<?php echo JHtml::_('form.token'); ?>
</form>