A slimmed-down version of the original language menu.
This code insert to /cmsimple/userfuncs.php
Code: Select all
<?php
function simple_languagemenu() {
global $pth, $cf, $sl;
$r = XH_secondLanguages();
array_unshift($r, $cf['language']['default']);
$i = array_search($sl, $r);
unset($r[$i]);
$t = '<div class="simple_languagemenu">' . "\n";
$t .= '<span>' . $sl . '</span>';
foreach ($r as $lang) {
$url = $pth['folder']['base']
. ($lang == $cf['language']['default'] ? '' : $lang . '/');
$el = $lang;
$t .= '<a href="' . $url . '">' . $el . '</a>';
}
$t .= '</div>' . "\n";
return $t;
}
Code: Select all
<?=languagemenu();?>
Code: Select all
<?=simple_languagemenu();?>
Changes to the template will no longer be necessary.
This menu can be visually customized with the '.simple_languagemenu' class.