Skip to content

Commit

Permalink
Post install FTP options
Browse files Browse the repository at this point in the history
  • Loading branch information
ciar4n committed May 30, 2017
1 parent e95fb4a commit 6803dd0
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 102 deletions.
2 changes: 1 addition & 1 deletion installation/language/en-GB/en-GB.ini
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ INSTL_MCRYPT_SUPPORT_AVAILABLE="Mcrypt Support"
INSTL_NOTICEMBLANGNOTDEFAULT="PHP mbstring language is not set to neutral. This can be set locally by entering <strong>php_value mbstring.language neutral</strong> in your <code>.htaccess</code> file."
INSTL_NOTICEMBSTRINGOVERLOAD="PHP mbstring function overload is set. This can be turned off locally by entering <strong>php_value mbstring.func_overload 0</strong> in your <code>.htaccess</code> file."
INSTL_NOTICEMCRYPTNOTAVAILABLE="Warning! PHP mcrypt extension should be installed or enabled. Without this, some features of Joomla will not be available."
INSTL_NOTICEYOUCANSTILLINSTALL="<br>You can still continue the installation as the configuration settings will be displayed at the end. You will have to manually upload the code. Select in the text area to highlight all of the code and then paste into a new text file. Name this file 'configuration.php' and upload it to your site root folder."
INSTL_NOTICEYOUCANSTILLINSTALL="You can still continue the installation as the configuration settings will be displayed at the end. You will have to manually upload the code. Select in the text area to highlight all of the code and then paste into a new text file. Name this file 'configuration.php' and upload it to your site root folder."
INSTL_OUTPUT_BUFFERING="Output Buffering"
INSTL_PARSE_INI_FILE_AVAILABLE="INI Parser Support"
INSTL_PHP_VERSION="PHP Version"
Expand Down
2 changes: 1 addition & 1 deletion installation/language/en-US/en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ INSTL_MCRYPT_SUPPORT_AVAILABLE="Mcrypt Support"
INSTL_NOTICEMBLANGNOTDEFAULT="PHP mbstring language is not set to neutral. This can be set locally by entering <strong>php_value mbstring.language neutral</strong> in your <code>.htaccess</code> file."
INSTL_NOTICEMBSTRINGOVERLOAD="PHP mbstring function overload is set. This can be turned off locally by entering <strong>php_value mbstring.func_overload 0</strong> in your <code>.htaccess</code> file."
INSTL_NOTICEMCRYPTNOTAVAILABLE="Warning! PHP mcrypt extension should be installed or enabled. Without this, some features of Joomla will not be available."
INSTL_NOTICEYOUCANSTILLINSTALL="<br>You can still continue the installation as the configuration settings will be displayed at the end. You will have to manually upload the code. Select in the text area to highlight all of the code and then paste into a new text file. Name this file 'configuration.php' and upload it to your site root folder."
INSTL_NOTICEYOUCANSTILLINSTALL="You can still continue the installation as the configuration settings will be displayed at the end. You will have to manually upload the code. Select in the text area to highlight all of the code and then paste into a new text file. Name this file 'configuration.php' and upload it to your site root folder. <br><a class=\"btn btn-primary btn-sm mt-2\" href="#" id=showFtp>Connect with FTP</a>"
INSTL_OUTPUT_BUFFERING="Output Buffering"
INSTL_PARSE_INI_FILE_AVAILABLE="INI Parser Support"
INSTL_PHP_VERSION="PHP Version"
Expand Down
2 changes: 1 addition & 1 deletion installation/model/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public function getPhpOptions()

$option = new stdClass;
$option->label = JText::sprintf('INSTL_WRITABLE', 'configuration.php');
$option->state = $writable;
$option->state = false; // $writable;
$option->notice = $option->state ? null : JText::_('INSTL_NOTICEYOUCANSTILLINSTALL');
$options[] = $option;

Expand Down
24 changes: 23 additions & 1 deletion installation/template/css/template.css
Original file line number Diff line number Diff line change
Expand Up @@ -8834,4 +8834,26 @@ form {
border-left: 1px solid #ddd; }

.system-message .alert {
margin: 25px 50px; }
margin: 25px 50px; }

