Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrammatiko committed May 29, 2017
1 parent 79eb336 commit 55eebdc
Show file tree
Hide file tree
Showing 4 changed files with 588 additions and 557 deletions.
66 changes: 32 additions & 34 deletions installation/controller/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ public function execute()
$defaultView = 'remove';
}

// Are we allowed to proceed?
$tmpModel = new InstallationModelSetup();

$vName = $this->getInput()->getWord('view', $defaultView);
$vFormat = $app->getDocument()->getType();
$lName = $this->getInput()->getWord('layout', 'default');
Expand All @@ -47,44 +50,39 @@ public function execute()
$this->getInput()->set('view', $defaultView);
}

switch ($vName)
if ($tmpModel->getOptions())
{
case 'preinstall':
$model = new InstallationModelSetup;
$checkOptions = false;
$options = $model->getOptions();

if ($model->getPhpOptionsSufficient())
{
$app->redirect('index.php');
}

break;

case 'languages':
case 'defaultlanguage':
$model = new InstallationModelLanguages;
$checkOptions = false;
$options = [];
if ($vName !== 'preinstall')
{
$app->redirect('index.php?view=preinstall');
}

break;

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

if (!$model->getPhpOptionsSufficient())
{
$app->redirect('index.php?view=preinstall');
}

break;
$vName = 'preinstall';
$model = new InstallationModelSetup;
}

if ($vName != $defaultView && ($checkOptions && empty($options)))
else
{
$app->redirect('index.php');
switch ($vName)
{
case 'languages':
case 'defaultlanguage':
$model = new InstallationModelLanguages;
$checkOptions = false;
$options = [];

break;

default:
$model = new InstallationModelSetup;
$checkOptions = true;

break;
}

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

// Register the layout paths for the view
Expand Down
23 changes: 6 additions & 17 deletions installation/template/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,14 @@
// Output as HTML5
$this->setHtml5(true);

// Load the JavaScript behaviors
JHtml::_('bootstrap.framework');

JHtml::_('behavior.core');
JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');
JHtml::_('behavior.core');

// Add installation js
JHtml::_('script', 'installation/template/js/installation.js', array('version' => 'auto'));

// Add Stylesheets
JHtml::_('bootstrap.loadCss', true, $this->direction);
JHtml::_('stylesheet', 'installation/template/css/template.css', array('version' => 'auto'));

// Load JavaScript message titles
Expand All @@ -55,16 +51,8 @@
<!DOCTYPE html>
<html lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
<head>
<jdoc:include type="head" />
<script>
jQuery(function()
{
// Delay instantiation after document.formvalidation and other dependencies loaded
window.setTimeout(function(){
window.Install = new Installation('container-installation', '<?php echo JUri::current(); ?>');
}, 500);
});
</script>
<jdoc:include type="metas" />
<jdoc:include type="styles" />
</head>
<body data-basepath="<?php echo JUri::root(true); ?>">
<?php // Header ?>
Expand All @@ -83,15 +71,16 @@
<jdoc:include type="message" />
<div id="javascript-warning">
<noscript>
<div class="alert alert-danger">
<div class="alert alert-danger text-center">
<?php echo JText::_('INSTL_WARNJAVASCRIPT'); ?>
</div>
</noscript>
</div>
<div id="container-installation">
<div id="container-installation" class="container-installation flex no-js">
<jdoc:include type="component" />
</div>
<hr>
</div>
<jdoc:include type="scripts" />
</body>
</html>
Loading

0 comments on commit 55eebdc

Please sign in to comment.