Ejemplo n.º 1
0
 /**
  * Returns the administrator information
  *
  * @param integer $id The administrator id
  * @access public
  * @return array
  */
 public static function getData($id)
 {
     global $lC_Database;
     $Qadmin = $lC_Database->query('select * from :table_administrators where id = :id');
     $Qadmin->bindTable(':table_administrators', TABLE_ADMINISTRATORS);
     $Qadmin->bindInt(':id', $id);
     $Qadmin->execute();
     $modules = array('access_modules' => array());
     $Qaccess = $lC_Database->query('select module from :table_administrators_access where administrators_id = :administrators_id');
     $Qaccess->bindTable(':table_administrators_access', TABLE_ADMINISTRATORS_ACCESS);
     $Qaccess->bindInt(':administrators_id', $id);
     $Qaccess->execute();
     while ($Qaccess->next()) {
         $modules['access_modules'][] = $Qaccess->value('module');
     }
     $languages_array = array();
     $languageAarray = array();
     foreach (lC_Languages_Admin::getIdNameArray() as $key => $value) {
         $languages_array[$value['languages_id']] = $value['name'];
     }
     $languageAarray['languagesArray'] = $languages_array;
     $data = array_merge($Qadmin->toArray(), $modules, $languageAarray);
     unset($modules);
     $Qaccess->freeResult();
     $Qadmin->freeResult();
     return $data;
 }
Ejemplo n.º 2
0
 public function __construct()
 {
     global $lC_Language, $breadcrumb_string;
     $this->_page_title = $lC_Language->get('heading_title');
     $breadcrumb_array = array(lc_link_object(lc_href_link_admin(FILENAME_DEFAULT, $this->_module), $lC_Language->get('heading_title')));
     if (!empty($_GET[$this->_module]) && is_numeric($_GET[$this->_module]) && lC_Languages_Admin::exists($_GET[$this->_module])) {
         $this->_page_title = lC_Languages_Admin::get($_GET[$this->_module], 'name');
         $this->_page_contents = 'groups.php';
         $breadcrumb_array[] = lc_link_object(lc_href_link_admin(FILENAME_DEFAULT, $this->_module . '=' . $this->_page_contents), $this->_page_title);
         if (isset($_GET['group']) && !empty($_GET['group']) && lC_Languages_Admin::isDefinitionGroup($_GET[$this->_module], $_GET['group'])) {
             $this->_page_title = $_GET['group'];
             $this->_page_contents = 'definitions.php';
             $breadcrumb_array[] = lc_link_object(lc_href_link_admin(FILENAME_DEFAULT, $this->_module . '=' . $this->_page_contents), $this->_page_title);
         }
     }
     $breadcrumb_string = '<ul>';
     foreach ($breadcrumb_array as $key => $value) {
         $breadcrumb_string .= '<li>' . lc_output_utf8_decoded($value) . '</li>';
     }
     $breadcrumb_string .= '</ul>';
     if (!isset($_GET['action'])) {
         $_GET['action'] = '';
     }
     if (!empty($_GET['action'])) {
         switch ($_GET['action']) {
             case 'import':
                 $lang = isset($_GET['language_import']) && $_GET['language_import'] != NULL ? $_GET['language_import'] : $_POST['language_import'];
                 $type = isset($_GET['import_type']) && $_GET['import_type'] != NULL ? $_GET['import_type'] : $_POST['import_type'];
                 try {
                     lC_Languages_Admin::import($lang, $type);
                 } catch (Exception $e) {
                     $_SESSION['error'] = true;
                     $_SESSION['errmsg'] = $lC_Language->get('ms_error_action_not_performed');
                 }
                 break;
             case 'export':
                 lC_Languages_Admin::export($_GET['lid'], $_POST['groups'], isset($_POST['include_data']) && $_POST['include_data'] == 'on');
                 break;
         }
     }
 }