.preinstall-alert {
position: relative;
display: block;
padding: 20px 20px 20px 100px;
margin: 20px 0;
background: #fafafa;
border: 1px solid rgba(0, 0, 0, 0.1);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.05); }
.preinstall-alert::after {
position: absolute;
top: 50%;
left: 0;
width: 100px;
font-family: FontAwesome;
font-size: 3rem;
text-align: center;
content: "\f071";
opacity: .2;
transform: translateY(-50%); }
.preinstall-alert p {
margin-bottom: 0; }
2 changes: 1 addition & 1 deletion installation/template/css/template.css.map

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions installation/template/scss/template.scss
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,28 @@ form {
.system-message .alert {
margin: 25px 50px;
}

.preinstall-alert {
position: relative;
display: block;
padding: 20px 20px 20px 100px;
margin: 20px 0;
background: #fafafa;
border: 1px solid rgba(0,0,0,.1);
box-shadow: 0 0 10px rgba(0,0,0,.05);
&::after {
position: absolute;
top: 50%;
left: 0;
width: 100px;
font-family: FontAwesome;
font-size: 3rem;
text-align: center;
content: "\f071";
opacity: .2;
transform: translateY(-50%);
}
p {
margin-bottom: 0;
}
}
128 changes: 55 additions & 73 deletions installation/view/preinstall/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<a href="#" class="btn btn-primary" onclick="Install.submitform();" title="<?php echo JText::_('JCHECK_AGAIN'); ?>"><span class="icon-refresh icon-white"></span> <?php echo JText::_('JCHECK_AGAIN'); ?></a>
</div>
</div>
<div class="form-group">
<div class="form-group row">
<label for="jform_language" class="control-label"><?php echo JText::_('INSTL_SELECT_LANGUAGE_TITLE'); ?></label>
<?php echo $this->form->getInput('language'); ?>
</div>
Expand All @@ -26,86 +26,68 @@
</form>
<form action="index.php" method="post" id="adminForm">
<div class="row">
<div class="col-md-12">
<div class="col-md-12 mb-4">
<h3><?php echo JText::_('INSTL_PRECHECK_TITLE'); ?></h3>
<hr>
<p class="install-text">
<?php echo JText::_('INSTL_PRECHECK_DESC'); ?>
</p>
<table class="table table-striped table-sm">
<tbody>
</p>
<div class="row">
<div class="col-md-8 offset-md-2">
<?php foreach ($this->options as $option) : ?>
<?php if ($option->state === 'JNO' || $option->state === false) : ?>
<tr>
<td class="item">
<?php echo $option->label; ?>
</td>
<td>
<span class="badge badge-<?php echo ($option->state) ? 'success' : 'important'; ?>">
<?php echo JText::_($option->state ? 'JYES' : 'JNO'); ?>
<?php if ($option->notice) : ?>
<span class="icon-info-sign icon-white hasTooltip" title="<?php echo $option->notice; ?>"></span>
<?php endif;?>
</span>
</td>
</tr>
<?php if ($option->state === false && preg_match('$configuration.php$', $option->label)) : ?>
<tr>
<form action="index.php" method="post" id="adminForm" class="form-validate">
<h3><?php echo JText::_('INSTL_FTP'); ?></h3>
<hr>
<div class="form-group">
<?php echo $this->form->getLabel('ftp_enable'); ?>
<?php echo $this->form->getInput('ftp_enable'); ?>
</div>
<div class="form-group">
<?php echo $this->form->getLabel('ftp_user'); ?>
<?php echo $this->form->getInput('ftp_user'); ?>
<p class="form-text text-muted small"><?php echo JText::_('INSTL_FTP_USER_DESC'); ?></p>
</div>
<div class="form-group">
<?php echo $this->form->getLabel('ftp_pass'); ?>
<?php echo $this->form->getInput('ftp_pass'); ?>
<p class="form-text text-muted small"><?php echo JText::_('INSTL_FTP_PASSWORD_DESC'); ?></p>
</div>
<div class="form-group">
<button id="verifybutton" class="btn btn-success" onclick="Install.verifyFtpSettings(this);"><span class="icon-ok icon-white"></span> <?php echo JText::_('INSTL_VERIFY_FTP_SETTINGS'); ?></button>
</div>
<div class="form-group">
<?php echo $this->form->getLabel('ftp_host'); ?>
<div class="input-append">
<?php echo $this->form->getInput('ftp_host'); ?><button id="findbutton" class="btn btn-secondary" onclick="Install.detectFtpRoot(this);"><span class="icon-folder-open"></span> <?php echo JText::_('INSTL_AUTOFIND_FTP_PATH'); ?></button>
</div>
</div>
<div class="form-group">
<?php echo $this->form->getLabel('ftp_port'); ?>
<?php echo $this->form->getInput('ftp_port'); ?>
</div>
<div class="form-group">
<?php echo $this->form->getLabel('ftp_save'); ?>
<?php echo $this->form->getInput('ftp_save'); ?>
</div>
<div class="btn-toolbar justify-content-end">
<div class="btn-group">
<a class="btn btn-secondary" href="#" onclick="return Install.goToPage('database');" rel="prev" title="<?php echo JText::_('JPREVIOUS'); ?>"><span class="fa fa-arrow-left"></span> <?php echo JText::_('JPREVIOUS'); ?></a>
<a class="btn btn-primary" href="#" onclick="Install.submitform();" rel="next" title="<?php echo JText::_('JNEXT'); ?>"><span class="fa fa-arrow-right icon-white"></span> <?php echo JText::_('JNEXT'); ?></a>
</div>
</div>
<input type="hidden" name="task" value="ftp">
<input type="hidden" name="format" value="json">
<?php echo JHtml::_('form.token'); ?>
</form>
</tr>
<?php endif; ?>
<div class="alert preinstall-alert">
<strong><?php echo $option->label; ?></strong>
<p class="form-text text-muted small"><?php echo $option->notice; ?></p>
</div>
<?php endif; ?>
<?php endforeach; ?>
</tbody>
<tfoot>
<tr>
<td colspan="2"></td>
</tr>
</tfoot>
</table>
</div>
</div>
<?php if ($option->state === false && preg_match('$configuration.php$', $option->label)) : ?>
<div id="ftpOptions" class="ftp-options mb-4">
<form action="index.php" method="post" id="adminForm" class="form-validate">
<!-- <h3><?php echo JText::_('INSTL_FTP'); ?></h3>
<hr> -->
<div class="form-group row">
<div class="col-md-8 offset-md-2">
<?php echo $this->form->getLabel('ftp_user'); ?>
<?php echo $this->form->getInput('ftp_user'); ?>
<p class="form-text text-muted small"><?php echo JText::_('INSTL_FTP_USER_DESC'); ?></p>
</div>
</div>
<div class="form-group row">
<div class="col-md-8 offset-md-2">
<?php echo $this->form->getLabel('ftp_pass'); ?>
<?php echo $this->form->getInput('ftp_pass'); ?>
<p class="form-text text-muted small"><?php echo JText::_('INSTL_FTP_PASSWORD_DESC'); ?></p>
</div>
</div>
<div class="form-group row mb-4">
<div class="col-md-8 offset-md-2">
<?php echo $this->form->getLabel('ftp_host'); ?>
<div class="input-append d-flex">
<?php echo $this->form->getInput('ftp_host'); ?><button id="findbutton" class="btn btn-secondary ml-2" onclick="Install.detectFtpRoot(this);"><span class="icon-folder-open"></span> <?php echo JText::_('INSTL_AUTOFIND_FTP_PATH'); ?></button>
</div>
</div>
</div>
<div class="form-group row">
<div class="col-md-8 offset-md-2">
<?php echo $this->form->getLabel('ftp_port'); ?>
<?php echo $this->form->getInput('ftp_port'); ?>
</div>
</div>
<div class="form-group row">
<div class="col-md-8 offset-md-2 justify-content-end d-flex">
<button id="verifybutton" class="btn btn-success" onclick="Install.verifyFtpSettings(this);"><span class="icon-ok icon-white"></span> <?php echo JText::_('INSTL_VERIFY_FTP_SETTINGS'); ?></button>
</div>
</div>
<input type="hidden" name="task" value="ftp">
<input type="hidden" name="format" value="json">
<?php echo JHtml::_('form.token'); ?>
</form>
</div>
<?php endif; ?>
</div>
<div class="col-md-12">
<h3><?php echo JText::_('INSTL_PRECHECK_RECOMMENDED_SETTINGS_TITLE'); ?></h3>
Expand Down
32 changes: 8 additions & 24 deletions installation/view/site/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,23 @@
<form action="index.php" method="post" id="adminForm" class="form-validate">
<div class="row">
<div class="col-md-11 col-lg-12 container">
<div class="form-group row align-items-center">
<div class="form-group row">
<div class="col-md-8 offset-md-2">
<?php echo $this->form->getLabel('admin_user'); ?>
</div>
<div class="col-md-8 offset-md-2">
<?php echo $this->form->getInput('admin_user'); ?>
<p class="form-text text-muted small"><?php echo JText::_('INSTL_ADMIN_USER_DESC'); ?></p>
</div>
</div>
<div class="form-group row align-items-center">
<div class="form-group row">
<div class="col-md-8 offset-md-2">
<?php echo $this->form->getLabel('admin_email'); ?>
</div>
<div class="col-md-8 offset-md-2">
<?php echo $this->form->getInput('admin_email'); ?>
<p class="form-text text-muted small"><?php echo JText::_('INSTL_ADMIN_EMAIL_DESC'); ?></p>
</div>
</div>
<div class="form-group row align-items-center">
<div class="form-group row">
<div class="col-md-8 offset-md-2">
<?php echo $this->form->getLabel('admin_password'); ?>
</div>
<div class="col-md-8 offset-md-2">
<?php // Disables autocomplete ?> <input type="password" style="display:none">
<div class="input-group">
<?php echo $this->form->getInput('admin_password'); ?>
Expand All @@ -47,48 +41,38 @@
<p class="form-text text-muted small"><?php echo JText::_('INSTL_ADMIN_PASSWORD_DESC'); ?></p>
</div>
</div>
<div class="form-group row align-items-center">
<div class="form-group row">
<div class="col-md-8 offset-md-2">
<?php echo $this->form->getLabel('db_type'); ?>
</div>
<div class="col-md-8 offset-md-2">
<?php echo $this->form->getInput('db_type'); ?>
<p class="form-text text-muted small"><?php echo JText::_('INSTL_DATABASE_TYPE_DESC'); ?></p>
</div>
</div>
<div class="form-group row align-items-center">
<div class="form-group row">
<div class="col-md-8 offset-md-2">
<?php echo $this->form->getLabel('db_host'); ?>
</div>
<div class="col-md-8 offset-md-2">
<?php echo $this->form->getInput('db_host'); ?>
<p class="form-text text-muted small"><?php echo JText::_('INSTL_DATABASE_HOST_DESC'); ?></p>
</div>
</div>
<div class="form-group row align-items-center">
<div class="form-group row">
<div class="col-md-8 offset-md-2">
<?php echo $this->form->getLabel('db_user'); ?>
</div>
<div class="col-md-8 offset-md-2">
<?php echo $this->form->getInput('db_user'); ?>
<p class="form-text text-muted small"><?php echo JText::_('INSTL_DATABASE_USER_DESC'); ?></p>
</div>
</div>
<div class="form-group row align-items-center">
<div class="form-group row">
<div class="col-md-8 offset-md-2">
<?php echo $this->form->getLabel('db_pass'); ?>
</div>
<div class="col-md-8 offset-md-2">
<?php // Disables autocomplete ?> <input type="password" style="display:none">
<?php echo $this->form->getInput('db_pass'); ?>
<p class="form-text text-muted small"><?php echo JText::_('INSTL_DATABASE_PASSWORD_DESC'); ?></p>
</div>
</div>
<div class="form-group row align-items-center">
<div class="form-group row">
<div class="col-md-8 offset-md-2">
<?php echo $this->form->getLabel('db_name'); ?>
</div>
<div class="col-md-8 offset-md-2">
<?php echo $this->form->getInput('db_name'); ?>
<p class="form-text text-muted small"><?php echo JText::_('INSTL_DATABASE_NAME_DESC'); ?></p>
</div>
Expand Down

0 comments on commit 6803dd0

Please sign in to comment.