当前位置: 首页>>代码示例>>PHP>>正文


PHP GetResourceTypeDirectory函数代码示例

本文整理汇总了PHP中GetResourceTypeDirectory函数的典型用法代码示例。如果您正苦于以下问题:PHP GetResourceTypeDirectory函数的具体用法?PHP GetResourceTypeDirectory怎么用?PHP GetResourceTypeDirectory使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GetResourceTypeDirectory函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ServerMapFolder

function ServerMapFolder($resourceType, $folderPath, $sCommand)
{
    // Get the resource type directory.
    $sResourceTypePath = GetResourceTypeDirectory($resourceType, $sCommand);
    // Ensure that the directory exists.
    $sErrorMsg = CreateServerFolder($sResourceTypePath);
    if ($sErrorMsg != '') {
        SendError(1, "Error creating folder \"{$sResourceTypePath}\" ({$sErrorMsg})");
    }
    // Return the resource type directory combined with the required path.
    return CombinePaths($sResourceTypePath, $folderPath);
}
开发者ID:golfcrseven,项目名称:scsuper,代码行数:12,代码来源:io.php

示例2: ServerMapFolder

function ServerMapFolder($resourceType, $folderPath, $sCommand)
{
    global $Config;
    // Get the resource type directory.
    $sResourceTypePath = GetResourceTypeDirectory($resourceType, $sCommand);
    // Ensure that the directory exists.
    $sErrorMsg = CreateServerFolder($sResourceTypePath);
    if ($sErrorMsg != '') {
        SendError(1, "Ошибка создания папки \"{$sResourceTypePath}\" ({$sErrorMsg})");
    }
    if ($Config['ThumbList'] && $resourceType == 'Image') {
        ServerMapFolder('ImageThumb', $folderPath, $sCommand);
    }
    // Return the resource type directory combined with the required path.
    return CombinePaths($sResourceTypePath, $folderPath);
}
开发者ID:smartcorestudio,项目名称:ckfsys,代码行数:16,代码来源:io.php

示例3: GetFoldersAndFiles

function GetFoldersAndFiles($resourceType, $currentFolder)
{
    if (!isset($_GET)) {
        global $_GET;
    }
    global $Config;
    $isInternalLink = isset($_GET['DWFCK_Browser']) && $_GET['DWFCK_Browser'] == 'local' ? true : false;
    global $_FolderClass;
    global $Config;
    $currentFolder = encode_dir($currentFolder);
    $sess_id = session_id();
    if (!isset($sess_id) || $sess_id != $_COOKIE['FCK_NmSp_acl']) {
        session_id($_COOKIE['FCK_NmSp_acl']);
        session_start();
    }
    $acl_del = isset($_SESSION['dwfck_del']) ? $_SESSION['dwfck_del'] : 0;
    // Map the virtual path to the local server path.
    $sServerDir = ServerMapFolder($resourceType, $currentFolder, 'GetFoldersAndFiles');
    if ($Config['osWindows']) {
        $sServerDir = normalizeWIN($sServerDir);
    }
    mkdir_rek($sServerDir);
    // Arrays that will hold the folders and files names.
    $aFolders = array();
    $aFiles = array();
    $sFile = '__AAAAAAAA__.AAA';
    $temp_folder = $currentFolder;
    $temp_folder = dwiki_encodeFN(trim($temp_folder, '/'));
    has_permission($temp_folder, $resourceType);
    if ($isInternalLink && $_FolderClass < 16) {
        $sfclass = 'r';
    } else {
        if ($acl_del) {
            $sfclass = $_FolderClass >= 16 ? 'u' : 'r';
        } else {
            $sfclass = $_FolderClass >= 8 || has_open_access() ? 'u' : 'r';
        }
        can_delete($sfclass);
    }
    if (!$_FolderClass) {
        return;
    }
    $aFolders[] = '<Folder name="' . ConvertToXmlAttribute($sFile) . '" class="' . $sfclass . '" />';
    $sErrorNumber = 0;
    $sFolderPath = GetResourceTypeDirectory($resourceType, 'GetFoldersAndFiles');
    $absolute_path = $Config['UserFilesAbsolutePath'];
    $oCurrentFolder = @opendir($sServerDir);
    if ($oCurrentFolder !== false) {
        while ($sFile = readdir($oCurrentFolder)) {
            if ($sFile != '.' && $sFile != '..') {
                if (is_dir($sServerDir . $sFile)) {
                    if (has_permission(dwiki_encodeFN($currentFolder) . $sFile, $resourceType) || has_open_access()) {
                        if ($isInternalLink && $_FolderClass < 255) {
                            $class = 'r';
                        } else {
                            $class = $_FolderClass < 8 ? 'r' : 'u';
                            can_delete($class);
                        }
                        if ($_FolderClass) {
                            $aFolders[] = '<Folder name="' . ConvertToXmlAttribute($sFile) . '" class="' . $class . '" />';
                        }
                    }
                } else {
                    $iFileSize = @filesize($sServerDir . $sFile);
                    if (!$iFileSize) {
                        $iFileSize = 0;
                    }
                    if ($iFileSize > 0) {
                        $iFileSize = round($iFileSize / 1024);
                        if ($iFileSize < 1) {
                            $iFileSize = 1;
                        }
                    }
                    if ($isInternalLink) {
                        if (!preg_match('/\\.txt$/', $sFile)) {
                            continue;
                        }
                        if (has_permission(dwiki_encodeFN($currentFolder) . $sFile, $resourceType, false)) {
                            $aFiles[] = '<File name="' . ConvertToXmlAttribute($sFile) . '" size="' . $iFileSize . '" />';
                        }
                    } else {
                        if ($resourceType == 'Image') {
                            list($width, $height, $type, $attr) = getimagesize($sServerDir . $sFile);
                            if (isset($width) && isset($height)) {
                                $iFileSize .= ";;{$width};;{$height}";
                            }
                        }
                        $aFiles[] = '<File name="' . ConvertToXmlAttribute($sFile) . '" size="' . $iFileSize . '" />';
                    }
                }
            }
        }
        closedir($oCurrentFolder);
    }
    // Send the folders
    natcasesort($aFolders);
    echo '<Folders>';
    foreach ($aFolders as $sFolder) {
        echo $sFolder;
    }
//.........这里部分代码省略.........
开发者ID:violetfish,项目名称:ckgedit,代码行数:101,代码来源:commands.php


注:本文中的GetResourceTypeDirectory函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。