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


PHP ConvertToXmlAttribute函数代码示例

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


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

示例1: CreateXmlHeader

function CreateXmlHeader($command, $resourceType, $currentFolder)
{
    // Create the XML document header.
    echo '<?xml version="1.0" encoding="utf-8" ?>';
    // Create the main "Connector" node.
    echo '<Connector command="' . $command . '" resourceType="' . $resourceType . '">';
    // Add the current folder node.
    echo '<CurrentFolder path="' . ConvertToXmlAttribute($currentFolder) . '" url="' . ConvertToXmlAttribute(GetUrlFromPath($resourceType, $currentFolder)) . '" />';
}
开发者ID:jankichaudhari,项目名称:yii-site,代码行数:9,代码来源:basexml.php

示例2: CreateXmlHeader

function CreateXmlHeader($command, $resourceType, $currentFolder)
{
    global $Config;
    SetXmlHeaders();
    // Create the XML document header.
    echo '<?xml version="1.0" encoding="utf-8" ?>';
    // Create the main "Connector" node.
    echo '<Connector command="' . $command . '" resourceType="' . $resourceType . '">';
    // Add the current folder node.
    $url = GetUrlFromPath($resourceType, $currentFolder, $command);
    $absurl = $Config['k_append_url'] . $url;
    echo '<CurrentFolder path="' . ConvertToXmlAttribute($currentFolder) . '" url="' . ConvertToXmlAttribute($url) . '" absurl="' . ConvertToXmlAttribute($absurl) . '" />';
    $GLOBALS['HeaderSent'] = true;
}
开发者ID:msabino,项目名称:beth-maria,代码行数:14,代码来源:basexml.php

示例3: GetFoldersAndFiles

function GetFoldersAndFiles($resourceType, $currentFolder)
{
    // Map the virtual path to the local server path.
    $sServerDir = ServerMapFolder($resourceType, $currentFolder, 'GetFoldersAndFiles');
    // Arrays that will hold the folders and files names.
    $aFolders = array();
    $aFiles = array();
    $oCurrentFolder = @opendir($sServerDir);
    if ($oCurrentFolder !== false) {
        while ($sFile = readdir($oCurrentFolder)) {
            if ($sFile != '.' && $sFile != '..') {
                if (is_dir($sServerDir . $sFile)) {
                    $aFolders[] = '<Folder name="' . ConvertToXmlAttribute($sFile) . '" />';
                } else {
                    if (!preg_match("/.*(-\\d{1,}x\\d{1,})\\..*/", $sFile)) {
                        // skip thumbnails
                        $iFileSize = @filesize($sServerDir . $sFile);
                        if (!$iFileSize) {
                            $iFileSize = 0;
                        }
                        if ($iFileSize > 0) {
                            $iFileSize = round($iFileSize / 1024);
                            if ($iFileSize < 1) {
                                $iFileSize = 1;
                            }
                        }
                        $aFiles[] = '<File name="' . ConvertToXmlAttribute($sFile) . '" size="' . $iFileSize . '" />';
                    }
                }
            }
        }
        closedir($oCurrentFolder);
    }
    // Send the folders
    natcasesort($aFolders);
    echo '<Folders>';
    foreach ($aFolders as $sFolder) {
        echo $sFolder;
    }
    echo '</Folders>';
    // Send the files
    natcasesort($aFiles);
    echo '<Files>';
    foreach ($aFiles as $sFiles) {
        echo $sFiles;
    }
    echo '</Files>';
}
开发者ID:thebrashgroup,项目名称:projects,代码行数:48,代码来源:commands.php

示例4: GetFoldersAndFiles

function GetFoldersAndFiles($resourceType, $currentFolder)
{
    $sServerDir = ServerMapFolder($resourceType, $currentFolder, 'GetFoldersAndFiles');
    $aFolders = array();
    $aFiles = array();
    $oCurrentFolder = @opendir($sServerDir);
    if ($oCurrentFolder !== false) {
        while ($sFile = readdir($oCurrentFolder)) {
            if ($sFile != '.' && $sFile != '..') {
                if (is_dir($sServerDir . $sFile)) {
                    $aFolders[] = '<Folder name="' . ConvertToXmlAttribute($sFile) . '" />';
                } else {
                    $iFileSize = @filesize($sServerDir . $sFile);
                    if (!$iFileSize) {
                        $iFileSize = 0;
                    }
                    if ($iFileSize > 0) {
                        $iFileSize = round($iFileSize / 1024);
                        if ($iFileSize < 1) {
                            $iFileSize = 1;
                        }
                    }
                    $aFiles[] = '<File name="' . ConvertToXmlAttribute($sFile) . '" size="' . $iFileSize . '" />';
                }
            }
        }
        closedir($oCurrentFolder);
    }
    natcasesort($aFolders);
    echo '<Folders>';
    foreach ($aFolders as $sFolder) {
        echo $sFolder;
    }
    echo '</Folders>';
    natcasesort($aFiles);
    echo '<Files>';
    foreach ($aFiles as $sFiles) {
        echo $sFiles;
    }
    echo '</Files>';
}
开发者ID:ziyou-liu,项目名称:jiesi,代码行数:41,代码来源:commands.php

