public static function init() { // init firebug //$firephp = FirePHP::getInstance(true); //$firephp->registerErrorHandler(); //$firephp->registerExceptionHandler(); //$firephp->registerAssertionHandler(); $modulePath = 'modules/mod_ecwid_customsearch/'; $path = str_replace($modulePath, "", JURI::base()); self::$path = $path . 'modules/mod_ecwid_customsearch/'; $app =& JFactory::getApplication(); $params =& $app->getParams("com_rokecwid"); self::$storeId = $params->get('storeID', 1003); // init scripts and styles JHTML::script('jquery-1.7.1.min.js', self::$path . 'assets/js/jquery/'); JHTML::script('jquery-ui-1.8.17.custom.min.js', self::$path . 'assets/js/jquery-ui/js/'); JHTML::script('jquery.cookie.js', self::$path . 'assets/js/jquery/'); JHTML::script('jquery.noconflict.js', self::$path . 'assets/js/jquery/'); JHTML::script('purl.js', self::$path . 'assets/js/'); JHTML::script('customsearch.js?1.0', self::$path . 'assets/js/'); JHTML::stylesheet('jquery-ui-1.8.17.custom.css', self::$path . 'assets/js/jquery-ui/css/ui-lightness/'); JHTML::stylesheet('styles.css', self::$path . 'assets/css/'); // init inline scripts $doc =& JFactory::getDocument(); $result = "EcwidCustomPlugins.baseUrl = '" . JURI::base() . "';"; $doc->addScriptDeclaration($result); }
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; }
<?php // no direct access defined('_JEXEC') or die('Restricted access'); require_once dirname(__FILE__) . '/helper.php'; // check for existing rockecwid component (need for shop settings) $rokecwidPath = JPATH_SITE . '/components/com_rokecwid/helpers'; if (!file_exists($rokecwidPath . '/ecwid_catalog.php') || !file_exists($rokecwidPath . '/ecwid_product_api.php')) { print "Need Rokecwid component for this module"; } else { $bootstrap = new Ecwidgateway_Bootstrap(); $mProduct = new EcwidgatewayModelProducts(); $product = $mProduct->getProductOfMonth(); $seasonProduct = $product->name; modEcwidCustomSearch::init(); require JModuleHelper::getLayoutPath('mod_ecwid_customsearch'); }