Example #1
0
 public function connectMapsAssets($params, $forAdminArea = false)
 {
     $params['language'] = isset($params['language']) && !empty($params['language']) ? $params['language'] : utilsGmp::getLangCode2Letter();
     frameGmp::_()->addScript('google_maps_api', $this->getApiUrl() . '&language=' . $params['language']);
     frameGmp::_()->addScript('core.gmap', $this->getModule()->getModPath() . 'js/core.gmap.js');
     frameGmp::_()->addStyle('core.gmap', $this->getModule()->getModPath() . 'css/core.gmap.css');
     if (isset($params['marker_clasterer']) && $params['marker_clasterer'] != 'none' || $forAdminArea) {
         frameGmp::_()->addScript('core.markerclusterer', $this->getModule()->getModPath() . 'js/core.markerclusterer.min.js');
     }
     dispatcherGmp::doAction('afterConnectMapAssets', $params, $forAdminArea);
 }
Example #2
0
 public function loadJqGrid()
 {
     static $loaded = false;
     if (!$loaded) {
         $this->loadJqueryUi();
         frameGmp::_()->addScript('jq-grid', $this->_cdnUrl . 'lib/jqgrid/jquery.jqGrid.min.js');
         frameGmp::_()->addStyle('jq-grid', $this->_cdnUrl . 'lib/jqgrid/ui.jqgrid.css');
         $langToLoad = utilsGmp::getLangCode2Letter();
         $availableLocales = array('ar', 'bg', 'bg1251', 'cat', 'cn', 'cs', 'da', 'de', 'dk', 'el', 'en', 'es', 'fa', 'fi', 'fr', 'gl', 'he', 'hr', 'hr1250', 'hu', 'id', 'is', 'it', 'ja', 'kr', 'lt', 'mne', 'nl', 'no', 'pl', 'pt', 'pt', 'ro', 'ru', 'sk', 'sr', 'sr', 'sv', 'th', 'tr', 'tw', 'ua', 'vi');
         if (!in_array($langToLoad, $availableLocales)) {
             $langToLoad = 'en';
         }
         frameGmp::_()->addScript('jq-grid-lang', $this->_cdnUrl . 'lib/jqgrid/i18n/grid.locale-' . $langToLoad . '.js');
         $loaded = true;
     }
 }