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


PHP CFileman::GetFileName方法代码示例

本文整理汇总了PHP中CFileman::GetFileName方法的典型用法代码示例。如果您正苦于以下问题:PHP CFileman::GetFileName方法的具体用法?PHP CFileman::GetFileName怎么用?PHP CFileman::GetFileName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CFileman的用法示例。


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

示例1: array

 if (!$ismenu) {
     $aDDMenuEdit[] = array("TEXT" => GetMessage("FILEMAN_FILEEDIT_AS_TXT"), "ACTION" => "window.location='fileman_file_edit.php?" . $addUrl . "&site=" . Urlencode($site) . "&path=" . UrlEncode($path) . ($new == 'y' ? "&new=Y" : "") . (strlen($back_url) > 0 ? "&back_url=" . urlencode($back_url) : "") . (strlen($template) > 0 ? "&template=" . urlencode($template) : "") . (strlen($template) > 0 ? "&template=" . urlencode($template) : "") . (strlen($templateID) > 0 ? "&templateID=" . urlencode($templateID) : "") . "';");
 }
 if ($USER->CanDoOperation('edit_php')) {
     $aDDMenuEdit[] = array("TEXT" => GetMessage("FILEMAN_FILEEDIT_AS_PHP"), "ACTION" => "window.location='fileman_file_edit.php?" . $addUrl . "&site=" . Urlencode($site) . "&path=" . UrlEncode($path) . "&full_src=Y" . ($new == 'y' ? "&new=Y" : "") . (strlen($back_url) > 0 ? "&back_url=" . urlencode($back_url) : "") . (strlen($template) > 0 ? "&template=" . urlencode($template) : "") . (strlen($template) > 0 ? "&template=" . urlencode($template) : "") . (strlen($templateID) > 0 ? "&templateID=" . urlencode($templateID) : "") . "';");
 }
 if ($ismenu) {
     $aDDMenuEdit[] = array("TEXT" => GetMessage("FILEMAN_FILEEDIT_AS_MENU"), "ACTION" => "window.location='fileman_menu_edit.php?" . $addUrl . "&site=" . Urlencode($site) . "&path=" . UrlEncode($arParsedPath["PREV"]) . "&name=" . UrlEncode($regs[1]) . ($new == 'y' ? "&new=Y" : "") . (strlen($back_url) > 0 ? "&back_url=" . urlencode($back_url) : "") . "';");
 }
 $aDDMenuEdit[] = array("TEXT" => GetMessage("FILEMAN_FILEEDIT_AS_HTML"), "ACTION" => "return;", "ICON" => "checked");
 $aMenu[] = array("TEXT" => GetMessage("FILEMAN_FILE_EDIT"), "TITLE" => GetMessage("FILEMAN_FILE_EDIT"), "MENU" => $aDDMenuEdit);
 if ($bEdit) {
     if ($USER->CanDoFileOperation('fm_rename_file', $arPath)) {
         $aMenu[] = array("TEXT" => GetMessage("FILEMAN_FILEEDIT_RENAME"), "LINK" => "fileman_rename.php?" . $addUrl . "&site=" . Urlencode($site) . "&path=" . UrlEncode($arParsedPath["PREV"]) . "&files[]=" . UrlEncode($arParsedPath["LAST"]));
     }
     if ($USER->CanDoFileOperation('fm_download_file', $arPath) && !(HasScriptExtension($path) || substr(CFileman::GetFileName($path), 0, 1) == ".") || $USER->CanDoOperation('edit_php')) {
         $aMenu[] = array("TEXT" => GetMessage("FILEMAN_FILEEDIT_DOWNLOAD"), "LINK" => "fileman_file_download.php?" . $addUrl . "&site=" . Urlencode($site) . "&path=" . UrlEncode($path));
     }
     if ($USER->CanDoFileOperation('fm_delete_file', $arPath)) {
         $folder_path = substr($path, 0, strrpos($path, "/"));
         $id = GetFileName($path);
         $aMenu[] = array("TEXT" => GetMessage("FILEMAN_FILE_DELETE"), "LINK" => "javascript:if(confirm('" . GetMessage("FILEMAN_FILE_DELETE_CONFIRM") . "')) window.location='/bitrix/admin/fileman_admin.php?ID=" . urlencode($id) . "&action=delete&" . $addUrl . "&site=" . urlencode($site) . "&path=" . urlencode($folder_path) . "&" . bitrix_sessid_get() . "';", "TITLE" => GetMessage("FILEMAN_FILE_DELETE"));
     }
 }
 $context = new CAdminContextMenu($aMenu);
 $context->Show();
 global $__fd_path;
 $__fd_path = $bEdit ? $arParsedPath["PREV"] : $path;
 $arContextTemplates = array();
 $arTemplates = CFileman::GetFileTemplates(LANGUAGE_ID, array($site_template));
 $cntTempl = count($arTemplates);
