/** * Display the view */ public function display($tpl = null) { $this->canDo = VMMigrateHelperVMMigrate::getActions(); $app = JFactory::getApplication(); $params = JComponentHelper::getParams('com_vmmigrate'); $jversion = new JVersion(); $joomla_version_dest = $jversion->getShortVersion(); if ($params->get('show_spash_config', 1)) { $app->enqueueMessage(JText::_('VMMIGRATE_PLEASE_CONFIGURE'), 'warning'); } else { //print_a($helper->isValidConnection()); $valid_database_connection = VMMigrateHelperDatabase::isValidConnection(); if (!$valid_database_connection) { if (version_compare($joomla_version_dest, 3, 'gt')) { } else { $app->enqueueMessage(JText::_('VMMIGRATE_SOURCE_DATABASE_CONNECTION_WARNING'), 'warning'); } //$exception = new JException(JText::_('VMMIGRATE_SOURCE_DATABASE_CONNECTION_WARNING'),100,E_WARNING); //JError::throwError($exception); } else { //$readonlyuser = VMMigrateHelperDatabase::isReadonlyUser(); //if (!$readonlyuser) { // $exception = new JException(JText::_('VMMIGRATE_SOURCE_DATABASE_RIGHTS_WARNING'),100,E_NOTICE); // JError::throwError($exception); //} $validPrefix = VMMigrateHelperDatabase::isValidPrefix(); if (!$validPrefix) { $app->enqueueMessage(JText::_('VMMIGRATE_SOURCE_DATABASE_PREFIX_WARNING'), 'warning'); //$exception = new JException(JText::_('VMMIGRATE_SOURCE_DATABASE_PREFIX_WARNING'),100,E_WARNING); //JError::throwError($exception); } } $valid_source_path = VMMigrateHelperFilesystem::isValidConnection(); if (!$valid_source_path) { $app->enqueueMessage(JText::_('VMMIGRATE_SOURCE_PATH_STATUS_WARNING'), 'warning'); //$exception = new JException(JText::_('VMMIGRATE_SOURCE_PATH_STATUS_WARNING'),100,E_WARNING); //JError::throwError($exception); } if (JDEBUG) { $app->enqueueMessage(JText::_('VMMIGRATE_TURN_OFF_DEBUG'), 'warning'); //$exception = new JException(JText::_('VMMIGRATE_TURN_OFF_DEBUG'),100,E_NOTICE); //JError::throwError($exception); } } VMMigrateHelperVMMigrate::loadCssJs(); $this->extensions = VMMigrateHelperVMMigrate::GetMigrators(); $this->steps = VMMigrateHelperVMMigrate::GetMigratorsSteps($this->extensions); if ($params->get('show_not_pro', 0)) { $this->demoextensions = VMMigrateHelperVMMigrate::GetMigratorsDemo(); $this->demosteps = VMMigrateHelperVMMigrate::GetMigratorsDemoSteps(); } $this->demoextensions = array(); $this->isPro = VMMigrateHelperVMMigrate::GetMigratorsPro($this->extensions); $this->addToolbar(); VMMigrateHelperVMMigrate::setJoomlaVersionLayout($this); $this->extensionsFeed = VMMigrateHelperVMMigrate::getExtensionsRssFeed(); parent::display($tpl); }
public static function getInstance() { if (!is_object(self::$_instance)) { self::$_instance = new VMMigrateHelperFilesystem(); } else { //We store in UTC and use here of course also UTC $jnow = JFactory::getDate(); self::$_instance->_now = $jnow->toSql(); } return self::$_instance; }
function __construct($config = array()) { parent::__construct($config); $config = JFactory::getConfig(); $this->params = JComponentHelper::getParams('com_vmmigrate'); //$source_path = $this->params->get('source_path'); //$this->source_path = rtrim( $source_path, "/" ); $this->destination_db = JFactory::getDBO(); $this->source_db = VMMigrateHelperDatabase::getSourceDb(); $this->source_filehelper = VMMigrateHelperFilesystem::getInstance(); $this->joomla_version_src = self::getJoomlaVersionSource(); $this->joomla_version = $this->joomla_version_src; $this->joomla_version_dest = self::getJoomlaVersionDest(); $this->baseLanguage = $this->getDefaultLanguage(); if (self::isInstalledSource('com_joomfish')) { $this->joomfishInstalled = true; $langs = $this->getAdditionalLanguages(); $this->additionalLanguages = $langs ? $langs : array(); } else { $this->joomfishInstalled = false; $this->additionalLanguages = array(); } }