I want to write a small plugin for Joomla, which would do the following:
1. check if language is set for the current menu item,
1.1. if not, check if language is set for the currently displayed item,
2. if we have the language after step 1, switch Joomla to use that
language (for dates, standard links etc.).
I would also like to avoid any HTTP redirects or cookie dependencies.
My questions are:
Is there a way to switch Joomla's language from a plugin?
If yes, then how?
What event should I listen to in the plugin?
What type of the plugin should it be? I tried both Content and System
plugins, but still couldn't make the language to switch without an
additional redirect...
Thanks in advance for any clues.
Rimas Kudelis
2009.09.28 23:10, Ian MacLennan rašė:
> $app = &JFactory::getApplication();
> $menu = &$app->getMenu();
> $menuItem = &$menu->getActive();
Apparently, I could also just add the following line to make my previous
code work:
jimport( 'joomla.application.menu' );
> $articleId = JRequest::getInt('id'); // provided it is an article we
> are viewing
Provided that I have the id, is there an easy way to access the article
from onAfterRoute?
Rimas
I still haven't got any answer to my question below. I hope you don't
mind me re-asking: