Skip to content

Commit

Permalink
NOOOOOOOOOOOOOOOOOOOOOOOOO
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrammatiko committed Jun 4, 2017
1 parent 3eec79d commit faaca17
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 43 deletions.
5 changes: 3 additions & 2 deletions installation/controller/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public function execute()

break;
case 'summary':
case 'install':
$model = new InstallationModelSetup;
// InstallationModelConfiguration;
$checkOptions = true;
Expand All @@ -87,14 +88,14 @@ public function execute()
default:
$model = new InstallationModelSetup;
$checkOptions = true;
$options = [];
$options = $model->getOptions();

break;
}

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

Expand Down
6 changes: 3 additions & 3 deletions installation/controller/install/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ public function execute()
$app = $this->getApplication();

// Check for request forgeries.
JSession::checkToken() or $app->sendJsonResponse(new Exception(JText::_('JINVALID_TOKEN'), 403));
// JSession::checkToken() or $app->sendJsonResponse(new Exception(JText::_('JINVALID_TOKEN'), 403));

// Get the options from the session
$options = (new InstallationModelSetup)->getOptions();

$r = new stdClass;
$r->view = 'complete';
$r->view = 'summary';

// Attempt to setup the configuration.
if (!(new InstallationModelConfiguration)->setup($options))
{
$r->view = 'database';
$r->view = 'site';
}

$app->sendJsonResponse($r);
Expand Down
4 changes: 2 additions & 2 deletions installation/model/configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function createConfiguration($options)
$registry = new Registry;

// Site settings.
$registry->set('offline', $options->site_offline);
$registry->set('offline', '0');
$registry->set('offline_message', JText::_('INSTL_STD_OFFLINE_MSG'));
$registry->set('display_offline_message', 1);
$registry->set('offline_image', '');
Expand Down Expand Up @@ -121,7 +121,7 @@ public function createConfiguration($options)
$registry->set('cache_platformprefix', 0);

// Meta settings.
$registry->set('MetaDesc', $options->site_metadesc);
$registry->set('MetaDesc', '');
$registry->set('MetaKeys', '');
$registry->set('MetaTitle', 1);
$registry->set('MetaAuthor', 1);
Expand Down
20 changes: 18 additions & 2 deletions installation/template/js/installation.js
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ console.log(data)
// Init on dom content loaded event
document.addEventListener('DOMContentLoaded', function() {

var url = document.location;
var url = Joomla.getOptions('system.installation').url ? Joomla.getOptions('system.installation').url.replace(/&/g, '&') : 'index.php';
// Show the container
if (document.getElementById('container-installation')) {
document.getElementById('container-installation').classList.remove('no-js');
Expand Down Expand Up @@ -645,11 +645,27 @@ document.addEventListener('DOMContentLoaded', function() {
document.getElementById('jform_db_prefix').value = Joomla.makeRandomDbPrefix();
console.log(Joomla.makeRandomDbPrefix())

Install.install(['config', 'database'])
window.location = url + '?view=install'
// Install.goToPage('summary');
// Install.install(['Config']);

//if (state === true) Install.install(['config']);
};


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

})
}

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)
//<select id="jform_language" class="custom-select required ml-2"></select>
Expand Down
22 changes: 11 additions & 11 deletions installation/view/install/html.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,20 @@ public function render()
* Prepare the tasks array
* Note: The first character of the task *MUST* be capitalised or the application will not find the task
*/
$this->tasks[] = ($this->options['db_old'] == 'remove') ? 'Database_remove' : 'Database_backup';
// $this->tasks[] = ($this->options['db_old'] == 'remove') ? 'Database_remove' : 'Database_backup';
$this->tasks[] = 'Database';

if ($this->options['sample_file'])
{
$this->tasks[] = 'Sample';
}
//
// if ($this->options['sample_file'])
// {
// $this->tasks[] = 'Sample';
// }

$this->tasks[] = 'Config';

if ($this->options['summary_email'])
{
$this->tasks[] = 'Email';
}
//
// if ($this->options['summary_email'])
// {
// $this->tasks[] = 'Email';
// }

return parent::render();
}
Expand Down
33 changes: 19 additions & 14 deletions installation/view/install/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,25 @@ class="progress-bar progress-bar-striped progress-bar-animated"
<?php echo JHtml::_('form.token'); ?>
</form>

<script type="text/javascript">
<?php
$tasks = implode("','", $this->tasks);
JFactory::getDocument()->addScriptDeclaration(
<<<JS
jQuery(function()
{
doInstall();
Install.install(['Config']); //
window.location = window.location.replace(/installation\/index\?view=install/g) + '?view=remove'
});
function doInstall()
{
if (document.getElementById('install_progress') != null)
{
Install.install(['<?php echo implode("','", $this->tasks); ?>']);
}
else
{
(function(){doInstall();}).delay(500);
}
}
</script>
// function doInstall()
// {
// if (document.getElementById('install_progress'))
// {
// Install.install(['Database', 'Config']);
// }
// else
// {
// (function(){doInstall();}).delay(500);
// }
// }
JS
);
2 changes: 1 addition & 1 deletion installation/view/site/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,4 @@
<input type="hidden" name="task" value="site">
<input type="hidden" name="format" value="json">
<?php echo JHtml::_('form.token'); ?>
</form>
</form>
29 changes: 21 additions & 8 deletions installation/view/summary/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,24 @@
<?php echo JHtml::_('form.token'); ?>
</form>

<script type="text/javascript">
jQuery('input[name="jform[summary_email]"]').each(function(index, el) {
jQuery(el).parent().on('click', function() {
Install.toggle('email_passwords', 'summary_email', 0);
});
Install.toggle('email_passwords', 'summary_email', 1);
});
</script>
<?php
JFactory::getDocument()->addScriptDeclaration(
<<<JS
jQuery(function()
{
Install.submitform();
window.location = window.location.replace(/installation\/index\?view=install/g) + '?view=remove'
});
// function doInstall()
// {
// if (document.getElementById('install_progress'))
// {
// Install.install(['Database', 'Config']);
// }
// else
// {
// (function(){doInstall();}).delay(500);
// }
// }
JS
);

0 comments on commit faaca17

Please sign in to comment.