-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
default.php
186 lines (157 loc) · 7.17 KB
/
default.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
<?php
/**
* @package Joomla.Administrator
* @subpackage com_installer
*
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
// MooTools is loaded for B/C for extensions generating JavaScript in their install scripts, this call will be removed at 4.0
JHtml::_('behavior.framework', true);
JHtml::_('bootstrap.tooltip');
?>
<script type="text/javascript">
Joomla.submitbutton = function()
{
var form = document.getElementById('adminForm');
// do field validation
if (form.install_package.value == ""){
alert("<?php echo JText::_('COM_INSTALLER_MSG_INSTALL_PLEASE_SELECT_A_PACKAGE', true); ?>");
}
else
{
jQuery('#loading').css('display', 'block');
form.installtype.value = 'upload';
form.submit();
}
};
Joomla.submitbutton3 = function()
{
var form = document.getElementById('adminForm');
// do field validation
if (form.install_directory.value == ""){
alert("<?php echo JText::_('COM_INSTALLER_MSG_INSTALL_PLEASE_SELECT_A_DIRECTORY', true); ?>");
}
else
{
jQuery('#loading').css('display', 'block');
form.installtype.value = 'folder';
form.submit();
}
};
Joomla.submitbutton4 = function()
{
var form = document.getElementById('adminForm');
// do field validation
if (form.install_url.value == "" || form.install_url.value == "http://"){
alert("<?php echo 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 = 'http://appscdn.joomla.org/webapps/jedapps/webinstaller.xml';
Joomla.submitbutton4();
};
// Add spindle-wheel for installations:
jQuery(document).ready(function($) {
var outerDiv = $('#installer-install');
$('<div id="loading"></div>')
.css("background", "rgba(255, 255, 255, .8) url('../media/jui/img/ajax-loader.gif') 50% 15% no-repeat")
.css("top", outerDiv.position().top - $(window).scrollTop())
.css("left", outerDiv.position().left - $(window).scrollLeft())
.css("width", outerDiv.width())
.css("height", outerDiv.height())
.css("position", "fixed")
.css("opacity", "0.80")
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
.css("filter", "alpha(opacity = 80)")
.css("display", "none")
.appendTo(outerDiv);
});
</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;">
<a href="index.php?option=com_config&view=component&component=com_installer&path=&return=<?php echo urlencode(base64_encode(JUri::getInstance())); ?>" class="close hasTooltip" data-dismiss="alert" title="<?php echo str_replace('"', '"', JText::_('COM_INSTALLER_SHOW_JED_INFORMATION_TOOLTIP')); ?>">×</a>
<p><?php echo JText::_('COM_INSTALLER_INSTALL_FROM_WEB_INFO'); ?> <?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', array('active' => 'upload')); ?>
<?php JEventDispatcher::getInstance()->trigger('onInstallerViewBeforeFirstTab', array()); ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'upload', JText::_('COM_INSTALLER_UPLOAD_PACKAGE_FILE', true)); ?>
<fieldset class="uploadform">
<legend><?php echo JText::_('COM_INSTALLER_UPLOAD_INSTALL_JOOMLA_EXTENSION'); ?></legend>
<div class="control-group">
<label for="install_package" class="control-label"><?php echo JText::_('COM_INSTALLER_EXTENSION_PACKAGE_FILE'); ?></label>
<div class="controls">
<input class="input_box" id="install_package" name="install_package" type="file" size="57" />
</div>
</div>
<div class="form-actions">
<input class="btn btn-primary" type="button" value="<?php echo JText::_('COM_INSTALLER_UPLOAD_AND_INSTALL'); ?>" onclick="Joomla.submitbutton()" />
</div>
</fieldset>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'directory', JText::_('COM_INSTALLER_INSTALL_FROM_DIRECTORY', true)); ?>
<fieldset class="uploadform">
<legend><?php echo JText::_('COM_INSTALLER_INSTALL_FROM_DIRECTORY'); ?></legend>
<div class="control-group">
<label for="install_directory" class="control-label"><?php echo JText::_('COM_INSTALLER_INSTALL_DIRECTORY'); ?></label>
<div class="controls">
<input type="text" id="install_directory" name="install_directory" class="span5 input_box" size="70" value="<?php echo $this->state->get('install.directory'); ?>" />
</div>
</div>
<div class="form-actions">
<input type="button" class="btn btn-primary" value="<?php echo JText::_('COM_INSTALLER_INSTALL_BUTTON'); ?>" onclick="Joomla.submitbutton3()" />
</div>
</fieldset>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'url', JText::_('COM_INSTALLER_INSTALL_FROM_URL', true)); ?>
<fieldset class="uploadform">
<legend><?php echo JText::_('COM_INSTALLER_INSTALL_FROM_URL'); ?></legend>
<div class="control-group">
<label for="install_url" class="control-label"><?php echo JText::_('COM_INSTALLER_INSTALL_URL'); ?></label>
<div class="controls">
<input type="text" id="install_url" name="install_url" class="span5 input_box" size="70" value="http://" />
</div>
</div>
<div class="form-actions">
<input type="button" class="btn btn-primary" value="<?php echo JText::_('COM_INSTALLER_INSTALL_BUTTON'); ?>" onclick="Joomla.submitbutton4()" />
</div>
</fieldset>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php JEventDispatcher::getInstance()->trigger('onInstallerViewAfterLastTab', array()); ?>
<?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; ?>
</div>
<input type="hidden" name="type" value="" />
<input type="hidden" name="installtype" value="upload" />
<input type="hidden" name="task" value="install.install" />
<?php echo JHtml::_('form.token'); ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
</form>
</div>