public function getCategories( array $config, $tceForms = null, $sitecode = 'default' )
	{
		try
		{
			if( isset( $config['flexParentDatabaseRow']['pid'] ) ) { // TYPO3 7+
				$pid = $config['flexParentDatabaseRow']['pid'];
			} elseif( isset( $config['row']['pid'] ) ) { // TYPO3 6.2
				$pid = $config['row']['pid'];
			} else {
				throw new \Exception( 'No PID found in "flexParentDatabaseRow" or "row" array key: ' . print_r( $config, true ) );
			}

			$pageTSConfig = \TYPO3\CMS\Backend\Utility\BackendUtility::getModTSconfig( $pid, 'tx_aimeos' );

			if( isset( $pageTSConfig['properties']['mshop.']['locale.']['site'] ) ) {
				$sitecode = $pageTSConfig['properties']['mshop.']['locale.']['site'];
			}


			$context = Base::getContext( Base::getConfig() );
			$context->setEditor( 'flexform' );

			$localeManager = \Aimeos\MShop::create( $context, 'locale' );
			$context->setLocale( $localeManager->bootstrap( $sitecode, '', '', false ) );

			$manager = \Aimeos\MShop::create( $context, 'catalog' );
			$item = $manager->getTree( null, array(), \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE );


			$config['items'] = array_merge( $config['items'], $this->getCategoryList( $item, $item->getName() ) );
		}
		catch( \Exception $e )
		{
			error_log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
		}

		return $config;
	}