示例5: CreateFolder

function CreateFolder($resourceType, $currentFolder)
{
    $sErrorNumber = '0';
    $sErrorMsg = '';
    if (isset($_GET['NewFolderName'])) {
        $sNewFolderName = $_GET['NewFolderName'];
        // Map the virtual path to the local server path of the current folder.
        $sServerDir = ServerMapFolder($resourceType, $currentFolder);
        if (is_writable($sServerDir)) {
            $sServerDir .= $sNewFolderName;
            $sErrorMsg = CreateServerFolder($sServerDir);
            switch ($sErrorMsg) {
                case '':
                    $sErrorNumber = '0';
                    break;
                case 'Invalid argument':
                case 'No such file or directory':
                    $sErrorNumber = '102';
                    // Path too long.
                    break;
                default:
                    $sErrorNumber = '110';
                    break;
            }
        } else {
            $sErrorNumber = '103';
        }
    } else {
        $sErrorNumber = '102';
    }
    // Create the "Error" node.
    echo '<Error number="' . $sErrorNumber . '" originalDescription="' . ConvertToXmlAttribute($sErrorMsg) . '" />';
}
开发者ID:jankichaudhari,项目名称:yii-site,代码行数:33,代码来源:commands.php

示例6: CreateXmlHeader

function CreateXmlHeader($command, $currentFolder)
{
    SetXmlHeaders();
    // Create the XML document header.
    echo '<?xml version="1.0" encoding="utf-8" ?>';
    // Create the main "Connector" node.
    echo '<Connector command="' . $command . '" resourceType="Image">';
    // Add the current folder node.
    echo '<CurrentFolder path="' . ConvertToXmlAttribute($currentFolder) . '" url="' . ConvertToXmlAttribute(FCK_UPLOAD_URL . $currentFolder) . '" />';
}
开发者ID:BackupTheBerlios,项目名称:peakxoops-svn,代码行数:10,代码来源:functions.php

示例7: 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

示例8: GetFoldersAndFiles

function GetFoldersAndFiles($resourceType, $currentFolder)
{
    // Map the virtual path to the local server path.
    $sServerDir = ServerMapFolder($resourceType, $currentFolder, 'GetFoldersAndFiles');
    // Arrays that will hold the folders and files names.
    $aFolders = array();
    $aFiles = array();
    $oCurrentFolder = @opendir($sServerDir);
    $in_group = api_is_in_group();
    if ($currentFolder == '/shared_folder/' || $currentFolder == '/shared_folder_session_' . api_get_session_id() . '/') {
        $in_shared_folder = true;
    } else {
        $in_shared_folder = false;
    }
    $user_id = api_get_user_id();
    if ($oCurrentFolder !== false) {
        while ($sFile = readdir($oCurrentFolder)) {
            $is_dir = @is_dir($sServerDir . $sFile);
            if ($sFile != '.' && $sFile != '..' && strpos($sFile, '_DELETED_') === false && strpos($sFile, 'chat_files') === false && strpos($sFile, 'HotPotatoes_files') === false && ($in_group || !$in_group && strpos($sFile, '_groupdocs') === false) && (!$in_shared_folder || $in_shared_folder && (!$is_dir || $is_dir && $sFile == $user_id)) && $sFile != '.thumbs' && strpos($sFile, '.editor_') === false && $sFile != '.svn') {
                if ($is_dir) {
                    $aFolders[] = '<Folder name="' . ConvertToXmlAttribute($sFile) . '" />';
                } else {
                    $iFileSize = @filesize($sServerDir . $sFile);
                    if (!$iFileSize) {
                        $iFileSize = 0;
                    }
                    if ($iFileSize > 0) {
                        $iFileSize = round($iFileSize / 1024);
                        if ($iFileSize < 1) {
                            $iFileSize = 1;
                        }
                    }
                    $aFiles[] = '<File name="' . ConvertToXmlAttribute($sFile) . '" size="' . $iFileSize . '" />';
                }
            }
        }
        closedir($oCurrentFolder);
    }
    // Send the folders
    natcasesort($aFolders);
    echo '<Folders>';
    foreach ($aFolders as $sFolder) {
        echo $sFolder;
    }
    echo '</Folders>';
    // Send the files
    natcasesort($aFiles);
    echo '<Files>';
    foreach ($aFiles as $sFiles) {
        echo $sFiles;
    }
    echo '</Files>';
}
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:53,代码来源:commands.php

