public function renderIdErpFeatureLinkColumn($link, $data) { // Is the controller authorized in the pack ? if (ERPControl::checkController($data['controller'])) { $html = '<a href="' . $link . '&token=' . $data['token'] . '">'; $html .= '<img src="../modules/erpillicopresta/img/features/arrow.png" alt="' . $this->l('Display selected feature') . '"/></a>'; return $html; } else { return '<a class="admin_links" href="?controller=AdminModules&configure=erpillicopresta&token=' . Tools::getAdminTokenLite('AdminModules') . '#cart_features" target="_blank">' . $this->l('Check out our upper packs !') . '</a>'; } }
public static function getFeaturesWithToken($iso_code) { //HACK : fr or en iso_code only are allowed (default) if ($iso_code != "fr") { $iso_code = "en"; } $erp_features_final = array(); $order = 'order'; //Query $sql = 'SELECT ef.id_erpip_feature, ef.key1, ef.key2, ef.controller, ef.picture, ef.status, efl.name'; $sql .= ' FROM ' . _DB_PREFIX_ . 'erpip_feature ef '; $sql .= ' INNER JOIN ' . _DB_PREFIX_ . 'erpip_feature_language efl ON ef.id_erpip_feature = efl.id_erpip_feature '; $sql .= ' AND efl.iso_code = "' . $iso_code . '"'; $sql .= ' ORDER BY `' . $order . '` ASC'; $erp_features = Db::getInstance()->executeS($sql); if (!empty($erp_features)) { foreach ($erp_features as $feature) { $feature['token'] = Tools::getAdminTokenLite($feature['controller']); $feature['active'] = ERPControl::checkController($feature['controller']); $erp_features_final[] = $feature; } } return $erp_features_final; }