Example #1
0
 public function install()
 {
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     require_once JPATH_ADMINISTRATOR . '/components/com_installer/models/install.php';
     $lang = JFactory::getLanguage();
     $lang->load('com_installer');
     $model = new InstallerModelInstall();
     if ($model->install()) {
         $cache = JFactory::getCache('mod_menu');
         $cache->clean();
     }
     $app = JFactory::getApplication();
     $redirect_url = $app->getUserState('com_installer.redirect_url');
     if (empty($redirect_url)) {
         $redirect_url = JRoute::_('index.php?option=com_judownload&view=plugins', false);
     } else {
         $app->setUserState('com_installer.redirect_url', '');
         $app->setUserState('com_installer.message', '');
         $app->setUserState('com_installer.extension_message', '');
     }
     $this->setRedirect($redirect_url);
 }
Example #2
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');
    }
}
Example #3
0
 /**
  * Installing default by press install button
  * @run redirect
  **/
 function installDefaultTemplate()
 {
     global $option, $mainframe;
     $db =& JFactory::getDBO();
     $lang =& JFactory::getLanguage();
     $lang->load('com_installer', JPATH_BASE);
     /* Install Plugin */
     require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_installer' . DS . 'models' . DS . 'install.php';
     $m = new InstallerModelInstall();
     $r = $m->install();
     if ($r) {
         // Activate Template as default
         JYAML::activateTemplate('hm_yaml', false);
     }
     $mainframe->redirect(JURI::base() . 'index.php?option=' . $option);
 }