Language selection
From FundaWiki
Requires CVS version from January 12th, 2007
A new method has been added to the html object used in templates. The new method prints templated links to the frontpage of each language in the menu.
The signature is
printLanguageSelection($layout = null, $languages = null)
where layout is an array describing the layout of each menu item, and languages is an array of the languages that should be included in the list. By default all languages are shown - and the frontpage for each language is either selected from the frontpageIds argument sent to the html() constructor or the top most page in each language menu.
[edit]
Drop down selection box
print '<select onchange="document.location.href = this.options[this.selectedIndex].value;">';
$parser->printLanguageSelection(
array(
'active' => '<option value="URL" selected>LANG</option>',
'inactive' => '<option value="URL">LANG</option>',
)
);
print '</select>';
[edit]
Flag icons
$parser->printLanguageSelection(
array(
'active' => '<a href="URL"><img src="/gfx/LANG-lang.png" style="border: 1px solid black;"></a>',
'inactive' => '<a href="URL"><img src="/gfx/LANG-lang.png" style="border: 1px solid white;"></a>',
'separator' => ' '
)
);
