本文整理汇总了PHP中CFileMan::SaveLastPath方法的典型用法代码示例。如果您正苦于以下问题:PHP CFileMan::SaveLastPath方法的具体用法?PHP CFileMan::SaveLastPath怎么用?PHP CFileMan::SaveLastPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileMan
的用法示例。
在下文中一共展示了CFileMan::SaveLastPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Request
public static function Request($action, $site)
{
global $USER;
if (!$USER->CanDoOperation('fileman_view_file_structure')) {
return;
}
$io = CBXVirtualIo::GetInstance();
CUtil::JSPostUnescape();
switch ($action) {
case "count":
case "search":
case "replace":
$oSearch = new CFilemanSearch();
$oSearch->Init(array('lastPath' => isset($_POST['last_path']) ? $_POST['last_path'] : false, 'bCount' => $action == "count", 'bReplace' => $action == "replace", "fileName" => trim($_POST['file']), "phrase" => trim($_POST['phrase']), "replacePhrase" => trim($_POST['replace_phrase']), "dir" => CFilemanUtils::NormalizePath($_POST['dir']), "bSubdir" => $_POST['subdir'], "dateFrom" => $_POST['date_from'], "dateTo" => $_POST['date_to'], "sizeFrom" => intVal($_POST['size_from']), "sizeTo" => intVal($_POST['size_to']), "entire" => $_POST['entire'], "bCaseSens" => $_POST['case_sens'], "bDirsToo" => $_POST['dirs_too'], "ssess" => $_POST['ssess'], "bInResult" => $_POST['in_result'], "site" => CFileMan::__CheckSite($_GET['fu_site'])));
CFileMan::SaveLastPath(CFilemanUtils::NormalizePath($_POST['dir']));
break;
case "clean_old":
CFilemanSearch::CleanOldSearchResult();
break;
case "search_save_config":
CFilemanSearch::SaveConfig(array("advMode" => (bool) $_POST['adv_mode'], "bSubdir" => (bool) $_POST['subdir'], "entire" => (bool) $_POST['entire'], "bCaseSens" => (bool) $_POST['case_sens'], "bDirsToo" => (bool) $_POST['dirs_too']));
break;
case "copy_save_config":
CFilemanCopy::SaveConfig(array("advMode" => (bool) $_POST['adv_mode'], "caseOption" => $_POST['case_option']));
break;
case "copy":
case "move":
$oCopy = new CFilemanCopy();
$oCopy->Init(array("bCopy" => $action == "copy", "caseOption" => $_POST['case_option'], "arFiles" => $_POST['files'], "copyTo" => $_POST['copy_to'], "createCopyTo" => $_POST['create_copy_to'] == "Y", "userCaseAnswer" => isset($_POST['uc_answer']) ? $_POST['uc_answer'] : false, "userCaseToAll" => isset($_POST['uc_to_all']) ? $_POST['uc_to_all'] : false, "userCaseLastPath" => isset($_POST['uc_last_path']) ? $_POST['uc_last_path'] : false, "bSearch" => $_POST['search'] == "Y", "ssess" => $_POST['ssess'], "siteTo" => CFileMan::__CheckSite($_GET['fu_site'])));
CFileMan::SaveLastPath($_POST['copy_to']);
break;
case "get_last_pathes":
?>
<script>window.bx_last_pathes = <?php
echo CUtil::PhpToJSObject(CFilemanUtils::GetLastPathes());
?>
;</script>
<?php
break;
case "pack":
if (isset($_POST["startFile"])) {
$startFile = trim($_POST["startFile"]);
}
if (isset($_POST["quickPath"])) {
$quickPath = trim($_POST["quickPath"]);
}
if (isset($_POST["packTo"])) {
if (substr($_POST["packTo"], 0, 1) == "/") {
$pack_to = $_POST["packTo"];
} else {
$pack_to = "/" . $_POST["packTo"];
}
}
$siteTo = CFileMan::__CheckSite($_POST['siteTo']);
$docRootTo = CSite::GetSiteDocRoot($siteTo) ? CSite::GetSiteDocRoot($siteTo) : '';
$siteFrom = CFileMan::__CheckSite($site);
$docRootFrom = CSite::GetSiteDocRoot($siteFrom);
if (!$USER->IsAdmin()) {
$pack_to = RemoveScriptExtension($pack_to);
}
//check writing permissions
if (!$USER->CanDoFileOperation('fm_create_new_file', array($siteTo, $pack_to))) {
?>
<script>
window.BXFM_archivePermsError = true;
</script>
<?php
return;
}
if (IsFileUnsafe($docRootTo . $pack_to) || CFileMan::CheckFileName(GetFileName($pack_to)) !== true) {
?>
<script>
window.BXFM_archiveFNameError = true;
</script>
<?php
return;
}
//ask if the file already exists
if (file_exists($io->GetPhysicalName($docRootTo . $pack_to))) {
if (empty($startFile)) {
if ($_POST["bPackReplace"] != "replace") {
?>
<script>
window.BXFM_archiveExists = {
fileOld:
{
name: "<?php
echo CUtil::JSEscape(basename($pack_to));
?>
",
path: "<?php
echo CUtil::JSEscape($pack_to);
?>
",
site: "<?php
echo CUtil::JSEscape($siteTo);
?>
",
size: "<?php
echo CFile::FormatSize(filesize($io->GetPhysicalName($docRootTo . $pack_to)));
//.........这里部分代码省略.........
示例2: die
}
$absPath = $documentRoot . $path;
// Only for AJAX reuest from Quick Path controll in form - jump to viewing file
if (isset($_GET['check_for_file']) && $_GET['check_for_file'] == 'Y' && $io->FileExists($absPath)) {
die('<script>top.location="' . "fileman_file_view.php?path=" . urlencode($path) . '&' . bitrix_sessid_get() . '&' . $addUrl . '"</script>');
}
if (!$io->DirectoryExists($absPath)) {
$lAdmin->AddGroupError(GetMessage("FILEMAN_ADM_INCORRECT_PATH", array("#PATH#" => $path)));
$path = "";
$absPath = $documentRoot;
}
$arParsedPath = CFileMan::ParsePath(array($site, $path), true, false, "", $logical == "Y");
$arPath = array($site, $path);
$arFilter["MIN_PERMISSION"] = "R";
$handle_action = true;
CFileMan::SaveLastPath($path);
// Check user rights
if ($lAdmin->EditAction() && ($USER->CanDoOperation('fileman_admin_files') || $USER->CanDoOperation('fileman_admin_folders')) && is_array($FIELDS)) {
foreach ($FIELDS as $ID => $arFields) {
if (!$lAdmin->IsUpdated($ID)) {
continue;
}
// For search results we have full pathes
$pathFrom = $bSearch ? $ID : $path . "/" . $ID;
$arPath_i = array($site, $pathFrom);
if (!($USER->CanDoFileOperation('fm_rename_file', $arPath_i) || $USER->CanDoFileOperation('fm_rename_file', $arPath_i))) {
$lAdmin->AddGroupError(GetMessage("FILEMAN_RENAME_ACCESS_DENIED") . " \"" . $ID . "\"", $ID);
continue;
}
if (strlen($arFields["NAME"]) <= 0) {
$lAdmin->AddGroupError(GetMessage("FILEMAN_RENAME_NEW_NAME") . " \"" . $ID . "\"", $ID);