Ejemplo n.º 3
0
 public static function batchDeleteDefinitions()
 {
     global $_module;
     $result = array();
     $deleted = lC_Languages_Admin::deleteDefinitions($_GET[$_module], $_GET['group'], $_GET['batch']);
     if ($deleted) {
         $result['rpcStatus'] = RPC_STATUS_SUCCESS;
     }
     echo json_encode($result);
 }
Ejemplo n.º 4
0
/**
  @package    catalog::admin::applications
  @author     Loaded Commerce
  @copyright  Copyright 2003-2014 Loaded Commerce, LLC
  @copyright  Portions Copyright 2003 osCommerce
  @copyright  Template built on Developr theme by DisplayInline http://themeforest.net/user/displayinline under Extended license 
  @license    https://github.com/loadedcommerce/loaded7/blob/master/LICENSE.txt
  @version    $Id: new.php v1.0 2013-08-08 datazen $
*/
$groupsArr = lC_Administrators_Admin::getAllGroups(true);
$groupsSelectArr = array();
foreach ($groupsArr as $jey => $value) {
    $groupsSelectArr[] = array('id' => $value['id'], 'text' => $value['name']);
}
include_once $lC_Vqmod->modCheck('includes/applications/languages/classes/languages.php');
$languagesArr = lC_Languages_Admin::getIdNameArray();
$languagesSelectArr = array();
foreach ($languagesArr as $key => $value) {
    $languagesSelectArr[] = array('id' => $value['languages_id'], 'text' => $value['name']);
}
$data = lC_Administrators_Admin::getData($_SESSION['admin']['id']);
$admin_language_default = $data['language_id'];
?>
<style>
#newAdmin { padding-bottom:20px; }
</style>
<script>
function newAdmin() {
  var accessLevel = '<?php 
echo $_SESSION['admin']['access'][$lC_Template->getModule()];
?>
Ejemplo n.º 5
0
 public static function import($file, $type)
 {
     global $lC_Database, $lC_Currencies;
     if (file_exists('../includes/languages/' . $file . '.xml')) {
         $lC_XML = new lC_XML(file_get_contents('../includes/languages/' . $file . '.xml'));
         $source = $lC_XML->toArray();
         $language = array('name' => $source['language']['data']['title'], 'code' => $source['language']['data']['code'], 'locale' => $source['language']['data']['locale'], 'charset' => $source['language']['data']['character_set'], 'date_format_short' => $source['language']['data']['date_format_short'], 'date_format_long' => $source['language']['data']['date_format_long'], 'time_format' => $source['language']['data']['time_format'], 'text_direction' => $source['language']['data']['text_direction'], 'currency' => $source['language']['data']['default_currency'], 'numeric_separator_decimal' => $source['language']['data']['numerical_decimal_separator'], 'numeric_separator_thousands' => $source['language']['data']['numerical_thousands_separator'], 'parent_language_code' => isset($source['language']['data']['parent_language_code']) ? $source['language']['data']['parent_language_code'] : '', 'parent_id' => 0);
         if (lC_Currencies_Admin::exists($language['currency']) === false) {
             $language['currency'] = DEFAULT_CURRENCY;
         }
         if (!empty($language['parent_language_code']) && self::exists($language['parent_language_code'])) {
             $language['parent_id'] = self::get($language['parent_language_code'], 'languages_id');
         }
         $definitions = array();
         if (isset($source['language']['definitions']['definition'])) {
             $definitions = $source['language']['definitions']['definition'];
             if (isset($definitions['key']) && isset($definitions['value']) && isset($definitions['group'])) {
                 $definitions = array(array('key' => $definitions['key'], 'value' => $definitions['value'], 'group' => $definitions['group']));
             }
         }
         unset($source);
         $error = false;
         $add_category_and_product_placeholders = true;
         $lC_Database->startTransaction();
         $language_id = self::get($language['code'], 'languages_id');
         if ($language_id !== false) {
             $add_category_and_product_placeholders = false;
             $Qlanguage = $lC_Database->query('update :table_languages set name = :name, code = :code, locale = :locale, charset = :charset, date_format_short = :date_format_short, date_format_long = :date_format_long, time_format = :time_format, text_direction = :text_direction, currencies_id = :currencies_id, numeric_separator_decimal = :numeric_separator_decimal, numeric_separator_thousands = :numeric_separator_thousands, parent_id = :parent_id where languages_id = :languages_id');
             $Qlanguage->bindInt(':languages_id', $language_id);
         } else {
             $Qlanguage = $lC_Database->query('insert into :table_languages (name, code, locale, charset, date_format_short, date_format_long, time_format, text_direction, currencies_id, numeric_separator_decimal, numeric_separator_thousands, parent_id) values (:name, :code, :locale, :charset, :date_format_short, :date_format_long, :time_format, :text_direction, :currencies_id, :numeric_separator_decimal, :numeric_separator_thousands, :parent_id)');
         }
         $Qlanguage->bindTable(':table_languages', TABLE_LANGUAGES);
         $Qlanguage->bindValue(':name', $language['name']);
         $Qlanguage->bindValue(':code', $language['code']);
         $Qlanguage->bindValue(':locale', $language['locale']);
         $Qlanguage->bindValue(':charset', $language['charset']);
         $Qlanguage->bindValue(':date_format_short', $language['date_format_short']);
         $Qlanguage->bindValue(':date_format_long', $language['date_format_long']);
         $Qlanguage->bindValue(':time_format', $language['time_format']);
         $Qlanguage->bindValue(':text_direction', $language['text_direction']);
         $Qlanguage->bindInt(':currencies_id', lC_Currencies_Admin::getData($language['currency'], 'currencies_id'));
         $Qlanguage->bindValue(':numeric_separator_decimal', $language['numeric_separator_decimal']);
         $Qlanguage->bindValue(':numeric_separator_thousands', $language['numeric_separator_thousands']);
         $Qlanguage->bindInt(':parent_id', $language['parent_id']);
         $Qlanguage->setLogging($_SESSION['module'], $language_id !== false ? $language_id : null);
         $Qlanguage->execute();
         if ($lC_Database->isError()) {
             $error = true;
         } else {
             if ($language_id === false) {
                 $language_id = $lC_Database->nextID();
             }
             $default_language_id = lC_Languages_Admin::get(DEFAULT_LANGUAGE, 'languages_id');
             if ($type == 'replace') {
                 $Qdel = $lC_Database->query('delete from :table_languages_definitions where languages_id = :languages_id');
                 $Qdel->bindTable(':table_languages_definitions', TABLE_LANGUAGES_DEFINITIONS);
                 $Qdel->bindInt(':languages_id', $language_id);
                 $Qdel->execute();
                 if ($lC_Database->isError()) {
                     $error = true;
                 }
             }
         }
         if ($error === false) {
             $lC_DirectoryListing = new lC_DirectoryListing('../includes/languages/' . $file);
             $lC_DirectoryListing->setRecursive(true);
             $lC_DirectoryListing->setIncludeDirectories(false);
             $lC_DirectoryListing->setAddDirectoryToFilename(true);
             $lC_DirectoryListing->setCheckExtension('xml');
             foreach ($lC_DirectoryListing->getFiles() as $files) {
                 $definitions = array_merge($definitions, lC_Language_Admin::extractDefinitions($file . '/' . $files['name']));
             }
             foreach ($definitions as $def) {
                 $insert = false;
                 $update = false;
                 if ($type == 'replace') {
                     $insert = true;
                 } else {
                     $Qcheck = $lC_Database->query('select definition_key, content_group from :table_languages_definitions where definition_key = :definition_key and languages_id = :languages_id and content_group = :content_group');
                     $Qcheck->bindTable(':table_languages_definitions', TABLE_LANGUAGES_DEFINITIONS);
                     $Qcheck->bindValue(':definition_key', $def['key']);
                     $Qcheck->bindInt(':languages_id', $language_id);
                     $Qcheck->bindValue(':content_group', $def['group']);
                     $Qcheck->execute();
                     if ($Qcheck->numberOfRows() > 0) {
                         if ($type == 'update') {
                             $update = true;
                         }
                     } elseif ($type == 'add') {
                         $insert = true;
                     }
                 }
                 if ($insert === true || $update === true) {
                     if ($insert === true) {
                         $Qdef = $lC_Database->query('insert into :table_languages_definitions (languages_id, content_group, definition_key, definition_value) values (:languages_id, :content_group, :definition_key, :definition_value)');
                     } else {
                         $Qdef = $lC_Database->query('update :table_languages_definitions set content_group = :content_group, definition_key = :definition_key, definition_value = :definition_value where definition_key = :definition_key and languages_id = :languages_id and content_group = :content_group');
                         $Qdef->bindValue(':definition_key', $def['key']);
                         $Qdef->bindValue(':content_group', $def['group']);
                     }
                     $Qdef->bindTable(':table_languages_definitions', TABLE_LANGUAGES_DEFINITIONS);
                     $Qdef->bindInt(':languages_id', $language_id);
                     $Qdef->bindValue(':content_group', $def['group']);
                     $Qdef->bindValue(':definition_key', $def['key']);
                     $Qdef->bindValue(':definition_value', $def['value']);
                     $Qdef->execute();
                     if ($lC_Database->isError()) {
                         $error = true;
                         break;
                     }
                 }
             }
         }
         if ($add_category_and_product_placeholders === true) {
             if ($error === false) {
                 $Qcategories = $lC_Database->query('select categories_id, categories_name, categories_menu_name, categories_blurb, categories_keyword from :table_categories_description where language_id = :language_id');
                 $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);
                 $Qcategories->bindInt(':language_id', $default_language_id);
                 $Qcategories->execute();
                 while ($Qcategories->next()) {
                     $Qinsert = $lC_Database->query('insert into :table_categories_description (categories_id, language_id, categories_name) values (:categories_id, :language_id, :categories_name)');
                     $Qinsert->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);
                     $Qinsert->bindInt(':categories_id', $Qcategories->valueInt('categories_id'));
                     $Qinsert->bindInt(':language_id', $language_id);
                     $Qinsert->bindValue(':categories_name', $Qcategories->value('categories_name'));
                     $Qinsert->bindValue(':categories_menu_name', $Qcategories->value('categories_menu_name'));
                     $Qinsert->bindValue(':categories_blurb', $Qcategories->value('categories_blurb'));
                     $Qinsert->bindValue(':categories_keyword', $Qcategories->value('categories_keyword'));
                     $Qinsert->execute();
                     if ($lC_Database->isError()) {
                         $error = true;
                         break;
                     }
                 }
             }
             if ($error === false) {
                 $Qproducts = $lC_Database->query('select products_id, products_name, products_description, products_keyword, products_tags, products_url from :table_products_description where language_id = :language_id');
                 $Qproducts->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
                 $Qproducts->bindInt(':language_id', $default_language_id);
                 $Qproducts->execute();
                 while ($Qproducts->next()) {
                     $Qinsert = $lC_Database->query('insert into :table_products_description (products_id, language_id, products_name, products_description, products_keyword, products_tags, products_url) values (:products_id, :language_id, :products_name, :products_description, :products_keyword, :products_tags, :products_url)');
                     $Qinsert->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
                     $Qinsert->bindInt(':products_id', $Qproducts->valueInt('products_id'));
                     $Qinsert->bindInt(':language_id', $language_id);
                     $Qinsert->bindValue(':products_name', $Qproducts->value('products_name'));
                     $Qinsert->bindValue(':products_description', $Qproducts->value('products_description'));
                     $Qinsert->bindValue(':products_keyword', $Qproducts->value('products_keyword'));
                     $Qinsert->bindValue(':products_tags', $Qproducts->value('products_tags'));
                     $Qinsert->bindValue(':products_url', $Qproducts->value('products_url'));
                     $Qinsert->execute();
                     if ($lC_Database->isError()) {
                         $error = true;
                         break;
                     }
                 }
             }
             if ($error === false) {
                 $Qattributes = $lC_Database->query('select products_id, value from :table_product_attributes where languages_id = :languages_id');
                 $Qattributes->bindTable(':table_product_attributes', TABLE_PRODUCT_ATTRIBUTES);
                 $Qattributes->bindInt(':languages_id', $default_language_id);
                 $Qattributes->execute();
                 while ($Qattributes->next()) {
                     $Qinsert = $lC_Database->query('insert into :table_product_attributes (products_id, languages_id, value) values (:products_id, :languages_id, :value)');
                     $Qinsert->bindTable(':table_product_attributes', TABLE_PRODUCT_ATTRIBUTES);
                     $Qinsert->bindInt(':products_id', $Qattributes->valueInt('products_id'));
                     $Qinsert->bindInt(':languages_id', $language_id);
                     $Qinsert->bindValue(':value', $Qattributes->value('value'));
                     $Qinsert->execute();
                     if ($lC_Database->isError()) {
                         $error = true;
                         break;
                     }
                 }
             }
             if ($error === false) {
                 $Qgroups = $lC_Database->query('select id, title, sort_order, module from :table_products_variants_groups where languages_id = :languages_id');
                 $Qgroups->bindTable(':table_products_variants_groups', TABLE_PRODUCTS_VARIANTS_GROUPS);
                 $Qgroups->bindInt(':languages_id', $default_language_id);
                 $Qgroups->execute();
                 while ($Qgroups->next()) {
                     $Qinsert = $lC_Database->query('insert into :table_products_variants_groups (id, languages_id, title, sort_order, module) values (:id, :languages_id, :title, :sort_order, :module)');
                     $Qinsert->bindTable(':table_products_variants_groups', TABLE_PRODUCTS_VARIANTS_GROUPS);
                     $Qinsert->bindInt(':id', $Qgroups->valueInt('id'));
                     $Qinsert->bindInt(':languages_id', $language_id);
                     $Qinsert->bindValue(':title', $Qgroups->value('title'));
                     $Qinsert->bindInt(':sort_order', $Qgroups->valueInt('sort_order'));
                     $Qinsert->bindValue(':module', $Qgroups->value('module'));
                     $Qinsert->execute();
                     if ($lC_Database->isError()) {
                         $error = true;
                         break;
                     }
                 }
             }
             if ($error === false) {
                 $Qvalues = $lC_Database->query('select id, products_variants_groups_id, title, sort_order from :table_products_variants_values where languages_id = :languages_id');
                 $Qvalues->bindTable(':table_products_variants_values', TABLE_PRODUCTS_VARIANTS_VALUES);
                 $Qvalues->bindInt(':languages_id', $default_language_id);
                 $Qvalues->execute();
                 while ($Qvalues->next()) {
                     $Qinsert = $lC_Database->query('insert into :table_products_variants_values (id, languages_id, products_variants_groups_id, title, sort_order) values (:id, :languages_id, :products_variants_groups_id, :title, :sort_order)');
                     $Qinsert->bindTable(':table_products_variants_values', TABLE_PRODUCTS_VARIANTS_VALUES);
                     $Qinsert->bindInt(':id', $Qvalues->valueInt('id'));
                     $Qinsert->bindInt(':languages_id', $language_id);
                     $Qinsert->bindInt(':products_variants_groups_id', $Qvalues->valueInt('products_variants_groups_id'));
                     $Qinsert->bindValue(':title', $Qvalues->value('title'));
                     $Qinsert->bindInt(':sort_order', $Qvalues->valueInt('sort_order'));
                     $Qinsert->execute();
                     if ($lC_Database->isError()) {
                         $error = true;
                         break;
                     }
                 }
             }
             if ($error === false) {
                 $Qmanufacturers = $lC_Database->query('select manufacturers_id, manufacturers_url from :table_manufacturers_info where languages_id = :languages_id');
                 $Qmanufacturers->bindTable(':table_manufacturers_info', TABLE_MANUFACTURERS_INFO);
                 $Qmanufacturers->bindInt(':languages_id', $default_language_id);
                 $Qmanufacturers->execute();
                 while ($Qmanufacturers->next()) {
                     $Qinsert = $lC_Database->query('insert into :table_manufacturers_info (manufacturers_id, languages_id, manufacturers_url) values (:manufacturers_id, :languages_id, :manufacturers_url)');
                     $Qinsert->bindTable(':table_manufacturers_info', TABLE_MANUFACTURERS_INFO);
                     $Qinsert->bindInt(':manufacturers_id', $Qmanufacturers->valueInt('manufacturers_id'));
                     $Qinsert->bindInt(':languages_id', $language_id);
                     $Qinsert->bindValue(':manufacturers_url', $Qmanufacturers->value('manufacturers_url'));
                     $Qinsert->execute();
                     if ($lC_Database->isError()) {
                         $error = true;
                         break;
                     }
                 }
             }
             if ($error === false) {
                 $Qstatus = $lC_Database->query('select orders_status_id, orders_status_name from :table_orders_status where language_id = :language_id');
                 $Qstatus->bindTable(':table_orders_status', TABLE_ORDERS_STATUS);
                 $Qstatus->bindInt(':language_id', $default_language_id);
                 $Qstatus->execute();
                 while ($Qstatus->next()) {
                     $Qinsert = $lC_Database->query('insert into :table_orders_status (orders_status_id, language_id, orders_status_name) values (:orders_status_id, :language_id, :orders_status_name)');
                     $Qinsert->bindTable(':table_orders_status', TABLE_ORDERS_STATUS);
                     $Qinsert->bindInt(':orders_status_id', $Qstatus->valueInt('orders_status_id'));
                     $Qinsert->bindInt(':language_id', $language_id);
                     $Qinsert->bindValue(':orders_status_name', $Qstatus->value('orders_status_name'));
                     $Qinsert->execute();
                     if ($lC_Database->isError()) {
                         $error = true;
                         break;
                     }
                 }
             }
             if ($error === false) {
                 $Qstatus = $lC_Database->query('select id, status_name from :table_orders_transactions_status where language_id = :language_id');
                 $Qstatus->bindTable(':table_orders_transactions_status', TABLE_ORDERS_TRANSACTIONS_STATUS);
                 $Qstatus->bindInt(':language_id', $default_language_id);
                 $Qstatus->execute();
                 while ($Qstatus->next()) {
                     $Qinsert = $lC_Database->query('insert into :table_orders_transactions_status (id, language_id, status_name) values (:id, :language_id, :status_name)');
                     $Qinsert->bindTable(':table_orders_transactions_status', TABLE_ORDERS_TRANSACTIONS_STATUS);
                     $Qinsert->bindInt(':id', $Qstatus->valueInt('id'));
                     $Qinsert->bindInt(':language_id', $language_id);
                     $Qinsert->bindValue(':status_name', $Qstatus->value('status_name'));
                     $Qinsert->execute();
                     if ($lC_Database->isError()) {
                         $error = true;
                         break;
                     }
                 }
             }
             if ($error === false) {
                 $Qstatus = $lC_Database->query('select id, title, css_key from :table_shipping_availability where languages_id = :languages_id');
                 $Qstatus->bindTable(':table_shipping_availability', TABLE_SHIPPING_AVAILABILITY);
                 $Qstatus->bindInt(':languages_id', $default_language_id);
                 $Qstatus->execute();
                 while ($Qstatus->next()) {
                     $Qinsert = $lC_Database->query('insert into :table_shipping_availability (id, languages_id, title, css_key) values (:id, :languages_id, :title, :css_key)');
                     $Qinsert->bindTable(':table_shipping_availability', TABLE_SHIPPING_AVAILABILITY);
                     $Qinsert->bindInt(':id', $Qstatus->valueInt('id'));
                     $Qinsert->bindInt(':languages_id', $language_id);
                     $Qinsert->bindValue(':title', $Qstatus->value('title'));
                     $Qinsert->bindValue(':css_key', $Qstatus->value('css_key'));
                     $Qinsert->execute();
                     if ($lC_Database->isError()) {
                         $error = true;
                         break;
                     }
                 }
             }
             if ($error === false) {
                 $Qstatus = $lC_Database->query('select weight_class_id, weight_class_key, weight_class_title from :table_weight_classes where language_id = :language_id');
                 $Qstatus->bindTable(':table_weight_classes', TABLE_WEIGHT_CLASS);
                 $Qstatus->bindInt(':language_id', $default_language_id);
                 $Qstatus->execute();
                 while ($Qstatus->next()) {
                     $Qinsert = $lC_Database->query('insert into :table_weight_classes (weight_class_id, weight_class_key, language_id, weight_class_title) values (:weight_class_id, :weight_class_key, :language_id, :weight_class_title)');
                     $Qinsert->bindTable(':table_weight_classes', TABLE_WEIGHT_CLASS);
                     $Qinsert->bindInt(':weight_class_id', $Qstatus->valueInt('weight_class_id'));
                     $Qinsert->bindValue(':weight_class_key', $Qstatus->value('weight_class_key'));
                     $Qinsert->bindInt(':language_id', $language_id);
                     $Qinsert->bindValue(':weight_class_title', $Qstatus->value('weight_class_title'));
                     $Qinsert->execute();
                     if ($lC_Database->isError()) {
                         $error = true;
                         break;
                     }
                 }
             }
             if ($error === false) {
                 $Qgroup = $lC_Database->query('select id, title, code, size_width, size_height, force_size from :table_products_images_groups where language_id = :language_id');
                 $Qgroup->bindTable(':table_products_images_groups', TABLE_PRODUCTS_IMAGES_GROUPS);
                 $Qgroup->bindInt(':language_id', $default_language_id);
                 $Qgroup->execute();
                 while ($Qgroup->next()) {
                     $Qinsert = $lC_Database->query('insert into :table_products_images_groups (id, language_id, title, code, size_width, size_height, force_size) values (:id, :language_id, :title, :code, :size_width, :size_height, :force_size)');
                     $Qinsert->bindTable(':table_products_images_groups', TABLE_PRODUCTS_IMAGES_GROUPS);
                     $Qinsert->bindInt(':id', $Qgroup->valueInt('id'));
                     $Qinsert->bindInt(':language_id', $language_id);
                     $Qinsert->bindValue(':title', $Qgroup->value('title'));
                     $Qinsert->bindValue(':code', $Qgroup->value('code'));
                     $Qinsert->bindInt(':size_width', $Qgroup->value('size_width'));
                     $Qinsert->bindInt(':size_height', $Qgroup->value('size_height'));
                     $Qinsert->bindInt(':force_size', $Qgroup->value('force_size'));
                     $Qinsert->execute();
                     if ($lC_Database->isError()) {
                         $error = true;
                         break;
                     }
                 }
             }
             // added for permalinks
             if ($error === false) {
                 $Qpermalinks = $lC_Database->query('select * from :table_permalinks where language_id = :language_id');
                 $Qpermalinks->bindTable(':table_permalinks', TABLE_PERMALINKS);
                 $Qpermalinks->bindInt(':language_id', $default_language_id);
                 $Qpermalinks->execute();
                 while ($Qpermalinks->next()) {
                     $Qinsert = $lC_Database->query('insert into :table_permalinks (item_id, language_id, type, query, permalink) values (:item_id, :language_id, :type, :query, :permalink)');
                     $Qinsert->bindTable(':table_permalinks', TABLE_PERMALINKS);
                     $Qinsert->bindInt(':item_id', $Qpermalinks->valueInt('item_id'));
                     $Qinsert->bindInt(':language_id', $language_id);
                     $Qinsert->bindInt(':type', $Qpermalinks->valueInt('type'));
                     $Qinsert->bindValue(':query', $Qpermalinks->value('query'));
                     $Qinsert->bindValue(':permalink', $Qpermalinks->value('permalink'));
                     $Qinsert->execute();
                     if ($lC_Database->isError()) {
                         $error = true;
                         break;
                     }
                 }
             }
         }
     }
     if ($error === false) {
         $lC_Database->commitTransaction();
         lC_Cache::clear('languages');
         return true;
     } else {
         $lC_Database->rollbackTransaction();
     }
     return false;
 }