code: public function getPageTypes(Contao\DataContainer $dc)
  	{
  		$arrOptions = array();
  
  		foreach (array_keys($GLOBALS['TL_PTY']) as $pty)
  		{
  			// Root pages are allowed on the first level only (see #6360)
  			if ($pty == 'root' && $dc->activeRecord && $dc->activeRecord->pid > 0)
  			{
  				continue;
  			}
  
  			// Allow the currently selected option and anything the user has access to
  			if ($pty == $dc->value || $this->User->hasAccess($pty, 'alpty'))
  			{
  				$arrOptions[] = $pty;
  			}
  		}
  
  		return $arrOptions;
  	}
docs: Returns all allowed page types as array
  
  @param Contao\DataContainer $dc
  
  @return array