* @copyright 2007-2011 PrestaShop SA * @version Release: $Revision: 6930 $ * @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'); $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)$cookie->id_lang.' 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)$cookie->id_lang.' 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 .= '
'.$blockcms->getL('ID').' | '.$blockcms->getL('Name').' | |
---|---|---|
$cms_category['id_cms_category'], 'is_category' => 1), $cms_selected) ? 'checked="checked"' : '').'> | '.$cms_category['id_cms_category'].' | '.$cms_category['name'].' |
$cms_page['id_cms'], 'is_category' => 0), $cms_selected) ? 'checked="checked"' : '').'> | '.$cms_page['id_cms'].' | '.$cms_page['meta_title'].' |