示例9: GetFoldersAndFiles

function GetFoldersAndFiles($resourceType, $currentFolder, $pagesize = '5')
{
    // Map the virtual path to the local server path.
    $sServerDir = ServerMapFolder($resourceType, $currentFolder, 'GetFoldersAndFiles');
    // Arrays that will hold the folders and files names.
    $aFolders = array();
    $aFiles = array();
    $oCurrentFolder = opendir($sServerDir);
    while ($sFile = readdir($oCurrentFolder)) {
        if ($sFile != '.' && $sFile != '..' && $sFile != 'Thumbs.db') {
            if (is_dir($sServerDir . $sFile)) {
                $aFolders[] = '<Folder name="' . ConvertToXmlAttribute($sFile) . '" />';
            } else {
                $iFileSize = @filesize($sServerDir . $sFile);
                $iFileMtime = @filemtime($sServerDir . $sFile);
                if (!$iFileSize) {
                    $iFileSize = 0;
                }
                if ($iFileSize > 0) {
                    $iFileSize = round($iFileSize / 1024);
                    if ($iFileSize < 1) {
                        $iFileSize = 1;
                    }
                }
                $aFiles[] = '<File name="' . ConvertToXmlAttribute($sFile) . '" size="' . $iFileSize . '" />';
            }
        }
    }
    $p = $_GET['p'];
    if ($p < 1) {
        $p = 1;
    }
    // Send the folders
    natcasesort($aFolders);
    echo '<Folders>';
    foreach ($aFolders as $sFolder) {
        echo $sFolder;
    }
    echo '</Folders>';
    // Send the files
    natcasesort($aFiles);
    $an = count($aFiles);
    foreach ($aFiles as $key => $val) {
        $aFiles[$an - $key - 1] = $val;
    }
    echo '<Files>';
    //foreach ( $aFiles as $sFiles )
    //echo $sFiles ;
    for ($i = ($p - 1) * $pagesize; $i < $pagesize * $p; $i++) {
        echo $aFiles[$i];
    }
    echo '</Files>';
    echo '<npage>';
    echo $p;
    echo '</npage>';
    echo '<page>';
    echo ceil(count($aFiles) / $pagesize);
    echo '</page>';
    unset($aFolders);
    unset($aFiles);
}
开发者ID:8yong8,项目名称:vshop,代码行数:61,代码来源:commands.php

示例10: GetFoldersAndFiles

function GetFoldersAndFiles($resourceType, $currentFolder)
{
    dbConn();
    //$email = $_GET['e'];
    // Map the virtual path to the local server path.
    $sServerDir = ServerMapFolder($resourceType, $currentFolder, 'GetFoldersAndFiles');
    $f = fopen("log2.txt", "a");
    fwrite($f, "\r\nemail = {$currentFolder}\r\n");
    // Arrays that will hold the folders and files names.
    $aFolders = array();
    $aFiles = array();
    /*
    	$oCurrentFolder = @opendir( $sServerDir ) ;
    
    if($sFile = readdir( $oCurrentFolder ))
    {
        if ( is_dir( $sServerDir . $sFile ) )
        $aFolders[] = '<Folder name="' . ConvertToXmlAttribute( $sFile ) . '" />' ;
        
    	}
    closedir( $oCurrentFolder );
    */
    // Arrays that will hold the folders and files names.
    $aFolders = array();
    $aFiles = array();
    $email = getEmailFCK();
    if ($email != "") {
        //$f = fopen("cok.txt", "w");
        //fprintf($f, "$email");
    }
    $email = "a@b.com";
    $email = $_SESSION['em'];
    $email = $_GET['email'];
    //import_request_variables("c", "c_");
    $email = $c_conlivefck_cookie;
    $f = fopen("cok.txt", "w");
    fprintf($f, "{$email}");
    $album_id = getAlbumId($email);
    $r = selectData("select * from user_imgs where user_email = '{$email}' and stat = 1 and album_id = {$album_id} ");
    foreach ($r as $file) {
        $fs = $file['file_size'];
        if ($fs > 1) {
            $fs = round($fs);
        } else {
            $fs = 1;
        }
        $aFiles[] = '<File name="' . ConvertToXmlAttribute($file['id']) . '" size="' . $fs . '" />';
    }
    // Send the folders
    natcasesort($aFolders);
    echo '<Folders>';
    foreach ($aFolders as $sFolder) {
        echo $sFolder;
    }
    echo '</Folders>';
    // Send the files
    natcasesort($aFiles);
    echo '<Files>';
    foreach ($aFiles as $sFiles) {
        echo $sFiles;
    }
    echo '</Files>';
}
开发者ID:aazhbd,项目名称:ArtCms,代码行数:63,代码来源:commands.php


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