/** * A method to create a simple html page that shows a custom text and a navigation button. * This should be used to show notices or errors during installation or update. * @param string $message A (html) message that should be displayed. * @param string $url The url to which the user should be navigated if he clicks the button. * @param string $buttonText The text of the button. * @param string $buttonIcon The icon of the button. * @param bool $update */ function showNotice($message, $url, $buttonText, $buttonIcon, $update = false) { global $gL10n; $onClickText = ''; // show dialog with success notification $form = new HtmlFormInstallation('installation-form', $url); if ($update) { $form->setUpdateModus(); } if ($buttonText === $gL10n->get('INS_UPDATE_DATABASE')) { $onClickText = $gL10n->get('INS_DATABASE_IS_UPDATED'); } $form->setFormDescription($message); $form->addSubmitButton('next_page', $buttonText, array('icon' => $buttonIcon, 'onClickText' => $onClickText)); $form->show(); exit; }
// reread component because in version 3.0 the component will be created within the update $componentUpdateHandle = new ComponentUpdate($gDb); $componentUpdateHandle->readDataByColumns(array('com_type' => 'SYSTEM', 'com_name_intern' => 'CORE')); $componentUpdateHandle->setTargetVersion(ADMIDIO_VERSION); $componentUpdateHandle->update(); } if ($gDbType === 'mysql') { // activate foreign key checks, so database is consistent $sql = 'SET foreign_key_checks = 1 '; $gDb->query($sql); } // nach dem Update erst einmal bei Sessions das neue Einlesen des Organisations- und Userobjekts erzwingen $sql = 'UPDATE ' . TBL_SESSIONS . ' SET ses_renew = 1 '; $gDb->query($sql); // create an installation unique cookie prefix and remove special characters $gCookiePraefix = 'ADMIDIO_' . $g_organization . '_' . $g_adm_db . '_' . $g_tbl_praefix; $gCookiePraefix = strtr($gCookiePraefix, ' .,;:[]', '_______'); // start php session and remove session object with all data, so that // all data will be read after the update session_name($gCookiePraefix . '_PHP_ID'); session_start(); unset($_SESSION['gCurrentSession']); // show notice that update was successful $form = new HtmlFormInstallation('installation-form', 'http://www.admidio.org/index.php?page=donate'); $form->setFormDescription($gL10n->get('INS_UPDATE_TO_VERSION_SUCCESSFUL', ADMIDIO_VERSION_TEXT) . '<br /><br />' . $gL10n->get('INS_SUPPORT_FURTHER_DEVELOPMENT'), '<div class="alert alert-success form-alert"><span class="glyphicon glyphicon-ok"></span><strong>' . $gL10n->get('INS_UPDATING_WAS_SUCCESSFUL') . '</strong></div>'); $form->openButtonGroup(); $form->addSubmitButton('next_page', $gL10n->get('SYS_DONATE'), array('icon' => 'layout/money.png')); $form->addButton('main_page', $gL10n->get('SYS_LATER'), array('icon' => 'layout/application_view_list.png', 'link' => '../index.php')); $form->closeButtonGroup(); $form->show(); }