framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php
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;
    }
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;
    }
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 ; }
Returns true if directory is not empty

@access public
@static
@param string $clientPath client path (with trailing slash)
@param object $_resourceType resource type configuration
@return boolean
Returns true if directory is not empty