本文整理汇总了PHP中CFileMan::EscapePHPString方法的典型用法代码示例。如果您正苦于以下问题:PHP CFileMan::EscapePHPString方法的具体用法?PHP CFileMan::EscapePHPString怎么用?PHP CFileMan::EscapePHPString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileMan
的用法示例。
在下文中一共展示了CFileMan::EscapePHPString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$strSectionName = "";
if(strlen($sectionname)>0)
{
$strSectionName = "\$sSectionName = \"".CFileMan::EscapePHPString($sectionname)."\";\n";
$bNeedSectionFile = True;
}
$strDirProperties = "\$arDirProperties = array(\n";
$numpropsvals = IntVal($numpropsvals);
$bNeedComma = False;
for($i = 0; $i<$numpropsvals; $i++)
{
if(strlen(Trim($_POST["CODE_".$i]))>0 && strlen(Trim($_POST["VALUE_".$i]))>0)
{
if($bNeedComma) $strDirProperties .= ",\n";
$strDirProperties .= " \"".CFileMan::EscapePHPString(Trim($_POST["CODE_".$i]))."\" => \"".CFileMan::EscapePHPString(Trim($_POST["VALUE_".$i]))."\"";
$bNeedComma = True;
$bNeedSectionFile = True;
}
}
$strDirProperties .= "\n);\n";
if($bNeedSectionFile)
$APPLICATION->SaveFileContent($DOC_ROOT.$path."/.section.php", "<"."?\n".$strSectionName.$strDirProperties."?".">");
else
CFileman::DeleteFile(Array($site, $path."/.section.php"));
if($USER->CanDoFileOperation('fm_edit_permission',$arPath))
{
$arPermissions=Array();
$db_groups = CGroup::GetList($order="sort", $by="asc");
示例2: SaveMenu
function SaveMenu($path, $aMenuLinksTmp, $sMenuTemplateTmp)
{
global $APPLICATION;
CMain::InitPathVars($site, $path);
$DOC_ROOT = CSite::GetSiteDocRoot($site);
$strMenuLinks = "";
if (strlen($sMenuTemplateTmp) > 0) {
$strMenuLinks .= "\$sMenuTemplate = \"" . CFileMan::EscapePHPString($sMenuTemplateTmp) . "\";\n";
}
$strMenuLinks .= "\$aMenuLinks = Array(";
$i = 0;
foreach ($aMenuLinksTmp as $arMenuItem) {
$i++;
$strMenuLinksTmp = "";
if ($i > 1) {
$strMenuLinksTmp .= ",";
}
$strMenuLinksTmp .= "\n" . "\tArray(\n" . "\t\t\"" . CFileMan::EscapePHPString($arMenuItem[0]) . "\", \n" . "\t\t\"" . CFileMan::EscapePHPString($arMenuItem[1]) . "\", \n" . "\t\tArray(";
if (is_array($arMenuItem[2])) {
for ($j = 0, $l = count($arMenuItem[2]); $j < $l; $j++) {
if ($j > 0) {
$strMenuLinksTmp .= ", ";
}
$strMenuLinksTmp .= "\"" . CFileMan::EscapePHPString($arMenuItem[2][$j]) . "\"";
}
}
$strMenuLinksTmp .= "), \n";
$strMenuLinksTmp .= "\t\tArray(";
if (is_array($arMenuItem[3])) {
$arParams = array_keys($arMenuItem[3]);
for ($j = 0, $l = count($arParams); $j < $l; $j++) {
if ($j > 0) {
$strMenuLinksTmp .= ", ";
}
$strMenuLinksTmp .= "\"" . CFileMan::EscapePHPString($arParams[$j]) . "\"=>" . "\"" . CFileMan::EscapePHPString($arMenuItem[3][$arParams[$j]]) . "\"";
}
}
$strMenuLinksTmp .= "), \n" . "\t\t\"" . CFileMan::EscapePHPString($arMenuItem[4]) . "\" \n" . "\t)";
$strMenuLinks .= $strMenuLinksTmp;
}
$strMenuLinks .= "\n);";
$APPLICATION->SaveFileContent($DOC_ROOT . $path, "<" . "?\n" . $strMenuLinks . "\n?" . ">");
$GLOBALS["CACHE_MANAGER"]->CleanDir("menu");
CBitrixComponent::clearComponentCache("bitrix:menu");
}
示例3: unserialize
CFileMan::SaveMenu(array($site, $menu_path), $aMenuLinksTmp, $sMenuTemplateTmp);
if (COption::GetOptionString($module_id, "log_menu", "Y") == "Y") {
$mt = COption::GetOptionString("fileman", "menutypes", $default_value, $site);
$mt = unserialize(str_replace("\\", "", $mt));
$res_log['menu_name'] = $mt[$menutype];
$res_log['path'] = substr($path, 1);
CEventLog::Log("content", "MENU_EDIT", "fileman", "", serialize($res_log));
}
}
}
if (strlen($sectionname) > 0) {
if (COption::GetOptionString($module_id, "log_page", "Y") == "Y") {
$res_log['path'] = substr($pathto, 1);
CEventLog::Log("content", "SECTION_ADD", "fileman", "", serialize($res_log));
}
$APPLICATION->SaveFileContent($DOC_ROOT . $pathto . "/.section.php", "<?\n\$sSectionName=\"" . CFileMan::EscapePHPString($sectionname) . "\";\n?>");
}
if ($e = $APPLICATION->GetException()) {
$strNotice = $e->msg;
} else {
if ($USER->CanDoFileOperation('fm_create_new_file', $arPath) && $USER->CanDoOperation('fileman_admin_files') && $mkindex == "Y") {
if ($toedit == "Y") {
LocalRedirect("/bitrix/admin/fileman_html_edit.php?" . $addUrl . "&site=" . $site . "&template=" . Urlencode($template) . "&path=" . UrlEncode($pathto) . "&filename=index.php&new=Y" . (strlen($back_url) <= 0 ? "" : "&back_url=" . UrlEncode($back_url)) . (strlen($gotonewpage) <= 0 ? "" : "&gotonewpage=" . UrlEncode($gotonewpage)) . (strlen($backnewurl) <= 0 ? "" : "&backnewurl=" . UrlEncode($backnewurl)));
} else {
$APPLICATION->SaveFileContent($DOC_ROOT . $pathto . "/index.php", CFileman::GetTemplateContent($template));
}
}
}
if ($e = $APPLICATION->GetException()) {
$strNotice = $e->msg;
} elseif (strlen($apply) <= 0 && $strNotice == '') {