// Remove bad _SQL_USE_SLAVE_ uses + normalize Db->executeS(), Db->execute() and Db->numRows() names
This commit is contained in:
@@ -35,12 +35,12 @@ function add_new_tab($className, $name, $id_parent, $returnId = false)
|
||||
}
|
||||
|
||||
if (!(int)Db::getInstance()->getValue('SELECT count(id_tab) FROM `'._DB_PREFIX_.'tab` WHERE `class_name` = \''.pSQL($className).'\' '))
|
||||
Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'tab` (`id_parent`, `class_name`, `module`, `position`) VALUES ('.(int)$id_parent.', \''.pSQL($className).'\', \'\',
|
||||
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'tab` (`id_parent`, `class_name`, `module`, `position`) VALUES ('.(int)$id_parent.', \''.pSQL($className).'\', \'\',
|
||||
(SELECT IFNULL(MAX(t.position),0)+ 1 FROM `'._DB_PREFIX_.'tab` t WHERE t.id_parent = '.(int)$id_parent.'))');
|
||||
|
||||
foreach (Language::getLanguages() AS $lang)
|
||||
{
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
INSERT IGNORE INTO `'._DB_PREFIX_.'tab_lang` (`id_lang`, `id_tab`, `name`)
|
||||
VALUES ('.(int)$lang['id_lang'].', (
|
||||
SELECT `id_tab`
|
||||
@@ -50,7 +50,7 @@ function add_new_tab($className, $name, $id_parent, $returnId = false)
|
||||
');
|
||||
}
|
||||
|
||||
Db::getInstance()->Execute('INSERT IGNORE INTO `'._DB_PREFIX_.'access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`)
|
||||
Db::getInstance()->execute('INSERT IGNORE INTO `'._DB_PREFIX_.'access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`)
|
||||
(SELECT `id_profile`, (
|
||||
SELECT `id_tab`
|
||||
FROM `'._DB_PREFIX_.'tab`
|
||||
|
||||
Reference in New Issue
Block a user