Exemplo n.º 1
0
* @package      Jshopping
* @copyright    Copyright (C) 2010 webdesigner-profi.de. All rights reserved.
* @license      GNU/GPL
*/
defined('_JEXEC') or die('Restricted access');
if (!JFactory::getUser()->authorise('core.manage', 'com_jshopping')) {
    return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}
JTable::addIncludePath(JPATH_COMPONENT_SITE . '/tables');
require_once JPATH_COMPONENT_SITE . "/lib/factory.php";
require_once JPATH_COMPONENT_ADMINISTRATOR . '/functions.php';
$ajax = JRequest::getInt('ajax');
$admin_load_user_id = JRequest::getInt('admin_load_user_id');
$adminlang = JFactory::getLanguage();
if ($admin_load_user_id) {
    JSFactory::setLoadUserId($admin_load_user_id);
}
if (!JRequest::getVar("js_nolang")) {
    JSFactory::loadAdminLanguageFile();
}
$db = JFactory::getDBO();
$jshopConfig = JSFactory::getConfig();
$jshopConfig->setLang($jshopConfig->getFrontLang());
if ($jshopConfig->adminLanguage != $adminlang->getTag()) {
    $config = new jshopConfig($db);
    $config->id = $jshopConfig->load_id;
    $config->adminLanguage = $adminlang->getTag();
    if (!$config->store()) {
        JError::raiseWarning("", _JSHOP_ERROR_SAVE_DATABASE);
        return 0;
    }