[-] BO : #PSFV-566 : BugFix - Add new CMS block
This commit is contained in:
@@ -157,10 +157,10 @@ class BlockCMSModel extends ObjectModel
|
|||||||
return Db::getInstance()->Insert_ID();
|
return Db::getInstance()->Insert_ID();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function insertCMSBlockShop($id_cms_block, $id_group_shop, $id_shop)
|
public static function insertCMSBlockShop($id_cms_block, $id_shop)
|
||||||
{
|
{
|
||||||
$sql = 'INSERT INTO `'._DB_PREFIX_.'cms_block_shop` (`id_cms_block`, `id_group_shop`, `id_shop`)
|
$sql = 'INSERT INTO `'._DB_PREFIX_.'cms_block_shop` (`id_cms_block`, `id_shop`)
|
||||||
VALUES('.(int)$id_cms_block.', '.(int)$id_group_shop.', '.(int)$id_shop.')';
|
VALUES('.(int)$id_cms_block.', '.(int)$id_shop.')';
|
||||||
|
|
||||||
Db::getInstance()->execute($sql);
|
Db::getInstance()->execute($sql);
|
||||||
|
|
||||||
@@ -521,11 +521,11 @@ class BlockCMSModel extends ObjectModel
|
|||||||
return $titles;
|
return $titles;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getCMSTitles($location, $id_group_shop = false, $id_shop = false)
|
public static function getCMSTitles($location, $id_shop = false)
|
||||||
{
|
{
|
||||||
$content = array();
|
$content = array();
|
||||||
$context = Context::getContext();
|
$context = Context::getContext();
|
||||||
$cmsCategories = BlockCMSModel::getCMSCategoriesByLocation($location, $id_group_shop, $id_shop);
|
$cmsCategories = BlockCMSModel::getCMSCategoriesByLocation($location, $id_shop);
|
||||||
|
|
||||||
if (is_array($cmsCategories) && count($cmsCategories))
|
if (is_array($cmsCategories) && count($cmsCategories))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -178,11 +178,12 @@ class BlockCms extends Module
|
|||||||
'label' => $this->l('CMS Blocks :'),
|
'label' => $this->l('CMS Blocks :'),
|
||||||
'name' => 'cms_blocks',
|
'name' => 'cms_blocks',
|
||||||
'values' => array(
|
'values' => array(
|
||||||
0 => BlockCMSModel::getCMSBlocksByLocation(BlockCMSModel::LEFT_COLUMN),
|
0 => BlockCMSModel::getCMSBlocksByLocation(BlockCMSModel::LEFT_COLUMN, Shop::getContextShopID()),
|
||||||
1 => BlockCMSModel::getCMSBlocksByLocation(BlockCMSModel::RIGHT_COLUMN))
|
1 => BlockCMSModel::getCMSBlocksByLocation(BlockCMSModel::RIGHT_COLUMN, Shop::getContextShopID()))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->fields_form[1]['form'] = array(
|
$this->fields_form[1]['form'] = array(
|
||||||
'tinymce' => true,
|
'tinymce' => true,
|
||||||
'legend' => array(
|
'legend' => array(
|
||||||
|
|||||||
Reference in New Issue
Block a user