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'));
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;
$view->linkToProfessionalServices = StaticContainer::get('Piwik\\ProfessionalServices\\Advertising')->getPromoUrlForProfessionalServices($medium = 'App_InstallationFinished');
$output = $view->render();
return $output;
}