Esempio n. 1
0
 private function _postProcess()
 {
     if (isset($_POST['categoryBox']) and is_array($_POST['categoryBox']) and count($_POST['categoryBox'] >= 1)) {
         foreach ($_POST['categoryBox'] as $row) {
             $cms[] = intval($row);
         }
         if (CMS::updateCmsToBlock($cms, $this->id)) {
             $this->_html .= '<div class="conf confirm">' . $this->l('Cms Updated') . '</div>';
         }
     } else {
         CMS::updateCmsToBlock(array(), $this->id);
     }
 }
Esempio n. 2
0
    private function _postProcess()
    {
        if (Tools::isSubmit('btnSubmit')) {
            $categoryBox = Tools::getValue('categoryBox');
            if ($categoryBox and is_array($categoryBox) and count($categoryBox)) {
                foreach ($categoryBox as $row) {
                    $cms[] = intval($row);
                }
                if (CMS::updateCmsToBlock($cms, intval($this->id))) {
                    $this->_html .= '<div class="conf confirm">' . $this->l('Cms Updated') . '</div>';
                }
            } else {
                Db::getInstance()->Execute('
				DELETE FROM `' . _DB_PREFIX_ . 'block_cms`
				WHERE `id_block` =' . intval($this->id));
            }
        }
    }