Example #1
0
    public function uninstall($adapter)
    {
        $params = JComponentHelper::getParams('com_joomleague');
        //Also uninstall db tables of JoomLeague?
        $uninstallDB = $params->get('cfg_drop_joomleague_tables_when_uninstalled', 0);
        if ($uninstallDB) {
            echo JText::_('Also removing database tables of JoomLeague');
            include_once JPATH_ADMINISTRATOR . '/models/databasetools.php';
            JoomleagueModelDatabaseTools::dropJoomLeagueTables();
        } else {
            echo JText::_('Database tables of JoomLeague are not removed');
        }
        ?>
		<div class="header">JoomLeague has been removed from your system!</div>
		<p>To completely remove Joomleague from your system, be sure to also
			uninstall the JoomLeague modules, plugins and languages.</p>

		<?php 
        return true;
    }
        echo JText::_('Update may not be completely sucessfull as we require JoomLeague-MYSQL-tables according to the release 0.93!');
        echo '</span><br />';
        echo '<span style="color:green">';
        echo JText::sprintf('It would be better to update your JoomLeague installation to v0.93 before you update to JoomLeague %1$s!', '<b>' . $version . '</b>');
        echo '</span><br /><br />';
        echo '<span style="color:red">' . JText::_('COM_JOOMLEAGUE_DB_UPDATE_DANGER') . '</span><br /><br />';
        echo '<span style="color:red">' . JText::_('PLEASE use this script ONLY IF you REALLY know what you do!!!') . '</span><br />';
    }
}
if (getUpdatePart() == 2) {
    echo UpdateTemplateMasters() . '<br />';
    echo '<hr>';
}
if (getUpdatePart() == 3) {
    require_once JPATH_COMPONENT . '/models/databasetools.php';
    JoomleagueModelDatabaseTools::migratePicturePath();
    echo '<hr>';
}
if (getUpdatePart() == 4) {
    echo '<p>';
    echo '<h3>';
    echo JText::_('COM_JOOMLEAGUE_DB_UPDATE_MIGRATE_ASSETS');
    echo '</h3>';
    echo '</p>';
    require_once 'jl_migrateAssets.php';
}
if (getUpdatePart() == $totalUpdateParts) {
    echo '<br />';
    echo '<hr>';
    echo '<p><h1 style="text-align:center; color:green; ">';
    echo JText::_('COM_JOOMLEAGUE_DB_UPDATE_CONGRATULATIONS');
$totalUpdateParts = 2;
setUpdatePart();
if (getUpdatePart() < $totalUpdateParts) {
    echo '<p><b>';
    echo JText::sprintf('Please remember that this update routine has totally %1$s update steps!', $totalUpdateParts) . '</b><br />';
    echo JText::_('So please go to the bottom of this page to check if there are errors and more update steps to do!');
    echo '</p>';
    echo '<p style="color:red; font-weight:bold; ">';
    echo JText::_('We recommend a database backup before the update!!!') . '<br />';
    echo '</p>';
    echo '<hr>';
}
if (getUpdatePart() == $totalUpdateParts) {
    echo '<hr />';
    require_once JPATH_ADMINISTRATOR . '/components/com_joomleague/models/databasetools.php';
    echo JoomleagueModelDatabaseTools::ImportTables();
    echo '<br /><center><hr />';
    echo JText::sprintf('Memory Limit is %1$s', ini_get('memory_limit')) . '<br />';
    echo JText::sprintf('Memory Peak Usage was %1$s Bytes', number_format(memory_get_peak_usage(true), 0, '', '.')) . '<br />';
    echo JText::sprintf('Time Limit is %1$s seconds', ini_get('max_execution_time')) . '<br />';
    $mtime = microtime();
    $mtime = explode(" ", $mtime);
    $mtime = $mtime[1] + $mtime[0];
    $endtime = $mtime;
    $totaltime = $endtime - $starttime;
    echo JText::sprintf('This page was created in %1$s seconds', $totaltime);
    echo '<hr /></center>';
    setUpdatePart(0);
} else {
    echo '<input type="button" onclick="document.body.innerHTML=\'please wait...\';location.reload(true)" value="';
    echo JText::sprintf('Click here to do step %1$s of %2$s steps to finish the update.', getUpdatePart() + 1, $totalUpdateParts);