/**
  * FOOTER
  * @param $params
  * @return mixed
  */
 public function hookFooter($params)
 {
     if (Configuration::get('NOW_FOOTER_ENABLE')) {
         // Lists of columns
         $aNowBlockFooterCmsColumn = NowBlockFooterCmsColumn::getColumns();
         // Lists of links
         $aNowBlockFooterCms = NowBlockFooterCms::getLinks();
         $aNowBlockFooterCmsByColumnId = array();
         foreach ($aNowBlockFooterCms as $oNowBlockFooterCms) {
             $oNewNowBlockFooterCms = $oNowBlockFooterCms;
             if ($oNowBlockFooterCms->type == NowBlockFooterCms::TYPE_CMS) {
                 $oNewNowBlockFooterCms->object = new CMS($oNowBlockFooterCms->id_type, Context::getContext()->language->id);
             } elseif ($oNowBlockFooterCms->type == NowBlockFooterCms::TYPE_CATEGORY) {
                 $oNewNowBlockFooterCms->object = new Category($oNowBlockFooterCms->id_type, Context::getContext()->language->id);
             } elseif ($oNowBlockFooterCms->type == NowBlockFooterCms::TYPE_MANUFACTURER) {
                 $oNewNowBlockFooterCms->object = new Manufacturer($oNowBlockFooterCms->id_type, Context::getContext()->language->id);
             }
             $aNowBlockFooterCmsByColumnId[$oNowBlockFooterCms->id_now_block_cms_footer_column][] = $oNewNowBlockFooterCms;
         }
         $aNowBlockFooterCmsByColumnIdGood = array();
         foreach ($aNowBlockFooterCmsByColumnId as $id => $aColumn) {
             $aNowBlockFooterCmsByColumnIdGood[$id] = array_chunk($aColumn, Configuration::get('NOW_MAX_LINE_BY_COLUMN'));
         }
         $this->context->smarty->assign(array('aNowBlockFooterCmsByColumnIds' => $aNowBlockFooterCmsByColumnIdGood, 'aNowBlockFooterCmsColumns' => $aNowBlockFooterCmsColumn));
         return $this->context->smarty->fetch($this->module_dir . 'views/templates/hook/footer.tpl');
     }
 }
 /**
  * @return mixed
  */
 public function renderFormLink()
 {
     $this->context->smarty->assign(array('back_url_override' => self::$currentIndex . '&id_now_block_cms_footer_column=' . Tools::getValue('id_now_block_cms_footer_column', $this->object->id_now_block_cms_footer_column) . '&detailsnow_block_cms_footer_column&token=' . $this->token));
     $obj = $this->loadObject(true);
     $this->fields_form = array('legend' => array('title' => $this->module->l('Link', 'AdminNowBlockFooterCms'), 'icon' => 'icon-list-alt'), 'input' => array(array('type' => 'select', 'label' => $this->module->l('Column', 'AdminNowBlockFooterCms'), 'name' => 'id_now_block_cms_footer_column', 'options' => array('query' => NowBlockFooterCmsColumn::getColumns($this->context->language->id, true, true), 'id' => 'id_now_block_cms_footer_column', 'name' => 'name')), array('type' => 'select', 'label' => $this->module->l('Type of link', 'AdminNowBlockFooterCms'), 'name' => 'type', 'required' => true, 'default_value' => NowBlockFooterCms::TYPE_LINK, 'options' => array('query' => array(array('id_type' => NowBlockFooterCms::TYPE_CATEGORY, 'type' => $this->module->l('Category', 'AdminNowBlockFooterCms')), array('id_type' => NowBlockFooterCms::TYPE_CMS, 'type' => $this->module->l('CMS', 'AdminNowBlockFooterCms')), array('id_type' => NowBlockFooterCms::TYPE_LINK, 'type' => $this->module->l('Link', 'AdminNowBlockFooterCms')), array('id_type' => NowBlockFooterCms::TYPE_MANUFACTURER, 'type' => $this->module->l('Manufacturer', 'AdminNowBlockFooterCms'))), 'id' => 'id_type', 'name' => 'type')), array('type' => 'text', 'label' => $this->module->l('ID type', 'AdminNowBlockFooterCms'), 'name' => 'id_type', 'form_group_class' => 'idTypeDiv'), array('type' => 'categories', 'label' => $this->l('Category', 'AdminNowBlockFooterCms'), 'name' => 'category', 'tree' => array('id' => 'categories-tree', 'selected_categories' => array($obj->type == 'category' ? $obj->id_type : '')), 'form_group_class' => 'categoryDiv'), array('type' => 'select', 'label' => $this->module->l('CMS', 'AdminNowBlockFooterCms'), 'name' => 'cms', 'options' => array('query' => CMS::listCms($this->context->language->id), 'id' => 'id_cms', 'name' => 'meta_title'), 'form_group_class' => 'cmsDiv'), array('type' => 'select', 'label' => $this->module->l('Manufacturer', 'AdminNowBlockFooterCms'), 'name' => 'manufacturer', 'options' => array('query' => Manufacturer::getManufacturers(false, $this->context->language->id), 'id' => 'id_manufacturer', 'name' => 'name'), 'form_group_class' => 'manufacturerDiv'), array('type' => 'text', 'label' => $this->module->l('Link', 'AdminNowBlockFooterCms'), 'name' => 'link', 'form_group_class' => 'linkDiv', 'lang' => true), array('type' => 'text', 'label' => $this->module->l('Name', 'AdminNowBlockFooterCms'), 'name' => 'name', 'lang' => true, 'desc' => $this->module->l('Complete this field only if you want to change the name that will appear in the footer.', 'AdminNowBlockFooterCms')), array('type' => 'switch', 'label' => $this->module->l('Enable', 'AdminNowBlockFooterCms'), 'name' => 'active', 'required' => false, 'is_bool' => true, 'values' => array(array('id' => 'active_on', 'value' => 1, 'label' => $this->module->l('Enabled', 'AdminNowBlockFooterCms')), array('id' => 'active_off', 'value' => 0, 'label' => $this->module->l('Disabled', 'AdminNowBlockFooterCms'))))), 'submit' => array('title' => $this->module->l('Save', 'AdminNowBlockFooterCms')));
     return parent::renderForm();
 }