Exemplo n.º 1
0
 /**
  * Constructor
  *
  * @param   object  $params     backend parameters
  * @param   int     $module_id  the id of the module
  */
 public function __construct(&$params, $moduleid)
 {
     // Call the parent constructor
     parent::__construct();
     // Get the parameters
     $this->_getParams($params);
     // Include Javascripts if AJAX search activated
     if ($this->getConfig('ajaxsearch') == 1) {
         $searchurl = JURI::Base();
         $doc = JFactory::getDocument();
         // Include javascripts if not already done
         JHtml::_('behavior.framework', true);
         $doc->addScript(JURI::base() . 'media/mod_joomsearch/mod_joomsearch.js');
         $jsstart = "    window.addEvent('domready', function(){\n        jsmod" . $moduleid . "=new JoomSearchModule({searchurl: '" . $searchurl . "', moduleid:" . $moduleid . ", noresultstxt:'" . JText::_('JSNORESULTS') . "', baseURL: '" . JURI::base() . "'});\n        jsmod" . $moduleid . ".initoptions();\n      });";
         $doc->addScriptDeclaration($jsstart);
     }
     // Include common css
     // TODO
     // #js_searchform and #js_searchresults
     // $doc->addStyleSheet(JURI::base().'modules/mod_joomsearch/assets/mod_joomsearch.css');
     // Generate and include css
     $this->_renderCSS($moduleid);
     // Check cookie and fill the params for user panel
     // first view = default backend parameters
     // or existing cookie vars
     $this->_checkCookie($moduleid);
 }