?> <a onclick="return false;" class="lofaddnew-block-item lofaddnew-block-<?php echo $id_position; ?> " href="<?php echo _MODULE_DIR_ . $this->name . '/popup.php?id_shop=' . (int) $this->context->shop->id . '&id_position=' . $id_position . '&addBlock&bo_theme=' . $employee->bo_theme . '&id_divposition=lofposition-' . $id_position . '&id_lang=' . $cookie->id_lang . '&nb=' . count($blocks) . '&token=' . Tools::getValue('token') . '&secure_key=' . $this->secure_key; ?> " title="add"><img border="0" src="../img/admin/add.gif"/><?php echo $this->l('Add new block'); ?> </a><br/> <?php } if ($blocks) { foreach ($blocks as $key => $b) { $items = LofBlock::getItems($b['id_loffc_block'], $cookie->id_lang); $obj = new LofBlock($b['id_loffc_block']); echo $key % 3 == 0 ? '<div class="clear"> </div>' : ''; ?> <div class="lof-block <?php echo $key % 3 == 2 ? 'lof-block-right' : ''; ?> "> <form id="form-<?php echo $b['id_loffc_block']; ?> " action="<?php echo $this->base_config_url . '&rand=' . rand(); ?> " method="post" enctype="multipart/form-data"> <div class="lof-load" style="display:none;"></div>
/** * Proccess module by hook * $pparams: param of module * $pos: position call */ function processHook($pparams = array(), $pos = "footer") { global $smarty, $cookie, $lofPosition; //load param $params = $this->_params; $module_theme = $params->get('theme', 'default'); $module_class = $params->get('class', 'customfooter'); if (!$lofPosition) { return ''; } $positions = array(); $widths = array(); foreach ($lofPosition as $key => $p) { $blocks = LofBlock::getBlocks($p, $cookie->id_lang); if ($blocks) { $nbw = 0; $tw = 0; $arrblocks = array(); foreach ($blocks as &$b) { $items = LofBlock::getItems($b['id_loffc_block'], $cookie->id_lang); if ($items) { foreach ($items as &$i) { if ($i['type'] == 'link') { $i['link_item'] = htmlentities($this->getLinkItem($i['link_content'], $i['linktype'])); } elseif ($i['type'] == 'module') { $i['module'] = $this->getModuleAssign($i['module_name'], $i['hook_name']); } } if ($b['width'] > 0) { $nbw += 1; } $tw += $b['width']; $b['items'] = $items; $arrblocks[] = $b; } } if ($arrblocks) { $widths[$key]['nbw'] = $nbw; $widths[$key]['tw'] = $tw; $positions[$key] = $arrblocks; } } } $posis = $this->calWidth($positions, $widths); //echo "<pre>".print_r($posis,1); die; $smarty->assign(array('lofpositions' => $posis, 'module_theme' => $module_theme, 'pos' => $pos, 'module_class' => $module_class)); return $this->display(__FILE__, 'tmpl/' . $module_theme . '/default.tpl'); }
} elseif (Tools::getValue('type') == 'custom_html') { $objItem->text = $texts; } elseif (Tools::getValue('type') == 'gmap') { $objItem->latitude = Tools::getValue('latitude'); $objItem->longitude = Tools::getValue('longitude'); } elseif (Tools::getValue('type') == 'addthis') { $objItem->addthis = 1; } $objItem->title = $titles; $objItem->show_title = Tools::getValue('show_title'); if (!$objItem->id_loffc_block_item) { if (!$objItem->add()) { $errors[] = $module->l('An error occurred while creating object'); } else { $module->_clearCache("blockadvfooter.tpl"); $items = LofBlock::getItems($objItem->id_loffc_block, $cookie->id_lang); $id_loftable = Tools::getValue('id_loftable'); if ($id_loftable) { ?> <script type="text/javascript"> jQuery(document).ready(function(){ var parentWindow = $( parent.document.body ); parentWindow.find("#<?php echo $id_loftable; ?> tbody").append('\ <tr id="tr_<?php echo $objItem->id_loffc_block; ?> _<?php echo $objItem->id;
/** * Proccess module by hook * $pparams: param of module * $pos: position call */ function processHook($pparams = array(), $pos = "footer") { $cookie = $this->context->cookie; //if (!$this->isCached('blockadvfooter.tpl', $this->getCacheId(null))){ global $smarty, $cookie, $lofPosition; //load param $params = $this->_params; $module_theme = $params->get('theme', 'default'); $module_class = $params->get('class', 'customfooter'); if (!$lofPosition) { return ''; } $positions = array(); $widths = array(); foreach ($lofPosition as $key => $p) { $blocks = LofBlock::getBlocks($p, $cookie->id_lang); if ($blocks) { $nbw = 0; $tw = 0; $arrblocks = array(); foreach ($blocks as &$b) { if ($b['is_link']) { $b['link_item'] = htmlentities($this->getLinkItem($b['link_content'], $b['linktype'])); if (isset($_GET['category_rewrite']) && $_GET['category_rewrite'] == $b['link_content']) { $b['link_item'] = '#'; } else { if (isset($_GET['cms_rewrite']) && $b['linktype'] == "cms") { $oCMS = new CMS($b['link_content'], $cookie->id_lang); if ($oCMS->link_rewrite == $_GET['cms_rewrite']) { $b['link_item'] = '#'; } } } } $items = LofBlock::getItems($b['id_loffc_block'], $cookie->id_lang); if ($items) { foreach ($items as &$i) { if ($i['type'] == 'link') { //var_dump($_GET);exit(); $i['link_item'] = htmlentities($this->getLinkItem($i['link_content'], $i['linktype'])); if (isset($_GET['category_rewrite']) && $_GET['category_rewrite'] == $i['link_content']) { $i['link_item'] = '#'; } else { if (isset($_GET['cms_rewrite']) && $i['linktype'] == "cms") { $oCMS = new CMS($i['link_content'], $cookie->id_lang); if ($oCMS->link_rewrite == $_GET['cms_rewrite']) { $i['link_item'] = '#'; } } else { if (isset($_GET['controller']) && $_GET['controller'] == $i['link_content']) { $i['link_item'] = '#'; } } } } elseif ($i['type'] == 'module') { $i['module'] = $this->getModuleAssign($i['module_name'], $i['hook_name']); } } if ($b['width'] > 0) { $nbw += 1; } $tw += $b['width']; $b['items'] = $items; $arrblocks[] = $b; } } if ($arrblocks) { $widths[$key]['nbw'] = $nbw; $widths[$key]['tw'] = $tw; $positions[$key] = $arrblocks; } } } $posis = $this->calWidth($positions, $widths); //var_dump($posis);exit(); $smarty->assign(array('lofpositions' => $posis, 'module_theme' => $module_theme, 'pos' => $pos, 'module_class' => $module_class)); //} return $this->display(__FILE__, 'blockadvfooter.tpl', $this->getCacheId(null)); }