本文整理汇总了PHP中CFileMan::__CheckSite方法的典型用法代码示例。如果您正苦于以下问题:PHP CFileMan::__CheckSite方法的具体用法?PHP CFileMan::__CheckSite怎么用?PHP CFileMan::__CheckSite使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileMan
的用法示例。
在下文中一共展示了CFileMan::__CheckSite方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($arParams)
{
$this->SITE_ID = $arParams["SITE_ID"];
$this->REWRITE = $arParams["REWRITE"];
$this->ModuleBlogGroup = '[' . $this->SITE_ID . '] ' . GetMessage("IDEA_BLOG_GROUP_NAME");
$this->ModuleBlogUrl .= "_" . $this->SITE_ID;
//NULL CACHE
BXClearCache(True, '/' . $this->SITE_ID . '/idea/');
BXClearCache(True, '/' . SITE_ID . '/idea/');
global $CACHE_MANAGER;
if (CACHED_b_user_field_enum !== false) {
$CACHE_MANAGER->CleanDir("b_user_field_enum");
}
//Statuses List (for demo)
$this->arResult["SETTINGS"]["STATUS"] = CIdeaManagment::getInstance()->Idea()->GetStatusList();
foreach ($this->arResult["SETTINGS"]["STATUS"] as $arStatus) {
$this->arResult["SETTINGS"]["STATUS_ID"][$arStatus["XML_ID"]] = $arStatus["ID"];
}
//Lang List
$l = CLanguage::GetList($by = "sort", $order = "asc");
while ($r = $l->Fetch()) {
$this->arResult["SETTINGS"]["LANG"][] = $r;
}
//Sites List
$oSites = CSite::GetList($b = "", $o = "", array("ACTIVE" => "Y"));
while ($site = $oSites->Fetch()) {
$this->arResult["SETTINGS"]["SITE"][$site["LID"]] = array("LANGUAGE_ID" => $site["LANGUAGE_ID"], "ABS_DOC_ROOT" => $site["ABS_DOC_ROOT"], "DIR" => $site["DIR"], "SITE_ID" => $site["LID"], "SERVER_NAME" => $site["SERVER_NAME"], "NAME" => $site["NAME"]);
}
if (array_key_exists($this->SITE_ID, $this->arResult["SETTINGS"]["SITE"])) {
$this->PublicDir = str_replace(array("#SITE_DIR#"), array($this->arResult["SETTINGS"]["SITE"][$this->SITE_ID]["DIR"]), $this->PublicDir);
}
$site = CFileMan::__CheckSite($this->SITE_ID);
$this->DOCUMENT_ROOT = CSite::GetSiteDocRoot($site);
$this->IO = CBXVirtualIo::GetInstance();
//SetDefault
$this->arResult["INSTALLATION"]["IBLOCK_TYPE_INSTALL"] = true;
$this->arResult["INSTALLATION"]["IBLOCK_INSTALL"] = true;
$this->arResult["INSTALLATION"]["BLOG_GROUP_INSTALL"] = true;
$this->arResult["INSTALLATION"]["BLOG_INSTALL"] = true;
$this->CheckParams();
}
示例2: require_once
<?
require_once($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/prolog_admin_before.php");
require_once($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/fileman/prolog.php");
if (!$USER->CanDoOperation('fileman_view_file_structure'))
$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
require_once($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/fileman/include.php");
if(CModule::IncludeModule("compression"))
CCompress::Disable2048Spaces();
if (isset($_GET['path']))
{
$site = CFileMan::__CheckSite($site);
if(!$site)
$site = CSite::GetSiteByFullPath($_SERVER["DOCUMENT_ROOT"].$path);
$io = CBXVirtualIo::GetInstance();
$documentRoot = CSite::GetSiteDocRoot($site);
$path = $io->CombinePath("/", $path);
$abs_path = $documentRoot.$path;
$arPath = Array($site, $path);
if ($io->FileExists($abs_path) && $USER->CanDoFileOperation('fm_view_file', $arPath))
{
$width = isset($width) ? 'width="'.htmlspecialcharsex($width).'"' : '';
$height = isset($height) ? 'height="'.htmlspecialcharsex($height).'"' : '';
?>
<HTML><HEAD></HEAD><BODY>
示例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);
?>
//.........这里部分代码省略.........
示例4: ShowHTMLEditControl
function ShowHTMLEditControl($name, $content, $arParams = array())
{
global $USER;
// We have to avoid of showing HTML-editor with probably unsecure content when loosing the session [mantis:#0007986]
if ($_SERVER["REQUEST_METHOD"] == "POST" && !check_bitrix_sessid()) {
return;
}
CUtil::InitJSCore(array('window', 'ajax'));
$relPath = isset($arParams["path"]) ? $arParams["path"] : "/";
$site = isset($arParams["site"]) ? $arParams["site"] : "";
$__path = Rel2Abs("/", $relPath);
$site = CFileMan::__CheckSite($site);
$name = preg_replace("/[^a-zA-Z0-9_:\\.]/is", "", $name);
if (!isset($arParams["limit_php_access"])) {
$arParams["limit_php_access"] = false;
}
$arParams["light_mode"] = defined('BX_PUBLIC_MODE') && BX_PUBLIC_MODE == 1 || isset($arParams["light_mode"]) && $arParams["light_mode"] == 'Y';
$io = CBXVirtualIo::GetInstance();
$direction_rtl = false;
if ($site) {
$DOC_ROOT = CSite::GetSiteDocRoot($site);
$abs_path = $DOC_ROOT . $__path;
if ($io->FileExists($abs_path)) {
$relPath = substr($relPath, 0, strrpos($relPath, "/"));
if ($relPath == "") {
$relPath = "/";
}
}
}
static $bFirstUsed;
$template = $arParams["templateID"];
if (!isset($template) && defined('SITE_TEMPLATE_ID')) {
$template = SITE_TEMPLATE_ID;
}
if (!isset($template) && isset($_GET['siteTemplateId'])) {
$template = $_GET['siteTemplateId'];
}
if (!isset($template) && isset($site)) {
$dbSiteRes = CSite::GetTemplateList($site);
$SITE_TEMPLATE = array();
while ($arSiteRes = $dbSiteRes->Fetch()) {
if ($arSiteRes['CONDITION'] == "" || !isset($template)) {
$template = $arSiteRes['TEMPLATE'];
}
}
}
if (isset($arParams['use_editor_3'])) {
$useEditor3 = $arParams['use_editor_3'] == "Y";
} else {
$useEditor3 = COption::GetOptionString('fileman', "use_editor_3", "Y") == "Y";
}
if ($useEditor3) {
$Editor = new CHTMLEditor();
$Editor->Show(array('name' => $name, 'id' => $name, 'siteId' => $arParams["site"], 'width' => $arParams["width"], 'height' => $arParams["height"], 'content' => $content, 'bAllowPhp' => !$arParams["bWithoutPHP"] && $USER->CanDoOperation('edit_php'), "limitPhpAccess" => $arParams["limit_php_access"], "display" => $arParams['bDisplay'], "componentFilter" => isset($arParams['componentFilter']) ? $arParams['componentFilter'] : false, "setFocusAfterShow" => isset($arParams['setFocusAfterShow']) ? $arParams['setFocusAfterShow'] : true, "relPath" => $relPath, "templateId" => $template));
return;
}
//Taskbars
$arTaskbars = isset($arParams["arTaskbars"]) ? $arParams["arTaskbars"] : array();
//Toolbars
$arToolbars = isset($arParams["arToolbars"]) ? $arParams["arToolbars"] : false;
// Toolbar config
$arParams["toolbarConfig"] = is_array($arParams["toolbarConfig"]) ? $arParams["toolbarConfig"] : false;
$arParams["use_advanced_php_parser"] = COption::GetOptionString("fileman", "use_advanced_php_parser", "Y");
$arParams["ar_entities"] = COption::GetOptionString("fileman", "ar_entities", 'umlya,greek,other');
if ($arParams["ar_entities"] == 'none') {
$arParams["ar_entities"] = '';
}
if (!isset($arParams["usePspell"])) {
$arParams["usePspell"] = COption::GetOptionString("fileman", "use_pspell", "N");
}
if (!isset($arParams["useCustomSpell"])) {
$arParams["useCustomSpell"] = COption::GetOptionString("fileman", "use_custom_spell", "Y");
}
$arParams['allowRenderComp2'] = COption::GetOptionString('fileman', "allow_render_components", "N") == 'Y';
$arParams['renderComponents'] = $arParams['allowRenderComp2'] && CUserOptions::GetOption('fileman', "render_components", "Y") == 'Y';
$lca = COption::GetOptionString("fileman", "use_lca", "N");
$styleList_render_style = COption::GetOptionString("fileman", "render_styles_in_classlist", "Y") == 'Y' ? 'true' : 'false';
$arAdditionalParams = isset($arParams["arAdditionalParams"]) ? $arParams["arAdditionalParams"] : array();
$arResult = CFileman::GetAllTemplateParams($template, $site, $arParams["bWithoutPHP"] != true, $arAdditionalParams);
$arParams["TEMPLATE"] = $arResult;
if ($bUseOnlyDefinedStyles && !is_set($arResult, "STYLES_TITLE")) {
$bUseOnlyDefinedStyles = false;
}
$arParams["body_class"] = COption::GetOptionString("fileman", "editor_body_class", "");
$arParams["body_id"] = COption::GetOptionString("fileman", "editor_body_id", "");
?>
<script bxrunfirst="true">
var relPath = "<?php
echo CUtil::JSEscape($relPath);
?>
";
var <?php
echo 'ar_' . $name . '_taskbars';
?>
= {};
<?php
for ($k = 0, $l = count($arTaskbars); $k < $l; $k++) {
echo 'ar_' . $name . '_taskbars["' . $arTaskbars[$k] . '"] = true;';
}
if ($arToolbars !== false) {
//.........这里部分代码省略.........
示例5: array
@set_time_limit(0);
$strWarning_tmp = CFileMan::DeleteEx(array($site, CFileMan::NormalizePath($pathEx)));
// Delete file from search results, stored in db
if ($bSearch) {
CFilemanSearch::DelFromSearchResult($searchSess, $pathEx);
}
if (strlen($strWarning_tmp) > 0) {
$lAdmin->AddGroupError($strWarning_tmp, $ID);
}
break;
case "copy":
case "move":
if (!($USER->CanDoFileOperation('fm_create_new_file', $arPath_i) || $USER->CanDoFileOperation('fm_create_new_folder', $arPath_i)) || !($USER->CanDoFileOperation('fm_delete_file', $arPath_i) || $USER->CanDoFileOperation('fm_delete_folder', $arPath_i)) && $_REQUEST['action'] == 'move') {
break;
}
if (!CSite::IsDistinctDocRoots() || CFileMan::__CheckSite($copy_to_site) === false) {
$copy_to_site = $site;
}
$name_i = $bSearch ? CFileman::GetFileName($ID) : $ID;
if (($mess = CFileMan::CheckFileName(str_replace('/', '', $copy_to))) !== true) {
$lAdmin->AddGroupError($mess, $ID);
} else {
$strWarning_tmp = CFileMan::CopyEx(array($site, CFileMan::NormalizePath($pathEx)), array($copy_to_site, CFileMan::NormalizePath($copy_to . "/" . $name_i)), $_REQUEST['action'] == "move" ? true : false);
}
if ($bSearch && $_REQUEST['action'] == "move") {
CFilemanSearch::DelFromSearchResult($searchSess, $pathEx);
}
if (strlen($strWarning_tmp) > 0) {
$lAdmin->AddGroupError($strWarning_tmp, $ID);
}
break;
示例6: GetEventInfo
function GetEventInfo($row, $arParams, $arUser)
{
$site = CFileMan::__CheckSite($site);
$DOC_ROOT = CSite::GetSiteDocRoot($site);
$DESCRIPTION = unserialize($row['DESCRIPTION']);
if (empty($DESCRIPTION['path'])) {
$DESCRIPTION['path'] = $_SERVER['HTTP_HOST'];
$fileURL = SITE_DIR;
} else {
if ((is_file($DOC_ROOT . "/" . $DESCRIPTION['path']) || is_dir($DOC_ROOT . "/" . $DESCRIPTION['path'])) && !strrpos($DESCRIPTION['path'], " ")) {
$fileURL = SITE_DIR . $DESCRIPTION['path'];
}
}
$EventName = $DESCRIPTION['path'];
switch ($row['AUDIT_TYPE_ID']) {
case "PAGE_ADD":
$EventPrint = GetMessage("LOG_PAGE_ADD");
break;
case "PAGE_EDIT":
$EventPrint = GetMessage("LOG_PAGE_EDIT");
break;
case "PAGE_DELETE":
$EventPrint = GetMessage("LOG_PAGE_DELETE");
break;
case "MENU_ADD":
$EventPrint = GetMessage("LOG_MENU_ADD", array("#MENU#" => $DESCRIPTION['menu_name']));
break;
case "MENU_EDIT":
$EventPrint = GetMessage("LOG_MENU_EDIT", array("#MENU#" => $DESCRIPTION['menu_name']));
break;
case "MENU_DELETE":
$EventPrint = GetMessage("LOG_MENU_DELETE", array("#MENU#" => $DESCRIPTION['menu_name']));
break;
case "FILE_ADD":
$EventPrint = GetMessage("LOG_FILE_ADD");
break;
case "FILE_EDIT":
$EventPrint = GetMessage("LOG_FILE_EDIT");
break;
case "FILE_DELETE":
$EventPrint = GetMessage("LOG_FILE_DELETE", array("#FILENAME#" => $DESCRIPTION['file_name']));
break;
case "FILE_MOVE":
$EventPrint = GetMessage("LOG_FILE_MOVE", array("#SECTION#" => $DESCRIPTION["copy_to"]));
break;
case "FILE_COPY":
$EventPrint = GetMessage("LOG_FILE_COPY", array("#SECTION#" => $DESCRIPTION["copy_to"]));
break;
case "FILE_RENAME":
$EventPrint = GetMessage("LOG_FILE_RENAME");
break;
case "SECTION_ADD":
$EventPrint = GetMessage("LOG_SECTION_ADD");
break;
case "SECTION_EDIT":
$EventPrint = GetMessage("LOG_SECTION_EDIT");
break;
case "SECTION_DELETE":
$EventPrint = GetMessage("LOG_SECTION_DELETE");
break;
case "SECTION_MOVE":
$EventPrint = GetMessage("LOG_SECTION_MOVE", array("#SECTION#" => $DESCRIPTION["copy_to"]));
break;
case "SECTION_COPY":
$EventPrint = GetMessage("LOG_SECTION_COPY", array("#SECTION#" => $DESCRIPTION["copy_to"]));
break;
case "SECTION_RENAME":
$EventPrint = GetMessage("LOG_SECTION_RENAME");
break;
}
return array("eventType" => $EventPrint, "eventName" => $EventName, "eventURL" => $fileURL);
}