FasterJoomla

Joomla security and optimization

Visita il nuovo sito FasterJoomla che raccoglie i nostri articoli ed estensioni per Joomla!

Si parla di sicurezza, velocità, sviluppo di estensioni per Joomla.

Trovate pubblicate anche le nostre guide pratiche.

The module Qivva Eventlist Calendar Module for Joomla 1.6 is a nice Ajax calendar that presents events from the component EventList.

There is a bug switching month when SEF rewrite is on and / or the parameter Remember = 1 and / or the module is loaded with Modules Anywhere.  The fix is quick and easy:

File /modules/mod_eventlistcalqajax/mod_eventlistcalqajax.php roughly at line 55 we need to use JApplication::getUserState instead of $mainframe->getUserState.  Change the code as follows:

	if ($Remember == 1) // Remember which month / year is selected. Don't jump back to tday on page change
{
/*
* Riccardo Zorn: changed $mainframe-> to $JApplication:: (supported); if Remember is enabled we could go here!
* */
jimport( 'joomla.application.application' );// zorn

if ($req_month == 0)
{
$req_month = JApplication::getUserState("eventlistcalqmonth".$module->id);
$req_year = JApplication::getUserState("eventlistcalqyear".$module->id);
}
else
{
JApplication::setUserState("eventlistcalqmonth".$module->id,$req_month);
JApplication::setUserState("eventlistcalqyear".$module->id,$req_year);
}
}

file /modules/mod_eventlistcalqajax/mod_ajaxloader.php after line 40:

$mainframe->initialise();

/*
* Riccardo Zorn: added as global, fallback read from the get parameters.
* */
global $Itemid;

if (!isset($Itemid)) {
$Itemid = JRequest::getInt('Itemid', 0);
}
/* end of change */

This is it.

(if you are also using Modules Anywhere, make sure the module is published on all pages, otherwise the previous/next month will not work in Ajax mode!)