Beispiel #1
0
function xmapUploadPlugin()
{
    $lang =& JFactory::getLanguage();
    $lang->load('com_installer', JPATH_ADMINISTRATOR);
    $installerModel = new InstallerModelInstall();
    // Get an installer instance
    $installer =& JInstaller::getInstance();
    $xmapInstaller = new XmapPluginInstaller($installer);
    /* Fix for a small bug on Joomla on PHP 4 */
    if (version_compare(PHP_VERSION, '5.0.0', '<')) {
        // We use eval to avoid PHP warnings on PHP>=5 versions
        eval("\$installer->setAdapter('xmap_ext',&\$xmapInstaller);");
    } else {
        $installer->setAdapter('xmap_ext', $xmapInstaller);
    }
    $xmapInstaller->parent =& $installer;
    $install->_adapters['xmap_ext'] =& $xmapXinstaller;
    /* End of the fix for PHP <= 4 */
    if ($installerModel->install()) {
        XmapAdminHtml::showInstallMessage(_XMAP_EXT_INSTALLED_MSG, '', 'index.php?option=com_xmap');
    } else {
        XmapAdminHtml::showInstallFailedMessage(_XMAP_EXT_INSTALLED_MSG, '', 'index.php?option=com_xmap');
    }
}