Skip to content

Commit

Permalink
Bootstrap the installation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter van Westen authored and realityking committed Aug 16, 2012
1 parent 96f4e03 commit 9b3bd99
Show file tree
Hide file tree
Showing 104 changed files with 2,707 additions and 2,700 deletions.
28 changes: 27 additions & 1 deletion installation/controller.php
Expand Up @@ -43,7 +43,7 @@ public function display($cachable = false, $urlparams = false)
}
else
{
$default_view = 'language';
$default_view = 'site';
}

$vName = $this->input->getWord('view', $default_view);
Expand All @@ -59,6 +59,29 @@ public function display($cachable = false, $urlparams = false)
if ($view)
{
$model = $this->getModel('Setup', 'InstallationModel', array('dbo' => null));
$sufficient = $model->getPhpOptionsSufficient();

switch ($vName)
{
case 'preinstall':
$checkOptions = false;
if ($sufficient) {
$this->setRedirect('index.php');
}
break;
default:
$checkOptions = true;
if (!$sufficient) {
$this->setRedirect('index.php?view=preinstall');
}
break;
}

$options = $model->getOptions();
if ($vName != $default_view && ($checkOptions && empty($options)))
{
$this->setRedirect('index.php');
}

// Push the model into the view (as default).
$view->setModel($model, true);
Expand All @@ -67,6 +90,9 @@ public function display($cachable = false, $urlparams = false)
// Push document object into the view.
$view->document = $document;

// Include the component HTML helpers.
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');

$view->display();
}

Expand Down

0 comments on commit 9b3bd99

Please sign in to comment.