/**
* Installation Step 8: Finished!
*/
public function finished()
{
$this->checkPiwikIsNotInstalled();
$view = new View('@Installation/finished', $this->getInstallationSteps(), __FUNCTION__);
$form = new FormDefaultSettings();
/**
* Triggered on initialization of the form to customize default Piwik settings (at the end of the installation process).
*
* @param \Piwik\Plugins\Installation\FormDefaultSettings $form
*/
Piwik::postEvent('Installation.defaultSettingsForm.init', array($form));
$form->addElement('submit', 'submit', array('value' => Piwik::translate('General_ContinueToPiwik') . ' ยป', 'class' => 'btn btn-lg'));
if ($form->validate()) {
try {
/**
* Triggered on submission of the form to customize default Piwik settings (at the end of the installation process).
*
* @param \Piwik\Plugins\Installation\FormDefaultSettings $form
*/
Piwik::postEvent('Installation.defaultSettingsForm.submit', array($form));
$this->markInstallationAsCompleted();
Url::redirectToUrl('index.php');
} catch (Exception $e) {
$view->errorMessage = $e->getMessage();
}
}
$view->addForm($form);
$view->showNextStep = false;
$output = $view->render();
return $output;
}