function inizialize($css_style, $offset, &$params) { $theme = $params->get('theme', 'blue'); JHtml::_('behavior.framework', true); $doc = JFactory::getDocument(); $helper = new modRokajaxsearchHelper(); $css = $helper->getCSSPath('rokajaxsearch.css', 'mod_rokajaxsearch'); $iebrowser = $helper->getBrowser(); if ($css_style == 1 && $css != false) { $doc->addStyleSheet($css); $doc->addStyleSheet(JURI::root(true) . "/modules/mod_rokajaxsearch/themes/{$theme}/rokajaxsearch-theme.css"); if ($iebrowser) { $style = JURI::root(true) . "/modules/mod_rokajaxsearch/themes/{$theme}/rokajaxsearch-theme-ie{$iebrowser}"; $check = dirname(__FILE__) . "/themes/{$theme}/rokajaxsearch-theme-ie{$iebrowser}"; if (file_exists($check . ".css")) { $doc->addStyleSheet($style . ".css"); } elseif (file_exists($check . ".php")) { $doc->addStyleSheet($style . ".php"); } } } $doc->addScript(JURI::root(true) . "/modules/mod_rokajaxsearch/js/rokajaxsearch" . self::_getJSVersion() . ".js"); /* RokAjaxSearch Init */ $websearch = $params->get('websearch', 0) ? 1 : 0; $blogsearch = $params->get('blogsearch', 0) ? 1 : 0; $imagesearch = $params->get('imagesearch', 0) ? 1 : 0; $videosearch = $params->get('videosearch', 0) ? 1 : 0; $ras_init = "window.addEvent((window.webkit) ? 'load' : 'domready', function() {\n\t\t\t\twindow.rokajaxsearch = new RokAjaxSearch({\n\t\t\t\t\t'results': '" . JText::_('RESULTS') . "',\n\t\t\t\t\t'close': '',\n\t\t\t\t\t'websearch': " . $websearch . ",\n\t\t\t\t\t'blogsearch': " . $blogsearch . ",\n\t\t\t\t\t'imagesearch': " . $imagesearch . ",\n\t\t\t\t\t'videosearch': " . $videosearch . ",\n\t\t\t\t\t'imagesize': '" . $params->get('image_size', 'MEDIUM') . "',\n\t\t\t\t\t'safesearch': '" . $params->get('safesearch', 'MODERATE') . "',\n\t\t\t\t\t'search': '" . JText::_('SEARCH') . "',\n\t\t\t\t\t'readmore': '" . JText::_('READMORE') . "',\n\t\t\t\t\t'noresults': '" . JText::_('NORESULTS') . "',\n\t\t\t\t\t'advsearch': '" . JText::_('ADVSEARCH') . "',\n\t\t\t\t\t'page': '" . JText::_('PAGE') . "',\n\t\t\t\t\t'page_of': '" . JText::_('PAGE_OF') . "',\n\t\t\t\t\t'searchlink': '" . JRoute::_(JURI::Base() . htmlentities($params->get('search_page')), true) . "',\n\t\t\t\t\t'advsearchlink': '" . JRoute::_(JURI::Base() . htmlentities($params->get('adv_search_page')), true) . "',\n\t\t\t\t\t'uribase': '" . JRoute::_(JURI::Base(), true) . "',\n\t\t\t\t\t'limit': '" . $params->get('limit', '10') . "',\n\t\t\t\t\t'perpage': '" . $params->get('perpage', '3') . "',\n\t\t\t\t\t'ordering': '" . $params->get('ordering', 'newest') . "',\n\t\t\t\t\t'phrase': '" . $params->get('searchphrase', 'any') . "',\n\t\t\t\t\t'hidedivs': '" . $params->get('hide_divs', '') . "',\n\t\t\t\t\t'includelink': " . $params->get('include_link', 1) . ",\n\t\t\t\t\t'viewall': '" . JText::_('VIEWALL') . "',\n\t\t\t\t\t'estimated': '" . JText::_('ESTIMATED') . "',\n\t\t\t\t\t'showestimated': " . $params->get('show_estimated', 1) . ",\n\t\t\t\t\t'showpagination': " . $params->get('show_pagination', 1) . ",\n\t\t\t\t\t'showcategory': " . $params->get('include_category', 1) . ",\n\t\t\t\t\t'showreadmore': " . $params->get('show_readmore', 1) . ",\n\t\t\t\t\t'showdescription': " . $params->get('show_description', 1) . "\n\t\t\t\t});\n\t\t\t});"; $doc->addScriptDeclaration($ras_init); /* Google API */ if ($params->get('websearch', 0) == 1 && $params->get('websearch_api') != '') { $doc->addScript("http://www.google.com/jsapi?key=" . $params->get('websearch_api')); $doc->addScriptDeclaration("google.load('search', '1.0', {nocss: true});"); } }
function inizialize($css_style, $offset, &$params) { global $mainframe; JHTML::_('behavior.mootools'); $doc =& JFactory::getDocument(); $css = modRokajaxsearchHelper::getCSSPath('rokajaxsearch.css', 'mod_rokajaxsearch'); if ($css_style == 1 && $css != false) { $doc->addStyleSheet($css); } $doc->addScript(JURI::Root(true) . "/modules/mod_rokajaxsearch/js/rokajaxsearch.js"); if ($params->get('websearch', 0) == 1 && $params->get('websearch_api') != '') { $doc->addScript("http://www.google.com/jsapi?key=" . $params->get('websearch_api')); $doc->addScriptDeclaration("google.load('search', '1.0', {nocss: true});"); } }
<?php /** * RokAjaxSearch Module * * @package RocketTheme * @subpackage rokajaxsearch * @version 2.0.4 February 23, 2015 * @author RocketTheme http://www.rockettheme.com * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only * * * Inspired on PixSearch Joomla! module by Henrik Hussfelt <*****@*****.**> */ defined('_JEXEC') or die('Restricted access'); require_once dirname(__FILE__) . '/helper.php'; $helper = new modRokajaxsearchHelper(); $helper->inizialize($params->get('include_css'), $params->get('offset_search_result'), $params); require JModuleHelper::getLayoutPath('mod_rokajaxsearch');
<?php /** * @package mod_rokajaxsearch * @copyright Copyright (C) 2008 RocketTheme. All rights reserved. * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU/GPL, see LICENSE.php * RokAjaxSearch is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * * Inspired on PixSearch Joomla! module by Henrik Hussfelt <*****@*****.**> */ defined('_JEXEC') or die('Restricted access'); require_once dirname(__FILE__) . DS . 'helper.php'; modRokajaxsearchHelper::inizialize($params->get('include_css'), $params->get('offset_search_result'), $params); require JModuleHelper::getLayoutPath('mod_rokajaxsearch');