开发者ID:,项目名称:,代码行数:31,代码来源:

示例2: IncludeModuleLangFile

IncludeModuleLangFile(__FILE__);
$strWarning = "";
$site = CFileMan::__CheckSite($site);
$DOC_ROOT = CSite::GetSiteDocRoot($site);
$io = CBXVirtualIo::GetInstance();
$path = $GLOBALS["APPLICATION"]->ConvertCharset($path, "UTF-8", LANG_CHARSET);
$arFile = CFile::MakeFileArray($io->GetPhysicalName($path));
$arFile["tmp_name"] = CBXVirtualIoFileSystem::ConvertCharset($arFile["tmp_name"], CBXVirtualIoFileSystem::directionDecode);
$path = $io->CombinePath("/", $path);
$arPath = array($site, $path);
if (!$USER->CanDoFileOperation('fm_download_file', $arPath)) {
    $strWarning = GetMessage("ACCESS_DENIED");
} else {
    if (!$io->FileExists($arFile["tmp_name"])) {
        $strWarning = GetMessage("FILEMAN_FILENOT_FOUND") . " ";
    } elseif (!$USER->CanDoOperation('edit_php') && (HasScriptExtension($path) || substr(CFileman::GetFileName($path), 0, 1) == ".")) {
        $strWarning .= GetMessage("FILEMAN_FILE_DOWNLOAD_PHPERROR") . "\n";
    }
}
if (strlen($strWarning) <= 0) {
    $flTmp = $io->GetFile($arFile["tmp_name"]);
    $fsize = $flTmp->GetFileSize();
    $bufSize = 4194304;
    //4M
    session_write_close();
    set_time_limit(0);
    header("Content-Type: application/force-download; name=\"" . $arFile["name"] . "\"");
    header("Content-Transfer-Encoding: binary");
    header("Content-Length: " . $fsize);
    header("Content-Disposition: attachment; filename=\"" . $arFile["name"] . "\"");
    header("Expires: 0");
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:fileman_file_download.php

示例3: Init

    public static function Init($Params)
    {
        global $USER;
        $arWarnings = array();
        if (!$USER->CanDoOperation('fileman_admin_files') && !$USER->CanDoOperation('fileman_admin_folders')) {
            $arWarnings[] = GetMessage('FM_UTIL_ACCESS_DENIED');
        }
        $io = CBXVirtualIo::GetInstance();
        if (count($arWarnings) == 0) {
            $pathTo = trim($Params['copyTo'], " /");
            $site = CFileMan::__CheckSite($_GET['site']);
            $siteTo = $Params['siteTo'] ? $Params['siteTo'] : $site;
            $pathTo = $pathTo == "" ? "/" : "/" . $pathTo . "/";
            $absPathTo = CSite::GetSiteDocRoot($siteTo) . $pathTo;
            $docRootFrom = CSite::GetSiteDocRoot($site);
            if (!$io->DirectoryExists($absPathTo)) {
                // Create destination directory
                $bAccess = $USER->CanDoOperation('fileman_admin_folders') && $USER->CanDoFileOperation('fm_create_new_folder', $pathTo);
                if ($Params['createCopyTo']) {
                    if ($bAccess) {
                        CFileMan::CreateDir(array($siteTo, $pathTo));
                    }
                } else {
                    ?>
<script>window.BXFM_NoCopyToDir = "<?php 
                    echo $bAccess ? "ask_user" : "access_denied";
                    ?>
";</script><?php 
                    return;
                }
            }
            foreach ($Params['arFiles'] as $file) {
                $filePath = $file['path'];
                $caseOption = $Params['caseOption'];
                if ($Params["userCaseLastPath"]) {
                    if ($Params["userCaseLastPath"] != $filePath) {
                        continue;
                    }
                    $caseOption = $Params['userCaseAnswer'];
                    if ($Params["userCaseToAll"]) {
                        $Params['caseOption'] = $caseOption;
                    }
                    $Params["userCaseLastPath"] = false;
                }
                $arPath_i = array($site, $filePath);
                $absPath_i = $docRootFrom . $filePath;
                $bDir_i = $io->DirectoryExists($absPath_i);
                $name_i = CFileman::GetFileName($filePath);
                $strWarn = "";
                // Check if file already exists in destination folder
                if ($io->FileExists($absPathTo . $name_i) || $bDir_i == $io->DirectoryExists($absPathTo . $name_i) && $bDir_i) {
                    $fTmp = $io->GetFile($absPathTo . $name_i);
                    $fTmp1 = $io->GetFile($absPath_i);
                    $altName = CFilemanCopy::GetAltFileName($absPathTo, $name_i, $bDir_i);
                    if ($caseOption == 'ask') {
                        ?>
<script>
						window.BXFM_fileExist = {
							fileOld: {
								name: "<?php 
                        echo CUtil::JSEscape($name_i);
                        ?>
",
								path: "<?php 
                        echo CUtil::JSEscape($pathTo . $name_i);
                        ?>
",
								site: "<?php 
                        echo CUtil::JSEscape($siteTo);
                        ?>
",
								bDir: <?php 
                        echo $bDir_i ? "true" : "false";
                        ?>
,
								size: "<?php 
                        echo $bDir_i ? '-' : CFile::FormatSize($fTmp->GetFileSize());
                        ?>
",
								date: "<?php 
                        echo date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL")), CFilemanUtils::GetModifyTime($absPathTo . $name_i) + CTimeZone::GetOffset());
                        ?>
"
							},
							fileNew: {
								alt_name: "<?php 
                        echo CUtil::JSEscape($altName);
                        ?>
",
								name: "<?php 
                        echo CUtil::JSEscape($name_i);
                        ?>
",
								path: "<?php 
                        echo CUtil::JSEscape($filePath);
                        ?>
",
								site: "<?php 
                        echo CUtil::JSEscape($site);
                        ?>
//.........这里部分代码省略.........
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:101,代码来源:fileman_utils.php

示例4: GetMessage

	)
	||
	(
		strlen($new) < 0 &&
		!(
			$USER->CanDoOperation('fileman_edit_existent_files') &&
			$USER->CanDoFileOperation('fm_edit_existent_file',$arPath)
		)
	)
)
{
	$strWarning = GetMessage("ACCESS_DENIED");
}
elseif(strlen($strWarning) <= 0)
{
	if(!$USER->IsAdmin() && substr(CFileman::GetFileName($abs_path), 0, 1)==".")
	{
		$strWarning = GetMessage("FILEMAN_FILEEDIT_BAD_FNAME")." ";
		$bEdit = false;
		$bVarsFromForm = true;
		$path = $io->CombinePath("/", $arParsedPath["PREV"]);
		$arParsedPath = CFileMan::ParsePath($path, true, false, "", $logical == "Y");
		$abs_path = $DOC_ROOT.$path;
	}
	elseif($new == 'Y')
	{
		$bEdit = false;
	}
	else
	{
		if(!$io->FileExists($abs_path))
开发者ID:ASDAFF,项目名称:open_bx,代码行数:31,代码来源:file_edit.php

示例5: GetMessage

 if (!$io->FileExists($abs_path) && !$io->DirectoryExists($abs_path)) {
     $strWarning .= GetMessage("FILEMAN_FILEORFOLDER_NOT_FOUND");
 } else {
     if ($REQUEST_METHOD == "POST" && strlen($save) > 0 && check_bitrix_sessid()) {
         $pathTmp = $path;
         foreach ($arFiles as $ind => $file) {
             $newfilename = $filename[$ind];
             if (strlen($newfilename) <= 0) {
                 $strWarning .= GetMessage("FILEMAN_RENAME_NEW_NAME") . " \"" . $file . "\"!\n";
             } elseif (($mess = CFileMan::CheckFileName($newfilename)) !== true) {
                 $strWarning = $mess;
             } else {
                 $pathto = Rel2Abs($path, $newfilename);
                 if (!$USER->CanDoFileOperation('fm_create_new_file', array($site, $pathto))) {
                     $strWarning .= GetMessage("FILEMAN_RENAME_ACCESS_ERROR") . "\n";
                 } elseif (!$USER->CanDoOperation('edit_php') && (substr(CFileman::GetFileName($file), 0, 1) == "." || substr(CFileman::GetFileName($pathto), 0, 1) == "." || !HasScriptExtension($file) && HasScriptExtension($pathto))) {
                     // if not admin and renaming from non PHP to PHP
                     $strWarning .= GetMessage("FILEMAN_RENAME_TOPHPFILE_ERROR") . "\n";
                 } elseif (!$USER->CanDoOperation('edit_php') && HasScriptExtension($file) && !HasScriptExtension($pathto)) {
                     // if not admin and renaming from PHP to non PHP
                     $strWarning .= GetMessage("FILEMAN_RENAME_FROMPHPFILE_ERROR") . "\n";
                 } else {
                     $pathparsedtmp = CFileMan::ParsePath(array($site, $pathto), false, false, "", $logical == "Y");
                     $strWarningTmp = CFileMan::CreateDir($pathparsedtmp["PREV"]);
                     if (strlen($strWarningTmp) > 0) {
                         $strWarning .= $strWarningTmp;
                     } else {
                         if (!$io->FileExists($DOC_ROOT . $path . "/" . $file)) {
                             $strWarning .= GetMessage("FILEMAN_RENAME_FILE") . " \"" . $path . "/" . $file . "\" " . GetMessage("FILEMAN_RENAME_NOT_FOUND") . "!\n";
                         } elseif (!$io->Rename($DOC_ROOT . $path . "/" . $file, $DOC_ROOT . $pathto)) {
                             $strWarning .= GetMessage("FILEMAN_RENAME_ERROR") . " \"" . $path . "/" . $file . "\" " . GetMessage("FILEMAN_RENAME_IN") . " \"" . $pathto . "\"!\n";
开发者ID:spas-viktor,项目名称:books,代码行数:31,代码来源:fileman_rename.php

示例6: array

         $arActions[] = array("ICON" => "btn_fileman_prop", "TEXT" => GetMessage("FILEMAN_ADMIN_FOLDER_PROP"), "ACTION" => $lAdmin->ActionRedirect("fileman_folder.php?" . $addUrl . "&site=" . urlencode($site) . "&path=" . $fpathUrl . ""));
     }
 }
 $type = $Elem["TYPE"] == "F" ? 'file' : 'folder';
 if ($logical != "Y") {
     if ($Elem["TYPE"] == "F" && $USER->CanDoFileOperation('fm_view_file', $arPath) && ($USER->CanDoOperation('edit_php') || $USER->CanDoFileOperation('fm_lpa', $arPath) || !(HasScriptExtension($f_NAME) || substr($Elem["NAME"], 0, 1) == ".")) || $Elem["TYPE"] == "D" && $USER->CanDoFileOperation('fm_view_listing', $arPath)) {
         $arActions[] = array("SEPARATOR" => true);
         $arActions[] = array("ICON" => "pack", "TEXT" => GetMessage("FILEMAN_ADMIN_ARC_PACK"), "ACTION" => "window.PackUnpackRun([{'path' : '" . CUtil::JSEscape($fpath) . "', 'isDir' : '" . $arrIsDir[$fpath] . "'}], true); return false;");
         $is_archive = CBXArchive::IsArchive($fpath);
         if ($is_archive) {
             $arActions[] = array("ICON" => "unpack", "TEXT" => GetMessage("FILEMAN_ADMIN_ARC_UNPACK"), "ACTION" => "window.PackUnpackRun(['" . CUtil::JSEscape($fpath) . "'], false); return false;");
         }
     }
     if ($USER->CanDoFileOperation('fm_rename_' . $type, $arPath)) {
         $arActions[] = array("SEPARATOR" => true);
         $arActions[] = array("ICON" => "rename", "TEXT" => GetMessage("FILEMAN_RENAME_SAVE"), "ACTION" => 'setCheckbox(\'' . addslashes($f_NAME) . '\'); if(' . $lAdmin->table_id . '.IsActionEnabled(\'edit\')){document.forms[\'form_' . $lAdmin->table_id . '\'].elements[\'action_button\'].value=\'edit\'; ' . $lAdmin->ActionPost() . '}else{document.location.href=\'fileman_rename.php?' . $addUrl . '&path=' . urlencode($path) . '&site=' . $site . '&files[]=' . CFileman::GetFileName($arPath[1]) . '\'}');
     }
     // Copy
     if ($USER->CanDoFileOperation('fm_view_file', $arPath) && ($USER->CanDoOperation('edit_php') || $USER->CanDoFileOperation('fm_lpa', $arPath) || !(HasScriptExtension($f_NAME) || substr($Elem["NAME"], 0, 1) == ".")) && $Elem["TYPE"] == "F" || $Elem["TYPE"] == "D" && $USER->CanDoFileOperation('fm_view_listing', $arPath)) {
         $arActions[] = array("ICON" => "copy", "TEXT" => GetMessage("FILEMAN_ADM_COPY"), "ACTION" => "window.CopyMoveRun([{'path' : '" . CUtil::JSEscape($fpath) . "', 'isDir' : '" . $arrIsDir[$fpath] . "'}], true); return false;");
     }
     // Move
     if ($USER->CanDoOperation('fileman_admin_folders') && $USER->CanDoFileOperation('fm_delete_' . $type, $arPath)) {
         if ($USER->CanDoFileOperation('fm_view_file', $arPath) && ($USER->CanDoOperation('edit_php') || $USER->CanDoFileOperation('fm_lpa', $arPath) || !(HasScriptExtension($f_NAME) || substr($Elem["NAME"], 0, 1) == ".")) && $Elem["TYPE"] == "F" || $Elem["TYPE"] == "D" && $USER->CanDoFileOperation('fm_view_listing', $arPath)) {
             $arActions[] = array("ICON" => "move", "TEXT" => GetMessage("FILEMAN_ADM_MOVE"), "ACTION" => "window.CopyMoveRun([{'path' : '" . CUtil::JSEscape($fpath) . "', 'isDir' : '" . $arrIsDir[$fpath] . "'}], false); return false;");
         }
         $arActions[] = array("ICON" => "delete", "TEXT" => GetMessage("FILEMAN_ADMIN_DELETE"), "ACTION" => "if(confirm('" . GetMessage('FILEMAN_ALERT_DELETE') . "')) " . $lAdmin->ActionDoGroup(urlencode($f_NAME), "delete", $addUrl . "&site=" . urlencode($site) . "&path=" . urlencode($path) . "&show_perms_for=" . IntVal($show_perms_for)));
     }
     if ($USER->CanDoFileOperation('fm_edit_permission', $arPath)) {
         $arActions[] = array("SEPARATOR" => true);
         $arActions[] = array("ICON" => "access", "TEXT" => GetMessage("FILEMAN_ADMIN_ACCESS_PERMS_B"), "ACTION" => "setCheckbox('" . Cutil::JSEscape($f_NAME) . "'); setAccess('" . Cutil::JSEscape($site) . "', '" . Cutil::JSEscape(urlencode($path)) . "');");
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:fileman_admin.php

示例7: array

require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_popup_admin.php";
$io = CBXVirtualIo::GetInstance();
$site = CFileMan::__CheckSite($site);
$DOC_ROOT = CSite::GetSiteDocRoot($site);
$path = $io->CombinePath("/", $path);
$arParsedPath = CFileMan::ParsePath(array($site, $path), true);
$abs_path = $DOC_ROOT . $path;
$arPath = array($site, $path);
$bUploaded = false;
$file_name = "";
$strWarning = "";
if ($REQUEST_METHOD == "POST" && strlen($saveimg) > 0 && check_bitrix_sessid()) {
    if (!$USER->CanDoOperation('fileman_edit_existent_files') || !$USER->CanDoFileOperation('fm_edit_existent_file', $arPath)) {
        $strWarning = GetMessage('FILEMAN_CAN_NOT_WRITE') . "<br>";
    } else {
        $file_name = CFileman::GetFileName($newfilename);
        if (strlen($file_name) <= 0 || $file_name == "none") {
            continue;
        }
        if (!$USER->IsAdmin() && (in_array(CFileman::GetFileExtension($file_name), CFileMan::GetScriptFileExt()) || $file_name[0] == ".")) {
            $strWarning .= GetMessage("FILEMAN_UPLOAD_BAD_TYPE") . "\n";
        } elseif ($io->FileExists($abs_path . "/" . $file_name)) {
            $strWarning = GetMessage("FILEMAN_FILE_EXIST") . "<br>";
        } else {
            if ($io->Copy($_FILES["imagefile"]["tmp_name"], $abs_path . "/" . $file_name)) {
                $bUploaded = true;
                $f = $io->GetFile($abs_path . "/" . $file_name);
                $f->MarkWritable();
            }
        }
    }
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:fileman_fck_browser.php

示例8: GetMessage

         $showFieldText = GetMessage("FILEMAN_ADMIN_MENU_TYPE") . "&laquo;" . htmlspecialcharsbx($regs[1]) . "&raquo;";
     } else {
         $showFieldIcon = "<IMG SRC=\"/bitrix/images/fileman/types/" . $curFileType . ".gif\" WIDTH=\"16\" HEIGHT=\"16\" BORDER=0 ALT=\"\">";
         $showFieldText = $f_NAME;
     }
 }
 $showField = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td align=\"left\">" . $showFieldIcon . "</td><td align=\"left\">&nbsp;" . $showFieldText . "</td></tr></table>";
 $row =& $lAdmin->AddRow($f_NAME, $Elem);
 if ($row->VarsFromForm() && $_REQUEST["FIELDS"]) {
     $val = $_REQUEST["FIELDS"][$f_NAME]["NAME"];
 } else {
     $val = $f_NAME;
 }
 // In the search result mode - we will give to modify only name of files or folders
 if ($bSearch) {
     $val = CFileman::GetFileName($val);
 }
 //$editField = "<input type=\"text\" name=\"FIELDS[".$f_NAME."][NAME]\" value=\"".htmlspecialcharsbx($val)."\" size=\"40\"> ";
 if ($logical == 'Y') {
     $row->AddField("NAME", $showField);
 } else {
     //$row->AddField("NAME", $showField, $editField);
     $row->AddViewField("NAME", $showField);
     $row->AddInputField("NAME", array('size' => '40', name => 'FIELDS[' . $f_NAME . '][NAME]', 'value' => htmlspecialcharsbx($val)));
 }
 if ($logical == 'Y') {
     $showFieldIcon = "";
     $showFieldText = "";
     if (strlen($f_LOGIC_NAME) <= 0) {
         $f_LOGIC_NAME = htmlspecialcharsbx(GetMessage("FILEMAN_ADM_UNTITLED"));
     }
开发者ID:spas-viktor,项目名称:books,代码行数:31,代码来源:fileman_admin.php

示例9: GetMessage

		{
			$newfilename = $filename[$ind];
			if(strlen($newfilename)<=0)
			{
				$strWarning .= GetMessage("FILEMAN_RENAME_NEW_NAME")." \"".$file."\"!\n";
			}
			elseif (($mess = CFileMan::CheckFileName($newfilename)) !== true)
			{
				$strWarning = $mess;
			}
			else
			{
				$pathto = Rel2Abs($path, $newfilename);
				if(!$USER->CanDoFileOperation('fm_create_new_file',Array($site, $pathto)))
					$strWarning .= GetMessage("FILEMAN_RENAME_ACCESS_ERROR")."\n";
				elseif(!$USER->CanDoOperation('edit_php') && (substr(CFileman::GetFileName($file), 0, 1) == "." || substr(CFileman::GetFileName($pathto), 0, 1)=="." || (!HasScriptExtension($file) && HasScriptExtension($pathto)))) // if not admin and renaming from non PHP to PHP
					$strWarning .= GetMessage("FILEMAN_RENAME_TOPHPFILE_ERROR")."\n";
				elseif(!$USER->CanDoOperation('edit_php') 	&& HasScriptExtension($file) && !HasScriptExtension($pathto)) // if not admin and renaming from PHP to non PHP
					$strWarning .= GetMessage("FILEMAN_RENAME_FROMPHPFILE_ERROR")."\n";
				else
				{
					$pathparsedtmp = CFileMan::ParsePath(Array($site, $pathto), false, false, "", $logical == "Y");
					$strWarningTmp = CFileMan::CreateDir($pathparsedtmp["PREV"]);

					if(strlen($strWarningTmp)>0)
						$strWarning .= $strWarningTmp;
					else
					{
						if(!$io->FileExists($DOC_ROOT.$path."/".$file))
							$strWarning .= GetMessage("FILEMAN_RENAME_FILE")." \"".$path."/".$file."\" ".GetMessage("FILEMAN_RENAME_NOT_FOUND")."!\n";
						elseif(!$io->Rename($DOC_ROOT.$path."/".$file, $DOC_ROOT.$pathto))
开发者ID:ASDAFF,项目名称:open_bx,代码行数:31,代码来源:fileman_rename.php

示例10: Rel2Abs

 $arFile["name"] = CFileman::GetFileName($arFile["name"]);
 $filename = ${"filename_" . $i};
 if (strlen($filename) <= 0) {
     $filename = $arFile["name"];
 }
 $pathto = Rel2Abs($path, $filename);
 if (!$USER->CanDoFileOperation('fm_upload_file', array($site, $pathto))) {
     $strWarning .= GetMessage("FILEMAN_FILEUPLOAD_ACCESS_DENIED") . " \"" . $pathto . "\"\n";
 } elseif ($arFile["error"] == 1 || $arFile["error"] == 2) {
     $strWarning .= GetMessage("FILEMAN_FILEUPLOAD_SIZE_ERROR", array('#FILE_NAME#' => $pathto)) . "\n";
 } elseif (($mess = CFileMan::CheckFileName(str_replace('/', '', $pathto))) !== true) {
     $strWarning .= $mess . ".\n";
 } else {
     if ($io->FileExists($DOC_ROOT . $pathto)) {
         $strWarning .= GetMessage("FILEMAN_FILEUPLOAD_FILE_EXISTS1") . " \"" . $pathto . "\" " . GetMessage("FILEMAN_FILEUPLOAD_FILE_EXISTS2") . ".\n";
     } elseif (!$USER->IsAdmin() && (HasScriptExtension($pathto) || substr(CFileman::GetFileName($pathto), 0, 1) == ".")) {
         $strWarning .= GetMessage("FILEMAN_FILEUPLOAD_PHPERROR") . " \"" . $pathto . "\".\n";
     } else {
         $bQuota = true;
         if (COption::GetOptionInt("main", "disk_space") > 0) {
             $f = $io->GetFile($arFile["tmp_name"]);
             $bQuota = false;
             $size = $f->GetFileSize();
             $quota = new CDiskQuota();
             if ($quota->checkDiskQuota(array("FILE_SIZE" => $size))) {
                 $bQuota = true;
             }
         }
         if ($bQuota) {
             if (!$io->Copy($arFile["tmp_name"], $DOC_ROOT . $pathto)) {
                 $strWarning .= GetMessage("FILEMAN_FILEUPLOAD_FILE_CREATE_ERROR") . " \"" . $pathto . "\"\n";
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:fileman_file_upload.php


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