public function registerBlockElements ()
	{
		// Don´t register twice
		if (isset($GLOBALS['TL_CTE']['CTE'])) 
		{
			return;
		}

		$db = \Database::getInstance();

		if ($db->tableExists("tl_elements"))
		{		
			$arrElements = $db->prepare("SELECT * FROM tl_elements ORDER BY sorting ASC")
							  ->execute()
							  ->fetchAllAssoc();	
		}
			
		if ($arrElements === null)
		{
			return;
		}

		// Add content blocks as content elements
		foreach ($arrElements as $arrElement)
		{
			$GLOBALS['TL_CTE']['CTE'][$arrElement['alias']] = 'Agoat\CustomContentElementsBundle\Contao\ContentElement';
			$GLOBALS['TL_LANG']['CTE'][$arrElement['alias']] = array($arrElement['title'],$arrElement['description']);
		}
	}
public function registerBlockElements ()
	{
		// Don´t register twice
		if (isset($GLOBALS['TL_CTE']['CTE'])) 
		{
			return;
		}

		$db = \Database::getInstance();

		if ($db->tableExists("tl_elements"))
		{		
			$arrElements = $db->prepare("SELECT * FROM tl_elements ORDER BY sorting ASC")
							  ->execute()
							  ->fetchAllAssoc();	
		}
			
		if ($arrElements === null)
		{
			return;
		}

		// Add content blocks as content elements
		foreach ($arrElements as $arrElement)
		{
			$GLOBALS['TL_CTE']['CTE'][$arrElement['alias']] = 'Agoat\CustomContentElementsBundle\Contao\ContentElement';
			$GLOBALS['TL_LANG']['CTE'][$arrElement['alias']] = array($arrElement['title'],$arrElement['description']);
		}
	}
public function registerBlockElements ( ) { // Don´t register twice if ( isset ( $ GLOBALS [ 'TL_CTE' ] [ 'CTE' ] ) ) { return ; } $ db = \ Database :: getInstance ( ) ; if ( $ db -> tableExists ( "tl_elements" ) ) { $ arrElements = $ db -> prepare ( "SELECT * FROM tl_elements ORDER BY sorting ASC" ) -> execute ( ) -> fetchAllAssoc ( ) ; } if ( $ arrElements === null ) { return ; } // Add content blocks as content elements foreach ( $ arrElements as $ arrElement ) { $ GLOBALS [ 'TL_CTE' ] [ 'CTE' ] [ $ arrElement [ 'alias' ] ] = 'Agoat\CustomContentElementsBundle\Contao\ContentElement' ; $ GLOBALS [ 'TL_LANG' ] [ 'CTE' ] [ $ arrElement [ 'alias' ] ] = array ( $ arrElement [ 'title' ] , $ arrElement [ 'description' ] ) ; } }
Adds the content elements from the database to the config array
Adds the content elements from the database to the config array