//Unused files removed from blockcms folder
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13356 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
1 parent
95deb33fa4
commit
cd74105c07
2 files changed
-217
No files matched your search
@@ -1,118 +0,0 @@
|
|||||||
<?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: 7040 $
|
|
||||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
|
||||||
* International Registered Trademark & Property of PrestaShop SA
|
|
||||||
*/
|
|
||||||
|
|
||||||
include_once('../../config/config.inc.php');
|
|
||||||
include_once('../../init.php');
|
|
||||||
include_once('blockcms.php');
|
|
||||||
|
|
||||||
$context = Context::getContext();
|
|
||||||
$blockcms = new BlockCms();
|
|
||||||
if (!Tools::isSubmit('secure_key') OR Tools::getValue('secure_key') != $blockcms->secure_key OR !Tools::isSubmit('action'))
|
|
||||||
die(1);
|
|
||||||
|
|
||||||
if (Tools::getValue('action') == 'getCms')
|
|
||||||
{
|
|
||||||
if (!Validate::isInt(Tools::getValue('id_cms_category')) OR !Tools::getValue('id_cms_category'))
|
|
||||||
die(1);
|
|
||||||
|
|
||||||
$cms_categories = Db::getInstance()->executeS('
|
|
||||||
SELECT * FROM `'._DB_PREFIX_.'cms_category` c
|
|
||||||
JOIN `'._DB_PREFIX_.'cms_category_lang` cl ON (c.`id_cms_category` = cl.`id_cms_category`)
|
|
||||||
WHERE c.`id_parent` = '.(int)Tools::getValue('id_cms_category').'
|
|
||||||
AND cl.`id_lang` = '.(int)$context->language->id.'
|
|
||||||
ORDER BY c.`id_cms_category`');
|
|
||||||
|
|
||||||
$cms_pages = Db::getInstance()->executeS('
|
|
||||||
SELECT cl.`meta_title`, c.`id_cms` FROM `'._DB_PREFIX_.'cms` c
|
|
||||||
JOIN `'._DB_PREFIX_.'cms_lang` cl ON (c.`id_cms` = cl.`id_cms`)
|
|
||||||
WHERE c.`id_cms_category` = '.(int)Tools::getValue('id_cms_category').'
|
|
||||||
AND c.`active` = 1
|
|
||||||
AND cl.`id_lang` = '.(int)$context->language->id.'
|
|
||||||
ORDER BY c.`id_cms`');
|
|
||||||
|
|
||||||
if (Tools::getValue('id_cms_block'))
|
|
||||||
$cms_selected = Db::getInstance()->executeS('
|
|
||||||
SELECT `is_category`, `id_cms` FROM `'._DB_PREFIX_.'cms_block_page`
|
|
||||||
WHERE `id_cms_block` = '.(int)Tools::getValue('id_cms_block'));
|
|
||||||
|
|
||||||
$html = '';
|
|
||||||
if (sizeof($cms_categories) OR sizeof($cms_pages))
|
|
||||||
{
|
|
||||||
$html .= '
|
|
||||||
<table width="100%" class="table" cellspacing="0" cellpadding="0">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th width="5%" class="center"><input type="checkbox" class="noborder" name="checkme" onclick="checkallCMSBoxes($(this).attr(\'checked\'))"></th>
|
|
||||||
<th width="10%"><b>'.$blockcms->getL('ID').'</b></th>
|
|
||||||
<th width="85%"><b>'.$blockcms->getL('Name').'</b></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
';
|
|
||||||
foreach ($cms_categories as $cms_category)
|
|
||||||
{
|
|
||||||
$html .= '
|
|
||||||
<tr>
|
|
||||||
<td width="5%" class="center"><input type="checkbox" class="noborder cmsBox" name="cmsBox[]" value="1_'.$cms_category['id_cms_category'].'" '.(in_array(array('id_cms' => $cms_category['id_cms_category'], 'is_category' => 1), $cms_selected) ? 'checked="checked"' : '').'></td>
|
|
||||||
<td width="10%"><b>'.$cms_category['id_cms_category'].'</b></td>
|
|
||||||
<td width="85%"><b>'.$cms_category['name'].'</b></td>
|
|
||||||
</tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($cms_pages as $cms_page)
|
|
||||||
{
|
|
||||||
$html .= '
|
|
||||||
<tr>
|
|
||||||
<td width="5%" class="center"><input type="checkbox" class="noborder cmsBox" name="cmsBox[]" value="0_'.$cms_page['id_cms'].'" '.(in_array(array('id_cms' => $cms_page['id_cms'], 'is_category' => 0), $cms_selected) ? 'checked="checked"' : '').'></td>
|
|
||||||
<td width="10%">'.$cms_page['id_cms'].'</td>
|
|
||||||
<td width="85%">'.$cms_page['meta_title'].'</td>
|
|
||||||
</tr>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
$html .= $blockcms->getL('There is nothing to display in this CMS category');
|
|
||||||
|
|
||||||
echo $html;
|
|
||||||
}
|
|
||||||
elseif (Tools::getValue('action') == 'dnd')
|
|
||||||
{
|
|
||||||
if ($table = Tools::getValue('table_right') OR $table = Tools::getValue('table_left'));
|
|
||||||
{
|
|
||||||
$pos = 0;
|
|
||||||
foreach ($table as $key =>$row)
|
|
||||||
{
|
|
||||||
$ids = explode('_', $row);
|
|
||||||
Db::getInstance()->execute('
|
|
||||||
UPDATE `'._DB_PREFIX_.'cms_block`
|
|
||||||
SET `position` = '.(int)$pos.'
|
|
||||||
WHERE `id_cms_block` = '.(int)$ids[2]);
|
|
||||||
$pos++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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: 6844 $
|
|
||||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
|
||||||
* International Registered Trademark & Property of PrestaShop SA
|
|
||||||
*/
|
|
||||||
|
|
||||||
function CMSCategory_js(value, secure_key)
|
|
||||||
{
|
|
||||||
$.ajax({
|
|
||||||
type: "POST",
|
|
||||||
url: '../modules/blockcms/ajax_blockcms.php',
|
|
||||||
data: 'id_cms_category='+value+'&id_cms_block='+$('#id_cms_block').val()+'&action=getCms&secure_key='+secure_key,
|
|
||||||
async : false,
|
|
||||||
success: function(msg)
|
|
||||||
{
|
|
||||||
$('#cms_subcategories').html(msg);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function checkallCMSBoxes(checked)
|
|
||||||
{
|
|
||||||
if (checked)
|
|
||||||
$('.cmsBox').attr('checked', "checked");
|
|
||||||
else
|
|
||||||
$('.cmsBox').attr('checked', "");
|
|
||||||
}
|
|
||||||
|
|
||||||
function CMSBlocksDnD(secure_key)
|
|
||||||
{
|
|
||||||
$(document).ready(function()
|
|
||||||
{
|
|
||||||
$(".tableDnD").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) +'&'));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user