[*] MO : BlockCMS module 1.5 compliant + translations
This commit is contained in:
@@ -43,6 +43,11 @@ class HelperCore
|
||||
public $context;
|
||||
public $toolbar_fix = false;
|
||||
|
||||
/**
|
||||
* @var Module
|
||||
*/
|
||||
public $module;
|
||||
|
||||
/** @var string Helper tpl folder */
|
||||
public $base_folder;
|
||||
|
||||
@@ -83,9 +88,13 @@ class HelperCore
|
||||
{
|
||||
if ($this->context->controller instanceof ModuleAdminController)
|
||||
$override_tpl_path = $this->context->controller->getTemplatePath().$this->override_folder.$this->base_folder.$tpl_name;
|
||||
else if ($this->module)
|
||||
$override_tpl_path = _PS_MODULE_DIR_.$this->module->name.'/views/templates/admin/_configure/'.$this->override_folder.$this->base_folder.$tpl_name;
|
||||
else
|
||||
$override_tpl_path = $this->context->smarty->getTemplateDir(0).'controllers/'.$this->override_folder.$this->base_folder.$tpl_name;
|
||||
}
|
||||
else if ($this->module)
|
||||
$override_tpl_path = _PS_MODULE_DIR_.$this->module->name.'/views/templates/admin/_configure/'.$this->base_folder.$tpl_name;
|
||||
|
||||
if (isset($override_tpl_path) && file_exists($override_tpl_path))
|
||||
return $this->context->smarty->createTemplate($override_tpl_path, $this->context->smarty);
|
||||
|
||||
+33
-14
@@ -25,13 +25,15 @@
|
||||
*/
|
||||
|
||||
$(document).ready(function() {
|
||||
initTableDnD();
|
||||
})
|
||||
initTableDnD();
|
||||
});
|
||||
|
||||
function initTableDnD(table)
|
||||
{
|
||||
if (typeof(table) == 'undefined')
|
||||
if (typeof(table) == 'undefined') {
|
||||
table = 'table.tableDnD';
|
||||
}
|
||||
|
||||
$(table).tableDnD({
|
||||
onDragStart: function(table, row) {
|
||||
originalOrder = $.tableDnD.serialize();
|
||||
@@ -64,15 +66,31 @@ function initTableDnD(table)
|
||||
way: way,
|
||||
token: token
|
||||
};
|
||||
if (table.id == 'cms')
|
||||
params = {
|
||||
ajaxCMSPositions: true,
|
||||
id_cms_category: ids[1],
|
||||
id_cms: ids[2],
|
||||
way: way,
|
||||
token: token
|
||||
};
|
||||
if (come_from == 'AdminModulesPositions')
|
||||
if (table.id == 'cms')
|
||||
params = {
|
||||
ajaxCMSPositions: true,
|
||||
id_cms_category: ids[1],
|
||||
id_cms: ids[2],
|
||||
way: way,
|
||||
token: token
|
||||
};
|
||||
if (table.id == 'cms_block_0')
|
||||
params = {
|
||||
ajaxCMSBlockPositions: true,
|
||||
id_cms_block: ids[1],
|
||||
position: ids[2],
|
||||
way: way,
|
||||
token: token
|
||||
};
|
||||
if (table.id == 'cms_block_1')
|
||||
params = {
|
||||
ajaxCMSBlockPositions: true,
|
||||
id_cms_block: ids[1],
|
||||
position: ids[2],
|
||||
way: way,
|
||||
token: token
|
||||
};
|
||||
if (come_from == 'AdminModulesPositions')
|
||||
params = {
|
||||
ajaxModulesPositions: true,
|
||||
id_hook: ids[0],
|
||||
@@ -133,7 +151,7 @@ function initTableDnD(table)
|
||||
token: token
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
async: false,
|
||||
@@ -195,7 +213,8 @@ function initTableDnD(table)
|
||||
tableDrag.children('tbody').children('tr:not(".nodrag"):odd').addClass('alt_row');
|
||||
tableDrag.children('tbody').children('tr:not(".nodrag"):even').addClass('not_alt_row');
|
||||
tableDrag.children('tbody').children('tr').children('td.dragHandle').children('a:hidden').show();
|
||||
if (alternate) {
|
||||
|
||||
if (alternate) {
|
||||
tableDrag.children('tbody').children('tr').children('td.dragHandle:first').children('a:odd').hide();
|
||||
tableDrag.children('tbody').children('tr').children('td.dragHandle:last').children('a:even').hide();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,545 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 12476 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
class BlockCMSModel extends ObjectModel
|
||||
{
|
||||
public $id_cms_block;
|
||||
|
||||
public $id_cms_category;
|
||||
|
||||
public $location;
|
||||
|
||||
public $position;
|
||||
|
||||
public $display_store;
|
||||
|
||||
const LEFT_COLUMN = 0;
|
||||
const RIGHT_COLUMN = 1;
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
*/
|
||||
public static $definition = array(
|
||||
'table' => 'cms_block',
|
||||
'primary' => 'id_customer',
|
||||
'fields' => array(
|
||||
'id_cms_block' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true),
|
||||
'id_cms_category' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true),
|
||||
'location' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true),
|
||||
'position' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true),
|
||||
'display_store' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true)
|
||||
),
|
||||
);
|
||||
|
||||
public static function createTables()
|
||||
{
|
||||
return (
|
||||
BlockCMSModel::createCMSBlockTable() &&
|
||||
BlockCMSModel::createCMSBlockLangTable() &&
|
||||
BlockCMSModel::createCMSBlockPageTable() &&
|
||||
BlockCMSModel::createCMSBlockShopTable()
|
||||
);
|
||||
}
|
||||
|
||||
public static function dropTables()
|
||||
{
|
||||
$sql = 'DROP TABLE
|
||||
`'._DB_PREFIX_.'cms_block`,
|
||||
`'._DB_PREFIX_.'cms_block_page`,
|
||||
`'._DB_PREFIX_.'cms_block_lang`,
|
||||
`'._DB_PREFIX_.'cms_block_shop`';
|
||||
|
||||
return Db::getInstance()->execute($sql);
|
||||
}
|
||||
|
||||
public static function createCMSBlockTable()
|
||||
{
|
||||
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'cms_block`(
|
||||
`id_cms_block` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_cms_category` int(10) unsigned NOT NULL,
|
||||
`location` tinyint(1) unsigned NOT NULL,
|
||||
`position` int(10) unsigned NOT NULL default \'0\',
|
||||
`display_store` tinyint(1) unsigned NOT NULL default \'1\',
|
||||
PRIMARY KEY (`id_cms_block`)
|
||||
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
|
||||
|
||||
return Db::getInstance()->execute($sql);
|
||||
}
|
||||
|
||||
public static function createCMSBlockLangTable()
|
||||
{
|
||||
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'cms_block_lang`(
|
||||
`id_cms_block` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`name` varchar(40) NOT NULL default \'\',
|
||||
PRIMARY KEY (`id_cms_block`, `id_lang`)
|
||||
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
|
||||
|
||||
return Db::getInstance()->execute($sql);
|
||||
}
|
||||
|
||||
public static function createCMSBlockPageTable()
|
||||
{
|
||||
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'cms_block_page`(
|
||||
`id_cms_block_page` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_cms_block` int(10) unsigned NOT NULL,
|
||||
`id_cms` int(10) unsigned NOT NULL,
|
||||
`is_category` tinyint(1) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_cms_block_page`)
|
||||
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
|
||||
|
||||
return Db::getInstance()->execute($sql);
|
||||
}
|
||||
|
||||
public static function createCMSBlockShopTable()
|
||||
{
|
||||
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'cms_block_shop` (
|
||||
`id_cms_block` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_shop` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_cms_block`, `id_shop`)
|
||||
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
|
||||
|
||||
return Db::getInstance()->execute($sql);
|
||||
}
|
||||
|
||||
public static function insertCMSBlock($id_category, $location, $position, $display_store)
|
||||
{
|
||||
$sql = 'INSERT INTO `'._DB_PREFIX_.'cms_block` (`id_cms_category`, `location`, `position`, `display_store`)
|
||||
VALUES('.(int)$id_category.', '.(int)$location.', '.(int)$position.', '.(int)$display_store.')';
|
||||
|
||||
return Db::getInstance()->execute($sql);
|
||||
}
|
||||
|
||||
public static function insertCMSBlockLang($id_cms_block, $id_lang)
|
||||
{
|
||||
$sql = 'INSERT INTO `'._DB_PREFIX_.'cms_block_lang` (`id_cms_block`, `id_lang`, `name`)
|
||||
VALUES('.(int)$id_cms_block.', '.(int)$id_lang.', "'.pSQL(Tools::getValue('block_name_'.$id_lang)).'")';
|
||||
|
||||
Db::getInstance()->execute($sql);
|
||||
|
||||
return Db::getInstance()->Insert_ID();
|
||||
}
|
||||
|
||||
public static function insertCMSBlockPage($id_cms_block, $id_cms, $is_category)
|
||||
{
|
||||
$sql = 'INSERT INTO `'._DB_PREFIX_.'cms_block_page` (`id_cms_block`, `id_cms`, `is_category`)
|
||||
VALUES('.(int)$id_cms_block.', '.(int)$id_cms.', '.(int)$is_category.')';
|
||||
|
||||
Db::getInstance()->execute($sql);
|
||||
|
||||
return Db::getInstance()->Insert_ID();
|
||||
}
|
||||
|
||||
public static function insertCMSBlockShop($id_cms_block, $id_shop)
|
||||
{
|
||||
$sql = 'INSERT INTO `'._DB_PREFIX_.'cms_block_shop` (`id_cms_block`, `id_shop`)
|
||||
VALUES('.(int)$id_cms_block.', '.(int)$id_shop.')';
|
||||
|
||||
Db::getInstance()->execute($sql);
|
||||
|
||||
return Db::getInstance()->Insert_ID();
|
||||
}
|
||||
|
||||
public static function updateCMSBlock($id_cms_block, $id_cms_category, $position, $location, $display_store)
|
||||
{
|
||||
$sql = 'UPDATE `'._DB_PREFIX_.'cms_block`
|
||||
SET `location` = '.(int)$location.',
|
||||
`id_cms_category` = '.(int)$id_cms_category.',
|
||||
`position` = '.(int)$position.',
|
||||
`display_store` = '.(int)$display_store.'
|
||||
WHERE `id_cms_block` = '.(int)$id_cms_block;
|
||||
|
||||
Db::getInstance()->execute($sql);
|
||||
}
|
||||
|
||||
public static function updatePositions($position, $new_position, $location)
|
||||
{
|
||||
$sql = 'UPDATE `'._DB_PREFIX_.'cms_block`
|
||||
SET `position` = '.(int)$new_position.' WHERE `position` > '.(int)$position.'
|
||||
AND `location` = '.(int)$location;
|
||||
|
||||
Db::getInstance()->execute($sql);
|
||||
}
|
||||
|
||||
public static function updateCMSBlockPositions($id_cms_block, $position, $new_position, $location)
|
||||
{
|
||||
$query = 'UPDATE `'._DB_PREFIX_.'cms_block`
|
||||
SET `position` = '.(int)$new_position.'
|
||||
WHERE `position` = '.(int)$position.'
|
||||
AND `location` = '.(int)$location;
|
||||
|
||||
$sub_query = 'UPDATE `'._DB_PREFIX_.'cms_block`
|
||||
SET `position` = '.(int)$position.'
|
||||
WHERE `id_cms_block` = '.(int)$id_cms_block;
|
||||
|
||||
if (Db::getInstance()->execute($query))
|
||||
Db::getInstance()->execute($sub_query);
|
||||
}
|
||||
|
||||
public static function updateCMSBlockPosition($id_cms_block, $position)
|
||||
{
|
||||
$query = 'UPDATE `'._DB_PREFIX_.'cms_block`
|
||||
SET `position` = '.(int)$position.'
|
||||
WHERE `id_cms_block` = '.(int)$id_cms_block;
|
||||
|
||||
Db::getInstance()->execute($query);
|
||||
}
|
||||
|
||||
public static function updateCMSBlockLang($id_cms_block, $block_name, $id_lang)
|
||||
{
|
||||
$sql = 'UPDATE `'._DB_PREFIX_.'cms_block_lang`
|
||||
SET `name` = "'.pSQL($block_name).'"
|
||||
WHERE `id_cms_block` = '.(int)$id_cms_block.'
|
||||
AND `id_lang`= '.(int)$id_lang;
|
||||
|
||||
Db::getInstance()->execute($sql);
|
||||
}
|
||||
|
||||
public static function updateDisplayStores($display_store)
|
||||
{
|
||||
$sql = 'UPDATE `'._DB_PREFIX_.'cms_block`
|
||||
SET `display_store` = '.$display_store;
|
||||
|
||||
Db::getInstance()->execute($sql);
|
||||
}
|
||||
|
||||
public static function deleteCMSBlock($id_cms_block)
|
||||
{
|
||||
$sql = 'DELETE FROM `'._DB_PREFIX_.'cms_block`
|
||||
WHERE `id_cms_block` = '.(int)$id_cms_block;
|
||||
|
||||
Db::getInstance()->execute($sql);
|
||||
}
|
||||
|
||||
public static function deleteCMSBlockPage($id_cms_block)
|
||||
{
|
||||
$sql = 'DELETE FROM `'._DB_PREFIX_.'cms_block_page`
|
||||
WHERE `id_cms_block` = '.(int)$id_cms_block;
|
||||
|
||||
Db::getInstance()->execute($sql);
|
||||
}
|
||||
|
||||
public static function getMaxPosition($location)
|
||||
{
|
||||
$sql = 'SELECT COUNT(*)
|
||||
FROM `'._DB_PREFIX_.'cms_block`
|
||||
WHERE `location` = '.(int)$location;
|
||||
|
||||
return Db::getInstance()->getValue($sql);
|
||||
}
|
||||
|
||||
public static function getCMSTitlesFooter()
|
||||
{
|
||||
$content = array();
|
||||
$context = Context::getContext();
|
||||
$footerCms = Configuration::get('FOOTER_CMS', null, $context->shop->getGroupID(), $context->shop->getID());
|
||||
|
||||
if (empty($footerCms))
|
||||
return $content;
|
||||
|
||||
$cmsCategories = explode('|', $footerCms);
|
||||
foreach ($cmsCategories as $cmsCategory)
|
||||
{
|
||||
$ids = explode('_', $cmsCategory);
|
||||
|
||||
if ($ids[0] == 1)
|
||||
{
|
||||
$query = BlockCMSModel::getBlockName($ids[1]);
|
||||
$content[$cmsCategory]['link'] = $context->link->getCMSCategoryLink((int)$ids[1], $query['link_rewrite']);
|
||||
$content[$cmsCategory]['meta_title'] = $query['name'];
|
||||
}
|
||||
else if ($ids[0] == 0)
|
||||
{
|
||||
$query = BlockCMSModel::getCMSMetaTitle($ids[1]);
|
||||
$content[$cmsCategory]['link'] = $context->link->getCMSLink((int)$ids[1], $query['link_rewrite']);
|
||||
$content[$cmsCategory]['meta_title'] = $query['meta_title'];
|
||||
}
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
public static function getBlockName($id)
|
||||
{
|
||||
$sql = 'SELECT cl.`name`, cl.`link_rewrite`
|
||||
FROM `'._DB_PREFIX_.'cms_category_lang` cl
|
||||
INNER JOIN `'._DB_PREFIX_.'cms_category` c ON (cl.`id_cms_category` = c.`id_cms_category`)
|
||||
WHERE cl.`id_cms_category` = '.(int)$id.'
|
||||
AND (c.`active` = 1 OR c.`id_cms_category` = 1)
|
||||
AND cl.`id_lang` = '.(int)Context::getContext()->language->id;
|
||||
|
||||
return Db::getInstance()->getRow($sql);
|
||||
}
|
||||
|
||||
public static function getBlockMetaTitle($id)
|
||||
{
|
||||
$sql = 'SELECT cl.`name`, cl.`link_rewrite`
|
||||
FROM `'._DB_PREFIX_.'cms_category_lang` cl
|
||||
INNER JOIN `'._DB_PREFIX_.'cms_category` c ON (cl.`id_cms_category` = c.`id_cms_category`)
|
||||
WHERE cl.`id_cms_category` = '.(int)$id.'
|
||||
AND (c.`active` = 1 OR c.`id_cms_category` = 1)
|
||||
AND cl.`id_lang` = '.(int)Context::getContext()->language->id;
|
||||
|
||||
return Db::getInstance()->getRow($sql);
|
||||
}
|
||||
|
||||
public static function getCMSMetaTitle($id)
|
||||
{
|
||||
$sql = 'SELECT cl.`meta_title`, cl.`link_rewrite`
|
||||
FROM `'._DB_PREFIX_.'cms_lang` cl
|
||||
INNER JOIN `'._DB_PREFIX_.'cms` c ON (cl.`id_cms` = c.`id_cms`)
|
||||
WHERE cl.`id_cms` = '.(int)$id.'
|
||||
AND (c.`active` = 1 OR c.`id_cms` = 1)
|
||||
AND cl.`id_lang` = '.(int)Context::getContext()->language->id;
|
||||
|
||||
return Db::getInstance()->getRow($sql);
|
||||
}
|
||||
|
||||
public static function getCMSCategoriesByLocation($location)
|
||||
{
|
||||
$context = Context::getContext();
|
||||
|
||||
$sql = 'SELECT bc.`id_cms_block`, bc.`id_cms_category`, bc.`display_store`, ccl.`link_rewrite`, ccl.`name` category_name, bcl.`name` block_name
|
||||
FROM `'._DB_PREFIX_.'cms_block` bc
|
||||
LEFT JOIN `'._DB_PREFIX_.'cms_block_shop` bcs ON (bcs.id_cms_block = bc.id_cms_block)
|
||||
INNER JOIN `'._DB_PREFIX_.'cms_category_lang` ccl ON (bc.`id_cms_category` = ccl.`id_cms_category`)
|
||||
INNER JOIN `'._DB_PREFIX_.'cms_block_lang` bcl ON (bc.`id_cms_block` = bcl.`id_cms_block`)
|
||||
WHERE bc.`location` = '.(int)($location).'
|
||||
AND ccl.`id_lang` = '.(int)$context->language->id.'
|
||||
AND bcl.`id_lang` = '.(int)$context->language->id.'
|
||||
AND bcs.id_shop = '.(int)$context->shop->getID(true).'
|
||||
ORDER BY `position`';
|
||||
|
||||
return Db::getInstance()->executeS($sql);
|
||||
}
|
||||
|
||||
public static function getCMSPages($id_cms_category)
|
||||
{
|
||||
$sql = 'SELECT c.`id_cms`, cl.`meta_title`, cl.`link_rewrite`
|
||||
FROM `'._DB_PREFIX_.'cms` c
|
||||
INNER JOIN `'._DB_PREFIX_.'cms_lang` cl ON (c.`id_cms` = cl.`id_cms`)
|
||||
WHERE c.`id_cms_category` = '.(int)$id_cms_category.'
|
||||
AND cl.`id_lang` = '.(int)Context::getContext()->language->id.'
|
||||
AND c.`active` = 1
|
||||
ORDER BY `position`';
|
||||
|
||||
return Db::getInstance()->executeS($sql);
|
||||
}
|
||||
|
||||
public static function getCMSBlockPages($id_block)
|
||||
{
|
||||
$sql = 'SELECT cl.`id_cms`, cl.`meta_title`, cl.`link_rewrite`
|
||||
FROM `'._DB_PREFIX_.'cms_block_page` bcp
|
||||
INNER JOIN `'._DB_PREFIX_.'cms_lang` cl ON (bcp.`id_cms` = cl.`id_cms`)
|
||||
INNER JOIN `'._DB_PREFIX_.'cms` c ON (bcp.`id_cms` = c.`id_cms`)
|
||||
WHERE bcp.`id_cms_block` = '.(int)$id_block.'
|
||||
AND cl.`id_lang` = '.(int)Context::getContext()->language->id.'
|
||||
AND bcp.`is_category` = 0
|
||||
AND c.`active` = 1
|
||||
ORDER BY `position`';
|
||||
|
||||
return Db::getInstance()->executeS($sql);
|
||||
}
|
||||
|
||||
public static function getCMSBlockPagesCategories($id_cms_block)
|
||||
{
|
||||
$sql = 'SELECT bcp.`id_cms`, cl.`name`, cl.`link_rewrite`
|
||||
FROM `'._DB_PREFIX_.'cms_block_page` bcp
|
||||
INNER JOIN `'._DB_PREFIX_.'cms_category_lang` cl ON (bcp.`id_cms` = cl.`id_cms_category`)
|
||||
WHERE bcp.`id_cms_block` = '.(int)$id_cms_block.'
|
||||
AND cl.`id_lang` = '.(int)Context::getContext()->language->id.'
|
||||
AND bcp.`is_category` = 1';
|
||||
|
||||
return Db::getInstance()->executeS($sql);
|
||||
}
|
||||
|
||||
public static function getCMSCategories($recursive = false, $from = 0)
|
||||
{
|
||||
if ($recursive === false)
|
||||
{
|
||||
$sql = 'SELECT bcp.`id_cms_category`, bcp.`id_parent`, bcp.`level_depth`, bcp.`active`, bcp.`position`, cl.`name`, cl.`link_rewrite`
|
||||
FROM `'._DB_PREFIX_.'cms_category` bcp
|
||||
INNER JOIN `'._DB_PREFIX_.'cms_category_lang` cl ON (bcp.`id_cms_category` = cl.`id_cms_category`)
|
||||
WHERE cl.`id_lang` = '.(int)Context::getContext()->language->id;
|
||||
|
||||
return Db::getInstance()->executeS($sql);
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = 'SELECT bcp.`id_cms_category`, bcp.`id_parent`, bcp.`level_depth`, bcp.`active`, bcp.`position`, cl.`name`, cl.`link_rewrite`
|
||||
FROM `'._DB_PREFIX_.'cms_category` bcp
|
||||
INNER JOIN `'._DB_PREFIX_.'cms_category_lang` cl ON (bcp.`id_cms_category` = cl.`id_cms_category`)
|
||||
WHERE cl.`id_lang` = '.(int)Context::getContext()->language->id.'
|
||||
AND bcp.`id_parent` = '.(int)$from;
|
||||
|
||||
$results = Db::getInstance()->executeS($sql);
|
||||
foreach ($results as $result)
|
||||
{
|
||||
$sub_categories = BlockCMSModel::getCMSCategories(true, $result['id_cms_category']);
|
||||
if ($sub_categories && count($sub_categories) > 0)
|
||||
$result['sub_categories'] = $sub_categories;
|
||||
$categories[] = $result;
|
||||
}
|
||||
|
||||
return isset($categories) ? $categories : false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Get a single CMS block by its ID */
|
||||
public static function getBlockCMS($id_cms_block)
|
||||
{
|
||||
$sql = 'SELECT cb.`id_cms_category`, cb.`location`, cb.`position`, cb.`display_store`, cbl.id_lang, cbl.name
|
||||
FROM `'._DB_PREFIX_.'cms_block` cb
|
||||
LEFT JOIN `'._DB_PREFIX_.'cms_block_lang` cbl ON (cbl.`id_cms_block` = cb.`id_cms_block`)
|
||||
WHERE cb.`id_cms_block` = '.(int)$id_cms_block;
|
||||
|
||||
$cmsBlocks = Db::getInstance()->executeS($sql);
|
||||
// $store_display_update = array(0, $size = count($cmsBlocks), $display = Configuration::get('PS_STORES_DISPLAY_FOOTER'));
|
||||
foreach ($cmsBlocks as $cmsBlock)
|
||||
{
|
||||
$results[(int)$cmsBlock['id_lang']] = $cmsBlock;
|
||||
$restuls[(int)$cmsBlock['id_lang']]['name'] = $cmsBlock['name'];
|
||||
|
||||
/* Don't know if needed */
|
||||
// $cmsBlocks['name'][(int)$cmsBlock['id_lang']] = $cmsBlock['name'];
|
||||
// if ($store_display_update['0'] < $store_display_update['1'])
|
||||
// $cmsBlocks[$store_display_update['0']]['display_store'] = $store_display_update['2'];
|
||||
// $store_display_update['0']++;
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
/* Get all CMS blocks by location */
|
||||
public static function getCMSBlocksByLocation($location)
|
||||
{
|
||||
$sql = 'SELECT bc.`id_cms_block`, bcl.`name` block_name, ccl.`name` category_name, bc.`position`, bc.`id_cms_category`, bc.`display_store`
|
||||
FROM `'._DB_PREFIX_.'cms_block` bc
|
||||
INNER JOIN `'._DB_PREFIX_.'cms_category_lang` ccl ON (bc.`id_cms_category` = ccl.`id_cms_category`)
|
||||
INNER JOIN `'._DB_PREFIX_.'cms_block_lang` bcl ON (bc.`id_cms_block` = bcl.`id_cms_block`)
|
||||
WHERE ccl.`id_lang` = '.(int)Context::getContext()->language->id.'
|
||||
AND bcl.`id_lang` = '.(int)Context::getContext()->language->id.'
|
||||
AND bc.`location` = '.(int)$location.'
|
||||
ORDER BY bc.`position`';
|
||||
|
||||
return Db::getInstance()->executeS($sql);
|
||||
}
|
||||
|
||||
/* Get all CMS blocks */
|
||||
public static function getCMSBlocks()
|
||||
{
|
||||
$sql = 'SELECT bc.`id_cms_block`, bcl.`name` block_name, ccl.`name` category_name, bc.`position`, bc.`id_cms_category`, bc.`display_store`
|
||||
FROM `'._DB_PREFIX_.'cms_block` bc
|
||||
INNER JOIN `'._DB_PREFIX_.'cms_category_lang` ccl ON (bc.`id_cms_category` = ccl.`id_cms_category`)
|
||||
INNER JOIN `'._DB_PREFIX_.'cms_block_lang` bcl ON (bc.`id_cms_block` = bcl.`id_cms_block`)
|
||||
WHERE ccl.`id_lang` = '.(int)Context::getContext()->language->id.'
|
||||
AND bcl.`id_lang` = '.(int)Context::getContext()->language->id.'
|
||||
ORDER BY bc.`position`';
|
||||
|
||||
return Db::getInstance()->executeS($sql);
|
||||
}
|
||||
|
||||
/* Get all CMS blocks */
|
||||
public static function getAllCMSStructure()
|
||||
{
|
||||
$categories = BlockCMSModel::getCMSCategories();
|
||||
|
||||
foreach ($categories as $key => $value)
|
||||
$categories[$key]['cms_pages'] = BlockCMSModel::getCMSPages($value['id_cms_category']);
|
||||
|
||||
return $categories;
|
||||
}
|
||||
|
||||
public static function getAllCMSTitles()
|
||||
{
|
||||
$titles = array_merge(
|
||||
BlockCMSModel::getCMSTitles(BlockCMSModel::LEFT_COLUMN),
|
||||
BlockCMSModel::getCMSTitles(BlockCMSModel::RIGHT_COLUMN)
|
||||
);
|
||||
|
||||
foreach ($titles as $key => $title)
|
||||
{
|
||||
unset(
|
||||
$titles[$key]['category_link'],
|
||||
$titles[$key]['category_name'],
|
||||
$titles[$key]['categories'],
|
||||
$titles[$key]['name']
|
||||
);
|
||||
}
|
||||
|
||||
return $titles;
|
||||
}
|
||||
|
||||
public static function getCMSTitles($location)
|
||||
{
|
||||
$content = array();
|
||||
$context = Context::getContext();
|
||||
$cmsCategories = BlockCMSModel::getCMSCategoriesByLocation($location);
|
||||
|
||||
if (is_array($cmsCategories) && count($cmsCategories))
|
||||
{
|
||||
foreach ($cmsCategories as $cmsCategory)
|
||||
{
|
||||
$key = (int)$cmsCategory['id_cms_block'];
|
||||
$content[$key]['display_store'] = $cmsCategory['display_store'];
|
||||
$content[$key]['cms'] = BlockCMSModel::getCMSBlockPages($cmsCategory['id_cms_block']);
|
||||
|
||||
$links = array();
|
||||
if (count($content[$key]['cms']))
|
||||
{
|
||||
foreach ($content[$key]['cms'] as $row)
|
||||
{
|
||||
$row['link'] = $context->link->getCMSLink((int)($row['id_cms']), $row['link_rewrite']);
|
||||
$links[] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
$content[$key]['cms'] = $links;
|
||||
$content[$key]['categories'] = BlockCMSModel::getCMSBlockPagesCategories($cmsCategory['id_cms_block']);
|
||||
|
||||
$links = array();
|
||||
if (count($content[$key]['categories']))
|
||||
{
|
||||
foreach ($content[$key]['categories'] as $row)
|
||||
{
|
||||
$row['link'] = $context->link->getCMSCategoryLink((int)$row['id_cms'], $row['link_rewrite']);
|
||||
$links[] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
$content[$key]['categories'] = $links;
|
||||
$content[$key]['name'] = $cmsCategory['block_name'];
|
||||
$content[$key]['category_link'] = $context->link->getCMSCategoryLink((int)$cmsCategory['id_cms_category'], $cmsCategory['link_rewrite']);
|
||||
$content[$key]['category_name'] = $cmsCategory['category_name'];
|
||||
}
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,9 +4,13 @@
|
||||
/* Block CMS links */
|
||||
.informations_block_left li {border-bottom:1px dotted #eee}
|
||||
.informations_block_left li.last {border:none;}
|
||||
.informations_block_left li a {
|
||||
display:block;
|
||||
padding:7px 11px 5px 22px;
|
||||
color:#333;
|
||||
background:url(img/arrow_right_2.png) no-repeat 10px 10px transparent;
|
||||
}
|
||||
.informations_block_left li a {
|
||||
display:block;
|
||||
padding:7px 11px 5px 22px;
|
||||
color:#333;
|
||||
background:url(img/arrow_right_2.png) no-repeat 10px 10px transparent;
|
||||
}
|
||||
|
||||
tr.subitem > td:first-child + td {
|
||||
padding-left: 10px;
|
||||
}
|
||||
@@ -50,52 +50,7 @@ function CMSBlocksDnD(secure_key)
|
||||
{
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("#table_right").tableDnD({
|
||||
onDragStart: function(table, row) {
|
||||
originalOrder = $.tableDnD.serialize();
|
||||
reOrder = ':even';
|
||||
if (table.tBodies[0].rows[1] && $('#' + table.tBodies[0].rows[1].id).hasClass('alt_row'))
|
||||
reOrder = ':odd';
|
||||
},
|
||||
dragHandle: 'dragHandle',
|
||||
onDragClass: 'myDragClass',
|
||||
onDrop: function(table, row) {
|
||||
if (originalOrder != $.tableDnD.serialize())
|
||||
{
|
||||
var tableDrag = $('#' + table.id);
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
async: false,
|
||||
url: '../modules/blockcms/ajax_blockcms.php?' + $.tableDnD.serialize(),
|
||||
data: 'action=dnd&secure_key='+secure_key,
|
||||
success: function(data) {
|
||||
tableDrag.find('tbody tr').removeClass('alt_row');
|
||||
tableDrag.find('tbody tr' + reOrder).addClass('alt_row');
|
||||
tableDrag.find('tbody td.positions').each(function(i) {
|
||||
$(this).html(i+1);
|
||||
});
|
||||
tableDrag.find('tbody td.dragHandle a:hidden').show();
|
||||
tableDrag.find('tbody td.dragHandle:last a:even').hide();
|
||||
tableDrag.find('tbody td.dragHandle:first a:odd').hide();
|
||||
var reg = /_[0-9]$/g;
|
||||
tableDrag.find('tbody tr').each(function(i) {
|
||||
$(this).attr('id', $(this).attr('id').replace(reg, '_' + i));
|
||||
|
||||
// Update link position
|
||||
var up_reg = new RegExp('position=[-]?[0-9]+&');
|
||||
|
||||
// Up links
|
||||
$(this).find('td.dragHandle a:odd').attr('href', $(this).find('td.dragHandle a:odd').attr('href').replace(up_reg, 'position='+ (i - 1) +'&'));
|
||||
|
||||
// Down links
|
||||
$(this).find('td.dragHandle a:even').attr('href', $(this).find('td.dragHandle a:even').attr('href').replace(up_reg, 'position='+ (i + 1) +'&'));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#table_left").tableDnD({
|
||||
$(".tableDnD").tableDnD({
|
||||
onDragStart: function(table, row) {
|
||||
originalOrder = $.tableDnD.serialize();
|
||||
reOrder = ':even';
|
||||
@@ -141,4 +96,4 @@ function CMSBlocksDnD(secure_key)
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
+538
-711
File diff suppressed because it is too large
Load Diff
@@ -5,55 +5,38 @@ $_MODULE = array();
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_cd275312651aebf8cbbb8d3bb1c086ae'] = 'Bloc CMS';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_cdca12007979fc49008fd125cdb775fc'] = 'Ajoute un bloc contenant plusieurs lien vers vos pages CMS';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_a82be0f551b8708bc08eb33cd9ded0cf'] = 'Information';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_ea4788705e6873b424c65e91c2846b19'] = 'Annuler';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_ef61fb324d729c341ea8ab9901e23566'] = 'Ajouter un bloc';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_97390dd0b5ba7867120aee2ff22bfa38'] = 'Configuration du bloc CMS';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_1cd127158cfd245511751206f4b3c6f0'] = 'Ajouter un nouveau bloc CMS';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_6e1ea63625a85f6d2d9ecbfb79586351'] = 'Liste des blocs CMS de gauche';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_b718adec73e04ce3ec720dd11a06a308'] = 'ID';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_aae551ce0c29dfe39b0ff20139abdef3'] = 'Nom du bloc';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_99121ab27aaa7472cfada9071c5ba434'] = 'Nom de la catégorie CMS';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_52f5e0bc3859bc5f5e25130b6c7e8881'] = 'Position';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_06df33001c1d7187fdd81ea1f5b277aa'] = 'Actions';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_08a38277b0309070706f6652eeae9a53'] = 'Bas';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_258f49887ef8d14ac268c92b02503aaa'] = 'Haut';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_7dce122004969d56ae2e0245cb754d35'] = 'Modifier';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_f2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_8f08c1af47e3e9611289c1882befc3a8'] = 'Il n\'existe aucun bloc CMS';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_0a40c06f34e5c794a7f0d3085d17d63a'] = 'Liste des blocs CMS de droite';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_790dde5207c6635d6d743102c85395c0'] = 'Blocs CNS';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_965be994da393e5aa15bd3a2444c6ccf'] = 'Configuration des liens CMS en pied de page';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_2a2dc7b7f184468f25c0504a0998be51'] = 'Lien de pied de page';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_0b31e765f1e9cb451319b32e84a75a9e'] = 'Sélectionnez les pages que vous souhaitez afficher dans le bloc CMS de pied de page';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_e5f7d0903a8ea59c07b4b2797ee0cff9'] = 'Informations de pied de page';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_32c532e462a1f85b1b103ed9989a1aba'] = 'Afficher \"Propulsé par PrestaShop\"';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_fab8ca8250236ed20b96f9750e1eacc7'] = 'Afficher les liens de bas de page';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_6c5f7d2f911e91ebd0c077fe770e739e'] = 'Informations du pied de page :';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_49ee3087348e8d44e1feda1917443987'] = 'Nom';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_5aa1602194579edb6f91d7dd53eadb32'] = 'Nouveau bloc CMS';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_38fb7d24e0d60a048f540ecb18e13376'] = 'Enregistrer';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_e83c1afa1d3dbe19fa9becebb5ca8480'] = 'Modification du bloc CMS';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_7d9a9a0187e212cb7fd126afb8704bd1'] = 'Nom du bloc :';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_5aa1602194579edb6f91d7dd53eadb32'] = 'Nouveau bloc CMS';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_ab278feec882a679b078490639232d69'] = 'Nom du bloc';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_bdbaef442c586e1bbecb44eba1ba7e2d'] = 'Si vous laissez ce champ vide, le nom du bloc sera le nom de la catégorie';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_7310626b183e1bcfcc61b844e8ea3c5c'] = 'Choisissez une catégorie CMS :';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_be9469719aa6efa2fc3bd5768bc406d7'] = 'Emplacement :';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_fca0206c8afc8d67969f9aec20e3287e'] = 'Catégorie du CMS';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_abf9012e9560b3c44a536f5c4a2a0b62'] = 'Emplacement';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_945d5e233cf7d6240f6b783b36a374ff'] = 'Gauche';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_92b09c7c48c520c3c55e497875da437c'] = 'Droite';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_1acef6bfa7dc3360eed6bf44851fa6a4'] = 'Afficher les boutiques :';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_5e2b11203c9a4ac0ec01e7bb31e256f6'] = 'Afficher les magasins';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_93cba07454f06a4a960172bbd6e2a435'] = 'Oui';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Non';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_08f3899ad165f85f8596199966b8c673'] = 'Afficher \"Nos magasins\" en bas du block';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_f16b5952df8d25ea30b25ff95ee8fedf'] = 'Association de boutiques :';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_ea4788705e6873b424c65e91c2846b19'] = 'Annuler';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_f7df0009efd65cec8e54cf4ef30abf5e'] = 'Affichage non valable pour le magasin';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_903d12e7aa8c380c290b78c1898e01b7'] = 'Emplacement non valable pour le bloc';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_92fc29650a0f9dd3fca4e5de1845f78b'] = 'Vous devez choisir au moins une page ou sous-catégorie pour créer un bloc CMS.';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_5e75cbfbfd02a7b2fab0ed21505e811b'] = 'Page CMS ou catégorie non valable';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_420d575844f77db5299065080d9c237f'] = 'Le nom du bloc est trop long';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_ede67d50014846cb8bb1b00d5fde77be'] = 'id_cms_block non valable';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_3a0f63c4686f86af51f6ef8408cd174d'] = 'Veuillez fournir un texte de pied de page dans le langage par défaut';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_05b51791a83d3cef29ad68b70d48d131'] = 'Pied de page d\'activation non valable';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_63dfd52fcf0dcb2c21242a21a33ed875'] = 'Contenu du CMS';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_4d388b3442c6b155f0613fda97b1369a'] = 'Sélectionnez les pages que vous souhaitez afficher dans ce bloc';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_5dab5acc3c6a2a7e87e8d8926a2c763e'] = 'Erreur : vous essayez de supprimer un bloc CMS inexistant';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_138218281781fd0d938a140892d7386c'] = 'Le contenu CMS du pied de page a bien été mis à jour';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_ddd7d8a072783afaf23e5e6843398fc9'] = 'Le bloc CMS a bien été ajouté';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_31a22821c66edf7e3aa33ef1c8109f4c'] = 'Le bloc CMS a bien été modifié';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_87a2663d841b78f01c27c0edb4f50b76'] = 'Suppression réussie';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_be58fccb15fb119b8c3d485e3a8561c4'] = 'Configuration du bloc CMS';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_78edb384f1a71576034e00ed6844bcc2'] = 'Il n\'y a rien à afficher dans cette catégorie CMS';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_34c869c542dee932ef8cd96d2f91cae6'] = 'Nos magasins';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_c4c95c36570d5a8834be5e88e2f0f6b2'] = 'Informations';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_d1aa22a3126f04664e0fe3f598994014'] = 'Promotions';
|
||||
@@ -61,3 +44,16 @@ $_MODULE['<{blockcms}prestashop>blockcms_9ff0635f5737513b1a6f559ac2bff745'] = 'N
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_3cb29f0ccc5fd220a97df89dafe46290'] = 'Meilleures ventes';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_02d4482d332e1aef3437cd61c9bcc624'] = 'Contactez-nous';
|
||||
$_MODULE['<{blockcms}prestashop>blockcms_7a52e36bf4a1caa031c75a742fb9927a'] = 'Propulsé par';
|
||||
$_MODULE['<{blockcms}prestashop>form_4dabfa54822012dfc78d6ef40f224173'] = 'Blocs à gauche';
|
||||
$_MODULE['<{blockcms}prestashop>form_d9ca3009e18447d91cd2e324e8e680ce'] = 'Blocs à droite';
|
||||
$_MODULE['<{blockcms}prestashop>form_b718adec73e04ce3ec720dd11a06a308'] = 'ID';
|
||||
$_MODULE['<{blockcms}prestashop>form_aae551ce0c29dfe39b0ff20139abdef3'] = 'Nom du bloc';
|
||||
$_MODULE['<{blockcms}prestashop>form_bb34a159a88035cce7ef1607e7907f8f'] = 'Nom de la catégorie';
|
||||
$_MODULE['<{blockcms}prestashop>form_52f5e0bc3859bc5f5e25130b6c7e8881'] = 'Position';
|
||||
$_MODULE['<{blockcms}prestashop>form_06df33001c1d7187fdd81ea1f5b277aa'] = 'Actions';
|
||||
$_MODULE['<{blockcms}prestashop>form_08a38277b0309070706f6652eeae9a53'] = 'Descendre';
|
||||
$_MODULE['<{blockcms}prestashop>form_258f49887ef8d14ac268c92b02503aaa'] = 'Monter';
|
||||
$_MODULE['<{blockcms}prestashop>form_7dce122004969d56ae2e0245cb754d35'] = 'Modifier';
|
||||
$_MODULE['<{blockcms}prestashop>form_f2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer';
|
||||
$_MODULE['<{blockcms}prestashop>form_49ee3087348e8d44e1feda1917443987'] = 'Nom';
|
||||
$_MODULE['<{blockcms}prestashop>form_288af9ab7bf1ea82c86597d0adc2de31'] = 'Aucune page créée';
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
{*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 8971 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
{extends file="helpers/form/form.tpl"}
|
||||
|
||||
{block name="start_field_block"}
|
||||
|
||||
<div class="margin-form">
|
||||
|
||||
{if $input.type == 'cms_blocks'}
|
||||
|
||||
<script type="text/javascript">
|
||||
var come_from = '{$name_controller}';
|
||||
var token = '{$token}';
|
||||
var alternate = 1;
|
||||
</script>
|
||||
|
||||
{assign var=cms_blocks_positions value=$input.values}
|
||||
{if isset($cms_blocks_positions) && count($cms_blocks_positions) > 0}
|
||||
|
||||
{foreach $cms_blocks_positions as $key => $cms_blocks_position}
|
||||
<div style="float:left;{if $key == 0}margin-right:2em;{/if}">
|
||||
|
||||
<h3 style="margin-top:1px;">
|
||||
{if $key == 0}
|
||||
{l s='Left blocks'}
|
||||
{else}
|
||||
{l s='Right blocks'}
|
||||
{/if}
|
||||
</h3>
|
||||
|
||||
<table cellspacing="0" cellpadding="0" style="min-width:40em;" class="table tableDnD cms" id="cms_block_{$key%2}">
|
||||
<thead>
|
||||
<tr class="nodrag nodrop">
|
||||
<th>{l s='ID'}</th>
|
||||
<th>{l s='Name of block'}</th>
|
||||
<th>{l s='Category name'}</th>
|
||||
<th>{l s='Position'}</th>
|
||||
<th>{l s='Actions'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach $cms_blocks_position as $key => $cms_block}
|
||||
<tr class="{if $key%2}alt_row{else}not_alt_row{/if} row_hover" id="tr_{$key%2}_{$cms_block['id_cms_block']}_{$cms_block['position']}">
|
||||
<td>{$cms_block['id_cms_block']}</td>
|
||||
<td>{$cms_block['block_name']}</td>
|
||||
<td>{$cms_block['category_name']}</td>
|
||||
<td class="center pointer dragHandle" id="td_{$key%2}_{$cms_block['id_cms_block']}">
|
||||
<a
|
||||
{if (($key == (sizeof($cms_blocks_position) - 1)) || (sizeof($cms_blocks_position) == 1))}
|
||||
style="display: none;"
|
||||
{/if}
|
||||
href="{$current}&configure=blockcms&id_cms_block={$cms_block['id_cms_block']}&way=1&position={(int)$cms_block['position'] + 1}&location=0&token={$token}">
|
||||
<img src="{$smarty.const._PS_ADMIN_IMG_}down.gif" alt="{l s='Down'}" title="{l s='Down'}" />
|
||||
</a>
|
||||
<a
|
||||
{if (($cms_block['position'] == 0) || ($key == 0))}
|
||||
style="display: none;"
|
||||
{/if}
|
||||
href="{$current}&configure=blockcms&id_cms_block={$cms_block['id_cms_block']}&way=0&position={(int)$cms_block['position'] - 1}&location=0&token={$token}">
|
||||
<img src="{$smarty.const._PS_ADMIN_IMG_}up.gif" alt="{l s='Up'}" title="{l s='Up'}" />
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{$current}&token={$token}&editBlockCMS&id_cms_block={(int)$cms_block['id_cms_block']}" title="{l s='Edit'}"><img src="{$smarty.const._PS_ADMIN_IMG_}edit.gif" alt="" /></a>
|
||||
<a href="{$current}&token={$token}&deleteBlockCMS&id_cms_block={(int)$cms_block['id_cms_block']}" title="{l s='Delete'}"><img src="{$smarty.const._PS_ADMIN_IMG_}delete.gif" alt="" /></a>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
{/foreach}
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{if $input.type == 'select_category'}
|
||||
|
||||
{function name=render_select level=0}
|
||||
{foreach $items as $item}
|
||||
{if (isset($item['id_cms_category']))}
|
||||
<option id="category_{$item['id_cms_category']}" value="{$item['id_cms_category']}"
|
||||
{if (isset($fields_value['id_category']) && ($item['id_cms_category'] == $fields_value['id_category']))}
|
||||
selected
|
||||
{/if}
|
||||
>
|
||||
{str_repeat(' ', $level * 4)|cat:$item['name']}
|
||||
</option>
|
||||
|
||||
{if isset($item['sub_categories']) && count($item['sub_categories']) > 0}
|
||||
{call name=render_select items=$item['sub_categories'] level=$level+1}
|
||||
{/if}
|
||||
{/if}
|
||||
{/foreach}
|
||||
{/function}
|
||||
|
||||
{if isset($input.options.query) && count($input.options.query) > 0}
|
||||
{assign var=categories value=$input.options.query}
|
||||
|
||||
<select id="{$input.name}" name="{$input.name}">
|
||||
{call render_select items=$categories}
|
||||
</select>
|
||||
{/if}
|
||||
|
||||
{/if}
|
||||
|
||||
{if $input.type == 'cms_pages'}
|
||||
|
||||
{assign var=cms value=$input.values}
|
||||
{if isset($cms) && count($cms) > 0}
|
||||
|
||||
<table cellspacing="0" cellpadding="0" class="table" style="min-width:40em;">
|
||||
<tr>
|
||||
<th>
|
||||
<input type="checkbox" name="checkme" id="checkme" class="noborder" onclick="checkDelBoxes(this.form, '{$input.name}', this.checked)" />
|
||||
</th>
|
||||
<th>{l s='ID'}</th>
|
||||
<th>{l s='Name'}</th>
|
||||
</tr>
|
||||
|
||||
{foreach $cms as $key => $cms_category}
|
||||
<tr {if $key%2}class="alt_row"{/if}>
|
||||
<td>
|
||||
{assign var=id_checkbox value=1|cat:'_'|cat:$cms_category['id_cms_category']}
|
||||
<input type="checkbox" class="cmsBox" name="{$input.name}" id="{$id_checkbox}" value="{$id_checkbox}" {if isset($fields_value[$id_checkbox])}checked="checked"{/if} />
|
||||
</td>
|
||||
<td>
|
||||
<strong>{$cms_category['id_cms_category']}</strong>
|
||||
</td>
|
||||
<td><label for="{$id_checkbox}" class="t"><strong>{str_repeat(' ', ($cms_category['level_depth'] - 1) * 4)|cat:$cms_category['name']}</strong></label></td>
|
||||
</tr>
|
||||
|
||||
{foreach $cms_category['cms_pages'] as $subkey => $cms_page}
|
||||
<tr class="subitem{if ($subkey+$key-1)%2} alt_row{/if}">
|
||||
<td>
|
||||
{assign var=id_checkbox value=0|cat:'_'|cat:$cms_page['id_cms']}
|
||||
<input type="checkbox" class="cmsBox" name="{$input.name}" id="{$id_checkbox}" value="{$id_checkbox}" {if isset($fields_value[$id_checkbox])}checked="checked"{/if} />
|
||||
</td>
|
||||
<td>
|
||||
{$cms_page['id_cms']}
|
||||
</td>
|
||||
<td><label for="{$id_checkbox}" class="t">{str_repeat(' ', $cms_category['level_depth'] * 4)|cat:$cms_page['meta_title']}</label></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
|
||||
{/foreach}
|
||||
|
||||
</table>
|
||||
{else}
|
||||
<p>{l s='No pages created'}</p>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{/block}
|
||||
@@ -3,54 +3,3 @@
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_693b83f5eca43e2bb1675287c37ce9e2'] = 'Slider pour votre page d\'accueil';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_c17aed434289cedd02618451e12c8da6'] = 'Ajouter une image';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_17167898123700e4b4f9bc17c1e0608d'] = 'Configuration du Slider';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_e933dc24fb245d863a43b4fefe9b45f5'] = 'Hauteur:';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_48ccf48dcf2218a413ce473262f21a0c'] = 'Largeur:';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_2c526c645bca9542ba1598835d46b753'] = 'Vitesse:';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_154e6bcf4e3b49a424323cb9021ef851'] = 'Pause:';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_c9cc8cce247e49bae79f15173ce97354'] = 'Sauvegarder';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_571988492824e57070d78e6c86333f20'] = 'Configuration d\'une slide';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_02023fc24279454047fd419ecd1db9af'] = 'Ajouter une Slide';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_8d9fc9d5dd1919e4bf738bd46361ee10'] = 'Vous n\'avez pas encore ajouté de slides.';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_7dce122004969d56ae2e0245cb754d35'] = 'Editer';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_f2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_3b21e9521eb7b13b5e33325a4a06ae55'] = 'module %s doit être inscriptible (CHMOD 755 / 777)';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_947c5b1ecd3021f44ae45bc176085ae1'] = 'Envoyer';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_a5220b3d801e803e8c4133edcd0dc7b4'] = 'Sélectionner un fichier:';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_2d806bd95ceb6d3166fb5c01d3fb75f0'] = 'Configurez votre slide';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_32bd52059351cd9ac4ae44f16746da11'] = 'Editez votre slide';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_51ec9bf4aaeab1b25bb57f9f8d4de557'] = 'Titre:';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_3b3d06023f6353f8fd05f859b298573e'] = 'URL:';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_8046c95f98fc714db47978092bb24264'] = 'Légende:';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_d0042a700e9bdf79689d63ee6846dc0e'] = 'Description:';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_3d091e856cb7615d1ccb96bc759b5a92'] = 'Active';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_93cba07454f06a4a960172bbd6e2a435'] = 'Oui';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Non';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_ea4788705e6873b424c65e91c2846b19'] = 'Annuler';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_70397c4b252a5168c5ec003931cea215'] = 'Champs requis';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_3f80dc2cdd06939d4f5514362067cd86'] = 'Champs invalides';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_a6abafe564d3940cc36ee43e2f09400b'] = 'Slide invalide';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_b3e3ed438fb0ea2935b3e79eac1f1658'] = 'Etat invalide';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_57b620e0495c07c15deda4dde882d47b'] = 'Position invalide';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_76ad3ac84a702b0497cd6be8e8886d34'] = 'L\'id est invalide';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_2f6e2bf88137020c30bdbf4ebe233c77'] = 'Le titre est trop long';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_3b77d63253ad17dd30fd10e36d328517'] = 'La légende est trop longue';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_5f9058e4bbbf4dcdd556a16ad835431c'] = 'L\'url est trop longue';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_4b43a83204d657042170834b817269e4'] = 'La description est trop longue';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_c99b9ff9028266c00a8cf4aeae4b532f'] = 'Le format de l\'URL n\'est pas correct';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_7a92ef6b168d77ebcdad785b01d77a8e'] = 'Invalide nom de fichier';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_ff44e46af4fae17a4b7aea06a78432d8'] = 'Le champ titre est vide';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_fbd5d9eaf858d277768f72f551d0e429'] = 'Le champ légende est vide';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_96d7de12ec9cae5887bd18348c9e1b64'] = 'Le champ URL est vide';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_82bc69b4b2f634b51aea683457829cda'] = 'Image vide';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_f6452628a4c8b6e97f8d447ebbfded1b'] = 'Mise à jour impossible';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuration mise à jour';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_07b8c09e490f7afbdcfa9cd5bfcfd4a9'] = 'Une erreur est survenue durant l\'envoie de l\'image';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_f7e1d2ff3588d24a4b5a4f5af076123e'] = 'Mise à jour effectuée';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_917d4e296eddb76a6d0b6b908cbc1886'] = 'Mise à jour impossible';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_5da12d1bb63af9cd5be306102b23e82e'] = 'Slide supprimée';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_080b5727c047ef6658591f7d4507e681'] = 'Slide mise à jour';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_bb6abf21a6c70c5740d93093b5518954'] = 'Slide ajoutée';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_b9f5c797ebbf55adccdd8539a65a0241'] = 'Désactivé';
|
||||
$_MODULE['<{homeslider}prestashop>homeslider_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé';
|
||||
|
||||
Reference in New Issue
Block a user