/** * 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; }
/** * Customize the Installation "default settings" form. * * @param FormDefaultSettings $form */ public function installationFormInit(FormDefaultSettings $form) { $form->addElement('checkbox', 'do_not_track', null, array('content' => '<div class="form-help">' . Piwik::translate('PrivacyManager_DoNotTrack_EnabledMoreInfo') . '</div> ' . Piwik::translate('PrivacyManager_DoNotTrack_Enable'))); $form->addElement('checkbox', 'anonymise_ip', null, array('content' => '<div class="form-help">' . Piwik::translate('PrivacyManager_AnonymizeIpExtendedHelp', array('213.34.51.91', '213.34.0.0')) . '</div> ' . Piwik::translate('PrivacyManager_AnonymizeIpInlineHelp'))); // default values $form->addDataSource(new HTML_QuickForm2_DataSource_Array(array('do_not_track' => $this->dntChecker->isActive(), 'anonymise_ip' => IPAnonymizer::isActive()))); }