Skip to main content
edited tags
Link
Valentin Despa
  • 3.7k
  • 2
  • 20
  • 42

Can't access jmodulehelper load mehthodmethod in module helper file

added 1380 characters in body
Source Link
Lodder
  • 26.9k
  • 3
  • 48
  • 94

Hi i summarized detail of my question hereI am using com_ajax in joomla 2.5 - http://stackoverflow.com/questions/24689232/cant-use-jmodulehelper-class-method-in-module-helper-file buthttps://github.com/Joomla-Ajax-Interface/component

As I have many instances(duplicate modules) of same module from where I call to com_ajax component by jQuery ajax. So is com_ajax calls to my module's helper.php file to get data for ajax call as we know. Problem is I want to access parameters of another module instance in helper.php file which is not gotten any reply yetpossible by the default call $module = JModuleHelper::getModule('mod_name_here'); so I was trying to achieve this way by passing module id to helper. joomla experts please help mephp file from module's jQuery ajax call -

jimport('joomla.application.module.helper');
$input  = JFactory::getApplication()->input;
$mod_id = $input->get('module_id'); //module_id passed by ajax call             
$module = null; 
$modules = JModuleHelper::_load(); 
$total = count($modules); $name="mod_name_here";

for ($i = 0; $i < $total; $i++)
{
    // Match the name of the module
    if (($modules[$i]->name == $name || $modules[$i]->module == $name)&&($modules[$i]->id==$mod_id))
    {
        $module = $modules[$i];
        break; // Found it          
    }
}               
$params1 = new JRegistry();
$params1->loadString($module->params);

so in $params1 I am getting the settings of my desired module instance.But debugger hangs on line $modules = JModuleHelper::_load(); don't know why but when I put these same codes in a module main php file for testing, things work. So why doesn't it goes further after that line? Any alternatives?

Hi i summarized detail of my question here - http://stackoverflow.com/questions/24689232/cant-use-jmodulehelper-class-method-in-module-helper-file but have not gotten any reply yet. joomla experts please help me.

I am using com_ajax in joomla 2.5 - https://github.com/Joomla-Ajax-Interface/component

As I have many instances(duplicate modules) of same module from where I call to com_ajax component by jQuery ajax. So is com_ajax calls to my module's helper.php file to get data for ajax call as we know. Problem is I want to access parameters of another module instance in helper.php file which is not possible by the default call $module = JModuleHelper::getModule('mod_name_here'); so I was trying to achieve this way by passing module id to helper.php file from module's jQuery ajax call -

jimport('joomla.application.module.helper');
$input  = JFactory::getApplication()->input;
$mod_id = $input->get('module_id'); //module_id passed by ajax call             
$module = null; 
$modules = JModuleHelper::_load(); 
$total = count($modules); $name="mod_name_here";

for ($i = 0; $i < $total; $i++)
{
    // Match the name of the module
    if (($modules[$i]->name == $name || $modules[$i]->module == $name)&&($modules[$i]->id==$mod_id))
    {
        $module = $modules[$i];
        break; // Found it          
    }
}               
$params1 = new JRegistry();
$params1->loadString($module->params);

so in $params1 I am getting the settings of my desired module instance.But debugger hangs on line $modules = JModuleHelper::_load(); don't know why but when I put these same codes in a module main php file for testing, things work. So why doesn't it goes further after that line? Any alternatives?

Source Link
dev-m
  • 1.4k
  • 1
  • 16
  • 26

Can't access jmodulehelper load mehthod in module helper file

Hi i summarized detail of my question here - http://stackoverflow.com/questions/24689232/cant-use-jmodulehelper-class-method-in-module-helper-file but have not gotten any reply yet. joomla experts please help me.