'guide', 'en' => 'guide', ); $str_rewrite_rules = 'RewriteRule ^%s/([0-9]+)\-[a-zA-Z0-9-]*$ '.__PS_BASE_URI__.'modules/'.$module_name.'/page.php?id_guide_post=$1 [QSA,L]'."\n"; if(count($langs) > 1) { $rewrite_rules = ''; foreach($langs as $lang) { if(isset($urls_i18n[$lang['iso_code']])) { $index = $lang['iso_code']; } else { $index = 'en'; } $rewrite_rules .= sprintf($str_rewrite_rules, $lang['iso_code'].'/'.$urls_i18n[$index]); } } else { if(isset($urls_i18n[$langs[0]['iso_code']])) { $index = $langs[0]['iso_code']; } else { $index = 'en'; } $rewrite_rules = sprintf($str_rewrite_rules, $urls_i18n[$index]); } $smarty->assign('rewrite_rules', htmlentities($rewrite_rules)); echo $smarty->fetch(__DIR__.'/templates/home_adminguide.tpl'); } } }