public static function hasChildren($clientPath, $_resourceType)
    {
        $serverPath = CKFinder_Connector_Utils_FileSystem::combinePaths($_resourceType->getDirectory(), $clientPath);

        if (!is_dir($serverPath) || (false === $fh = @opendir($serverPath))) {
            return false;
        }

        $hasChildren = false;
        while (false !== ($filename = readdir($fh))) {
            if ($filename == '.' || $filename == '..') {
                continue;
            } else if (is_dir($serverPath . $filename)) {
                //we have found valid directory
                $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
                $_acl = $_config->getAccessControlConfig();
                $_aclMask = $_acl->getComputedMask($_resourceType->getName(), $clientPath . $filename);
                if ( ($_aclMask & CKFINDER_CONNECTOR_ACL_FOLDER_VIEW) != CKFINDER_CONNECTOR_ACL_FOLDER_VIEW ) {
                    continue;
                }
                if ($_resourceType->checkIsHiddenFolder($filename)) {
                  continue;
                }

                $hasChildren = true;
                break;
            }
        }

        closedir($fh);

        return $hasChildren;
    }