Code source pour générer une url propre avec sh404sef pour le composant Joomap
Pour avoir un beau lien /plan-du-site/ pour le composant Joomap avec sh404sef il faut créer deux fichiers :
fichier de langue com_joomap.php dans /administrator/components/com_sh404sef/language/plugins
<?php
if (!defined('_JEXEC')) die('Direct Access to this location is not allowed.');
// {shSourceVersionTag: Version 1.0 - 2009-10-14}
// français
$sh_LANG['fr']['_COM_SEF_JOOMAP_NAME'] = 'plan du site';
$sh_LANG['en']['_COM_SEF_JOOMAP_NAME'] = 'site map';
?>
fichier de plugins com_joomap.php dans/components/com_sh404sef/sef_ext
<?php
/**
* sh404SEF support for com_joomap component.
* {shSourceVersionTag: Version 1.0 - 2009-10-14}
* nico@24bis.com
*/
defined( '_JEXEC' ) or die( 'Direct Access to this location is not allowed.' );
// ------------------ standard plugin initialize function - don't change ---------------------------
global $sh_LANG;
$sefConfig = & shRouter::shGetConfig();
$shLangName = '';
$shLangIso = '';
$title = array();
$shItemidString = '';
$dosef = shInitializePlugin( $lang, $shLangName, $shLangIso, $option);
if ($dosef == false) return;
// ------------------ standard plugin initialize function - don't change ---------------------------
// ------------------ load language file - adjust as needed ----------------------------------------
$shLangIso = shLoadPluginLanguage( 'com_joomap', $shLangIso, '_COM_SEF_JOOMAP_NAME');
// ------------------ load language file - adjust as needed ----------------------------------------
$task = isset($task) ? $task : null;
switch ($task) {
default:
$title[] = $sh_LANG[$shLangIso]['_COM_SEF_JOOMAP_NAME']; //"plan du site";
break;
}
$title[] = '/'; // V 1.2.4.s
shRemoveFromGETVarsList('option');
shRemoveFromGETVarsList('Itemid');
shRemoveFromGETVarsList('lang');
// ------------------ standard plugin finalize function - don't change ---------------------------
if ($dosef){
$string = shFinalizePlugin( $string, $title, $shAppendString, $shItemidString,
(isset($limit) ? @$limit : null), (isset($limitstart) ? @$limitstart : null),
(isset($shLangName) ? @$shLangName : null));
}
// ------------------ standard plugin finalize function - don't change ---------------------------
?>