public function ajaxTreeView($strFolder, $level)
{
if (!\Environment::get('isAjaxRequest')) {
return '';
}
/** @var SessionInterface $objSession */
$objSession = \System::getContainer()->get('session');
$blnClipboard = false;
$arrClipboard = $objSession->get('CLIPBOARD');
// Check clipboard
if (!empty($arrClipboard[$this->strTable])) {
$blnClipboard = true;
$arrClipboard = $arrClipboard[$this->strTable];
}
$blnProtected = true;
$strPath = $strFolder;
// Check for public parent folders (see #213)
while ($strPath != '' && $strPath != '.') {
if (file_exists(TL_ROOT . '/' . $strPath . '/.public')) {
$blnProtected = false;
break;
}
$strPath = dirname($strPath);
}
$this->import('Files');
$this->import('BackendUser', 'User');
return $this->generateTree(TL_ROOT . '/' . $strFolder, $level * 20, false, $blnProtected, $blnClipboard ? $arrClipboard : false);
}