public function addContentElementsJS ($strBuffer='', $objTemplate=null)
	{
		if ($GLOBALS['TL_CTB_JS'] == '')
		{
			return $strBuffer;
		}

		$strKey = substr(md5('js' . $GLOBALS['TL_CTB_JS']), 0, 12);
		$strPath = 'assets/js/' . $strKey . '.js';
		
		// Write to a temporary file in the assets folder
		if (!file_exists($strPath))
		{
			$objFile = new File($strPath, true);
			$objFile->write($GLOBALS['TL_CTB_JS']);
			$objFile->close();
		}
			
		$strPath .= '|static';
		
		// add file path to TL_JAVASCRIPT
		$GLOBALS['TL_JAVASCRIPT'][] = $strPath;

		return $strBuffer;
	}
public function addContentElementsJS ($strBuffer='', $objTemplate=null)
	{
		if ($GLOBALS['TL_CTB_JS'] == '')
		{
			return $strBuffer;
		}

		$strKey = substr(md5('js' . $GLOBALS['TL_CTB_JS']), 0, 12);
		$strPath = 'assets/js/' . $strKey . '.js';
		
		// Write to a temporary file in the assets folder
		if (!file_exists($strPath))
		{
			$objFile = new File($strPath, true);
			$objFile->write($GLOBALS['TL_CTB_JS']);
			$objFile->close();
		}
			
		$strPath .= '|static';
		
		// add file path to TL_JAVASCRIPT
		$GLOBALS['TL_JAVASCRIPT'][] = $strPath;

		return $strBuffer;
	}
public function addContentElementsJS ( $ strBuffer = '' , $ objTemplate = null ) { if ( $ GLOBALS [ 'TL_CTB_JS' ] == '' ) { return $ strBuffer ; } $ strKey = substr ( md5 ( 'js' . $ GLOBALS [ 'TL_CTB_JS' ] ) , 0 , 12 ) ; $ strPath = 'assets/js/' . $ strKey . '.js' ; // Write to a temporary file in the assets folder if ( ! file_exists ( $ strPath ) ) { $ objFile = new File ( $ strPath , true ) ; $ objFile -> write ( $ GLOBALS [ 'TL_CTB_JS' ] ) ; $ objFile -> close ( ) ; } $ strPath .= '|static' ; // add file path to TL_JAVASCRIPT $ GLOBALS [ 'TL_JAVASCRIPT' ] [ ] = $ strPath ; return $ strBuffer ; }
Adds Javascript created in content elements templates to the TL_JAVASCRIPT global

@param string   $strBuffer
@param Template $objTemplate

@return string
Adds Javascript created in content elements templates to the TL_JAVASCRIPT global