Skip to content

Commit

Permalink
morrrerer
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrammatiko committed Jun 4, 2017
1 parent faaca17 commit 6c3a285
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 70 deletions.
10 changes: 8 additions & 2 deletions installation/controller/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ public function execute()
}
else
{
if ($vName === 'preinstall')
{
$app->redirect('index.php?view=site');
}

switch ($vName)
{
case 'languages':
Expand All @@ -86,7 +91,8 @@ public function execute()

break;
default:
$model = new InstallationModelSetup;

; $model = new InstallationModelSetup;
$checkOptions = true;
$options = $model->getOptions();

Expand All @@ -95,7 +101,7 @@ public function execute()

if ($vName != $defaultView && ($checkOptions && empty($options)))
{
// $app->redirect('index.php');
$app->redirect('index.php');
}
}

Expand Down
2 changes: 1 addition & 1 deletion installation/controller/setlanguage.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function execute()

// Get the posted values from the request and validate them.
$data = $this->getInput()->post->get('jform', [], 'array');
$return = $model->validate($data, 'preinstall');
$return = $data;//$model->validate($data, 'preinstall');

$r = new stdClass;

Expand Down
1 change: 0 additions & 1 deletion installation/template/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
<div id="container-installation" class="container-installation flex no-js">
<jdoc:include type="component" />
</div>
<hr>
</div>
<jdoc:include type="scripts" />
</body>
Expand Down
47 changes: 26 additions & 21 deletions installation/template/js/installation.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Joomla.installation = function(_container, _base) {
obj.push(name.replace('[', '%5B').replace(']', '%5D') + '=' + value);
}
}
//name.replace('[', '%5B').replace(']', '%5D')
return obj.join("&");
},

Expand Down Expand Up @@ -109,24 +110,27 @@ Joomla.installation = function(_container, _base) {
return false;
}

var sel = document.getElementById('jform_language');

console.log(sel.value)
Joomla.loadingLayer("show");
busy = true;
Joomla.removeMessages();
var data = serialiseForm(form);

console.log(data)
Joomla.request({
url: baseUrl,
method: 'POST',
data: data,
perform: true,
onSuccess: function(response, xhr){
response = JSON.parse(response);

console.log(response)
Joomla.replaceTokens(response.token);

if (response.messages) {
Joomla.renderMessages(response.messages);
}
// if (response.messages) {
// Joomla.renderMessages(response.messages);
// }

if (response.error) {
Joomla.renderMessages({'error': [response.message]});
Expand All @@ -135,11 +139,12 @@ Joomla.installation = function(_container, _base) {
} else {

var lang = document.getElementsByTagName('html')[0].getAttribute('lang');

console.log(response.data.view)
window.location = baseUrl + '?view=' + response.data.view + '&layout=default';
if (lang.toLowerCase() === response.lang.toLowerCase()) {
Install.goToPage(response.data.view, true);
// Install.goToPage(response.data.view, true);
} else {
window.location = baseUrl + '?view=' + response.data.view + '&layout=default';
// window.location = baseUrl + '?view=' + response.data.view + '&layout=default';
}
}
},
Expand Down Expand Up @@ -653,21 +658,21 @@ console.log(Joomla.makeRandomDbPrefix())
};


if (document.getElementById('submitForm')) {
document.getElementById('submitForm').addEventListener('click', function(e) {
e.preventDefault();
Joomla.checkInputs();

})
}

var langSel = document.getElementById('languageForm');
// if (document.getElementById('submitForm')) {
// document.getElementById('submitForm').addEventListener('click', function(e) {
// e.preventDefault();
// Joomla.checkInputs();
//
// })
// }

if (langSel)
document.getElementById('top-header').appendChild(langSel);
// var langSel = document.getElementById('languageForm');
//
// if (langSel)
// document.getElementById('top-header').appendChild(langSel);

var inputs = [].slice.call(document.querySelectorAll('input[type="password"], input[type="text"], input[type="email"], select'));
console.log(inputs)
// var inputs = [].slice.call(document.querySelectorAll('input[type="password"], input[type="text"], input[type="email"], select'));
// console.log(inputs)
//<select id="jform_language" class="custom-select required ml-2"></select>

// Init installation
Expand Down
45 changes: 0 additions & 45 deletions installation/view/preinstall/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,51 +85,6 @@
</div>
<?php endif; ?>
</div>
<div class="col-md-12">
<h3 class="text-center"><?php echo JText::_('INSTL_PRECHECK_RECOMMENDED_SETTINGS_TITLE'); ?></h3>
<!-- <p class="install-text">--><?php //echo JText::_('INSTL_PRECHECK_RECOMMENDED_SETTINGS_DESC'); ?><!--</p>-->
<table class="table table-striped table-sm">
<thead>
<tr>
<th>
<?php echo JText::_('INSTL_PRECHECK_DIRECTIVE'); ?>
</th>
<th>
<?php echo JText::_('INSTL_PRECHECK_RECOMMENDED'); ?>
</th>
<th>
<?php echo JText::_('INSTL_PRECHECK_ACTUAL'); ?>
</th>
</tr>
</thead>
<tbody>
<?php foreach ($this->settings as $setting) : ?>
<?php if ($setting->state !== $setting->recommended) : ?>
<tr>
<td>
<?php echo $setting->label; ?>
</td>
<td>
<span class="badge badge-success disabled">
<?php echo JText::_($setting->recommended ? 'JON' : 'JOFF'); ?>
</span>
</td>
<td>
<span class="badge badge-<?php echo ($setting->state === $setting->recommended) ? 'success' : 'warning'; ?>">
<?php echo JText::_($setting->state ? 'JON' : 'JOFF'); ?>
</span>
</td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
</tbody>
<tfoot>
<tr>
<td colspan="3"></td>
</tr>
</tfoot>
</table>
</div>
</div>
<!-- <div class="btn-toolbar justify-content-end">-->
<!-- <div class="btn-group">-->
Expand Down

0 comments on commit 6c3a285

Please sign in to comment.