* @copyright 2007-2013 PrestaShop SA * @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('devspefaq.php'); $context = Context::getContext(); $home_faqr = new devspefaq(); $faqs = array(); if (!Tools::isSubmit('secure_key') || Tools::getValue('secure_key') != $home_faqr->secure_key || !Tools::getValue('action')) die(1); if (Tools::getValue('action') == 'updatefaqsPosition' && Tools::getValue('faqs')) { $faqs = Tools::getValue('faqs'); foreach ($faqs as $position => $id_faq) { $res = Db::getInstance()->execute(' UPDATE `'._DB_PREFIX_.'devspefaq_item` SET `position` = '.(int)$position.' WHERE `id_devspefaq_item` = '.(int)$id_faq ); } $home_faqr->clearCache(); } if (Tools::getValue('action') == 'updatefaqsThemePosition' && Tools::getValue('faqs')) { $faqs = Tools::getValue('faqs'); foreach ($faqs as $position => $id_faq) { $res = Db::getInstance()->execute(' UPDATE `'._DB_PREFIX_.'devspefaq_theme` SET `position` = '.(int)$position.' WHERE `id_faq_theme` = '.(int)$id_faq ); } $home_faqr->clearCache(); }