define('_JEXEC', 1); define('DS', DIRECTORY_SEPARATOR); define('ABSOLUTE_PATH', dirname(__FILE__)); define('RELATIVE_PATH', 'modules' . DS . 'mod_ecwid_customsearch'); define('JPATH_BASE', str_replace(RELATIVE_PATH, "", ABSOLUTE_PATH)); require_once JPATH_BASE . DS . 'includes' . DS . 'defines.php'; require_once JPATH_BASE . DS . 'includes' . DS . 'framework.php'; require_once dirname(__FILE__) . DS . 'helper.php'; // include Rokecwid component files $rokecwidPath = JPATH_SITE . DS . 'components' . DS . 'com_rokecwid' . DS . 'helpers'; require_once $rokecwidPath . DS . 'ecwid_product_api.php'; require_once $rokecwidPath . DS . 'ecwid_catalog.php'; $mainframe =& JFactory::getApplication('site'); $mainframe->initialise(); $lang =& JFactory::getLanguage(); $lang->load("mod_ecwid_customsearch", JPATH_BASE); modEcwidCustomSearch::init(); $task = JRequest::getVar("task"); switch ($task) { case "autocomplete": modEcwidCustomSearch::autocompleteAction(); break; case "brands": modEcwidCustomSearch::brandsAction(); break; case "types": modEcwidCustomSearch::typesAction(); break; default: break; }