Current File : /home/pacjaorg/public_html/km/administrator/components/com_djcfimporter/djcfimporter.php |
<?php
/**
* @version 1.0
* @package DJCF-Importer
* @subpackage DJCF-Importer Component
* @copyright Copyright (C) 2010 DJ-Extensions.com LTD, All rights reserved.
* @license http://www.gnu.org/licenses GNU/GPL
* @author url: http://design-joomla.eu
* @author email contact@design-joomla.eu
* @developer Łukasz Ciastek - lukasz.ciastek@design-joomla.eu
*
*
* DJCF-Importer is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DJCF-Importer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DJCF-Importer. If not, see <http://www.gnu.org/licenses/>.
*
*/
defined('_JEXEC') or die('Restricted access');
$version = new JVersion;
if (version_compare($version->getShortVersion(), '2.5.5', '<')) {
$app = JFactory::getApplication();
$app->redirect(JRoute::_('index.php'), 'ERROR: DJCF-Importer requires at least Joomla! ver. 2.5.5. Older versions are not supported!', 'error');
}
if (!JFactory::getUser()->authorise('core.manage', 'com_djcfimporter')) {
return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}
if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}
$lang = JFactory::getLanguage();
if ($lang->get('lang') != 'en-GB') {
$lang = JFactory::getLanguage();
$lang->load('com_djcfimporter', JPATH_ADMINISTRATOR, 'en-GB', false, false);
$lang->load('com_djcfimporter', JPATH_COMPONENT_ADMINISTRATOR, 'en-GB', false, false);
$lang->load('com_djcfimporter', JPATH_ADMINISTRATOR, null, true, false);
$lang->load('com_djcfimporter', JPATH_COMPONENT_ADMINISTRATOR, null, true, false);
}
require_once JPATH_COMPONENT.'/helpers/djcfimporter.php';
// DJCF-Importer version no.
$db = JFactory::getDBO();
$db->setQuery("SELECT manifest_cache FROM #__extensions WHERE type='component' AND element='com_djcfimporter' LIMIT 1");
$version = json_decode($db->loadResult());
$version = (empty($version->version)) ? 'undefined' : $version->version;
define('DJCFIMPORTERVERSION', $version);
$year = JFactory::getDate()->format('Y');
define('DJCFIMPORTERFOOTER', '<div style="text-align: center; margin: 10px 0;">DJCF-Importer (ver. '.DJCFIMPORTERVERSION.'), © 2009-'.$year.' Copyright by <a target="_blank" href="http://dj-extensions.com">dj-extensions.com</a>, All Rights Reserved.<br /><a target="_blank" href="http://dj-extensions.com"><img src="'.JURI::base().'components/com_djcfimporter/assets/images/djextensions.png" alt="dj-extensions.com" style="margin-top: 20px;"/></a></div>');
jimport('joomla.utilities.string');
jimport('joomla.application.component.controller');
$version = new JVersion;
require_once(JPATH_COMPONENT.DS.'lib'.DS.'djlicense.php');
$document = JFactory::getDocument();
if ($document->getType() == 'html') {
if (version_compare($version->getShortVersion(), '3.0.0', '<')) {
$document->addStyleSheet(JURI::base().'components/com_djcfimporter/assets/css/adminstyle_legacy.css');
}
else {
$document->addStyleSheet(JURI::base().'components/com_djcfimporter/assets/css/adminstyle.css');
}
}
$controller = JControllerLegacy::getInstance('DJCFImporter');
$controller->execute(JFactory::getApplication()->input->get('task'));
$controller->redirect();