Exemple #1
0
 /**
  * Returns the script line for including Map::api
  *
  * this method is called on first render of any script.
  * If once enabled you can get the string by setting $force_enable param to true
  *
  * @uses self::$sensor For setting the sensor in link
  * @param boolean $force_enable get the string despite the enabled static flag
  * @return string
  */
 public static function enable($force_enable = false)
 {
     if (!self::$enabled || $force_enable) {
         self::$enabled = true;
         //set the enabled flag
         $GLOBALS['TSFE']->additionalHeaderData['google-map'] = '<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=' . (Tx_Listfeusers_Gmap::getSensor() ? 'true' : 'false') . '"></script>';
         $GLOBALS['TSFE']->additionalHeaderData['listfeusers-map'] = '<script src="' . t3lib_extMgm::siteRelPath('listfeusers') . 'js/gmap.js" type="text/javascript"></script>';
     } else {
         return '';
     }
 }