19 foreach($arTemplates as
$val)
20 $arDirs[] =
"templates/".$val.
"/page_templates";
21 $arDirs[] =
"templates/.default/page_templates";
22 $arDirs[] =
"php_interface/".$lang.
"templates";
23 $arDirs[] =
"php_interface/templates";
40 "php_interface/".
$lang.
"/templates",
41 "templates/.default/page_templates",
42 "php_interface/templates",
44 foreach($arTemplates as
$val)
45 $arDirs[] =
"templates/".$val.
"/page_templates";
51 if($templDir ===
false)
53 $dirPath =
$_SERVER[
"DOCUMENT_ROOT"].$templDir;
54 if(file_exists($dirPath))
56 $sDescFile = $dirPath.
"/.content.php";
58 if(file_exists($sDescFile))
61 if(
$handle = @opendir($dirPath))
63 while(($file = readdir(
$handle)) !==
false)
65 if(is_dir($dirPath.
"/".$file))
67 if(str_starts_with($file,
"."))
70 $path = $templDir.
"/".$file;
75 "name" => mb_substr($file, 0,
bxstrrpos($file,
".")),
81 if(array_key_exists($file, $TEMPLATE))
83 if(array_key_exists(
"name", $TEMPLATE[$file]))
84 $restmp[
"name"] = $TEMPLATE[$file][
"name"];
85 if(array_key_exists(
"sort", $TEMPLATE[$file]))
86 $restmp[
"sort"] = $TEMPLATE[$file][
"sort"];
89 $res[$file] = $restmp;
97 return array_values(
$res);
112 if(!($arSite =
$res->Fetch()))
116 $addUrl = ($bLogical?
"logical=Y":
"");
118 $arDirPath = explode(
"/",
$path);
124 $html_path =
'<a href="'.$url.
'?lang='.LANG.
'&'.
$addUrl.
'">'.
GetMessage(
"MAIN_ROOT_FOLDER").
'</a>/';
128 $html_path =
GetMessage(
"MAIN_ROOT_FOLDER").
"/";
135 $html_path .=
'<a href="'.$url.
'?lang='.LANG.
'&'.
$addUrl.
'&site='.
$site.
'">'.$arSite[
"NAME"].
'</a>/';
139 $html_path .= $arSite[
"NAME"].
"/";
144 $pathLast =
count($arDirPath)-1;
146 foreach($arDirPath as
$i => $pathPart)
151 $prev_path = $full_path;
152 $full_path .=
"/".$pathPart;
156 if($bLogical &&
$io->DirectoryExists(
$DOC_ROOT.$full_path))
158 if(!
$io->FileExists(
$DOC_ROOT.$full_path.
"/.section.php"))
161 include(
$io->GetPhysicalName(
$DOC_ROOT.$full_path.
"/.section.php"));
166 if(
$i==$pathLast && (!$bLast || !
$io->DirectoryExists(
$DOC_ROOT.$full_path)))
176 $html_path .=
"<a href=\"".$url.
"?lang=".LANG.
'&'.
$addUrl.
"&path=".UrlEncode($full_path).($site?
"&site=".$site :
"").($param<>
""?
"&".$param:
"").
"\">".
$sSectionName.
"</a>/";
177 if(!$arSite || !$bLogical || rtrim($arSite[
"DIR"],
"/") != rtrim($full_path,
"/"))
180 "LINK" =>
$url.
"?lang=".LANG.
"&".
$addUrl.
"&path=".UrlEncode($full_path).(
$site?
"&site=".
$site :
"").($param<>
""?
"&".$param:
""),
188 "PREV" => $prev_path,
189 "FULL" => $full_path,
190 "HTML" => $html_path,
200 if(mb_strtolower(
$order) ==
"desc")
202 if($by==
"size")
return intval($f1[
"SIZE"])<intval($f2[
"SIZE"]);
203 if($by==
"timestamp")
return intval($f1[
"TIMESTAMP"])<intval($f2[
"TIMESTAMP"]);
204 return $f1[
"NAME"]<$f2[
"NAME"];
208 if($by==
"size")
return intval($f1[
"SIZE"])>intval($f2[
"SIZE"]);
209 if($by==
"timestamp")
return intval($f1[
"TIMESTAMP"])>intval($f2[
"TIMESTAMP"]);
210 return $f1[
"NAME"]>$f2[
"NAME"];
224 $exts = mb_strtolower(
$arFilter[
"EXTENSIONS"] ??
'');
225 $arexts=explode(
",", $exts);
236 $date_format = CDatabase::DateFormatToPHP(CLang::GetDateFormat(
"FULL"));
237 $tzOffset = CTimeZone::GetOffset();
240 $arChildren =
$dir->GetChildren();
241 $arExtension =
array(
"php"=>1,
"html"=>1,
"php3"=>1,
"php4"=>1,
"php5"=>1,
"php6"=>1,
"phtml"=>1,
"htm"=>1);
242 foreach ($arChildren as $child)
246 if((
$type==
"F" ||
$type==
"") && $child->IsDirectory())
248 if((
$type==
"D" ||
$type==
"") && !$child->IsDirectory())
251 $file = $child->GetName();
255 if($child->IsDirectory())
258 $fsn =
$io->CombinePath(
$abs_path, $file,
".section.php");
259 if(!
$io->FileExists($fsn))
262 include(
$io->GetPhysicalName($fsn));
268 if(!isset($arExtension[$ext]))
271 if($file==
'.section.php')
274 if(!preg_match(
'/^\.(.*)?\.menu\.(php|html|php3|php4|php5|php6|phtml)$/', $file, $regs))
282 $arFile[
"LOGIC_NAME"] =
$title;
288 $arFile[
"ABS_PATH"] =
$path.
"/".$file;
289 $arFile[
"NAME"] = $file;
294 $arFile[
"PERMISSION"] = $arPerm[0];
295 if (!empty($arPerm[1]))
296 $arFile[
"PERMISSION_EX"] = $arPerm[1];
299 $arFile[
"PERMISSION"] = $arPerm;
301 $arFile[
"TIMESTAMP"] = $child->GetModificationTime() + $tzOffset;
302 $arFile[
"DATE"] = date($date_format, $arFile[
"TIMESTAMP"]);
304 if (isset(
$arFilter[
"TIMESTAMP_1"]) && strtotime($arFile[
"DATE"]) < strtotime(
$arFilter[
"TIMESTAMP_1"]))
306 if (isset(
$arFilter[
"TIMESTAMP_2"]) && strtotime($arFile[
"DATE"]) > strtotime(
$arFilter[
"TIMESTAMP_2"]))
312 if(!$child->IsDirectory() && $arFile[
"PERMISSION"]<=
"R" && !$task_mode)
317 if(!empty(
$arFilter[
"NAME"]) && mb_strpos($arFile[
"LOGIC_NAME"],
$arFilter[
"NAME"]) ===
false)
322 if(!empty(
$arFilter[
"NAME"]) && mb_strpos($arFile[
"NAME"],
$arFilter[
"NAME"]) ===
false)
329 if(str_starts_with($arFile[
"ABS_PATH"],
BX_ROOT .
"/modules") && !
$USER->CanDoOperation(
'edit_php') && !$task_mode)
332 if ($arFile[
"PERMISSION"]==
"U" && !$task_mode)
335 if ($ftype!=
"SOURCE" && $ftype!=
"IMAGE" && $ftype!=
"UNKNOWN")
continue;
336 if (str_starts_with($arFile[
"NAME"],
"."))
continue;
339 if($child->IsDirectory())
342 $arFile[
"TYPE"] =
"D";
348 if(!in_array(mb_strtolower(mb_substr($file,
bxstrrpos($file,
".") + 1)), $arexts))
351 $arFile[
"TYPE"] =
"F";
352 $arFile[
"SIZE"] = $child->GetFileSize();
357 if(is_array($sort) && !empty($sort))
360 $order = mb_strtolower($sort[$by]);
361 $by = mb_strtolower($by);
364 if($by!=
"size" && $by!=
"timestamp" && $by!=
"name_nat")
377 (\$APPLICATION->SetTitle\()
379 "[^"\\\\]*(?:\\\\.[^"\\\\]*)*" # match double quoted string
381 \'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\' # match single quoted string
384 /ix', $prolog, $regs)
391 $p = mb_strpos($prolog,
"prolog_before");
393 $p = mb_strpos($prolog,
"prolog.php");
395 $p = mb_strpos($prolog,
"header.php");
400 $prolog = preg_replace(
"#<title>[^<]*</title>#i",
"", $prolog);
401 elseif(preg_match(
"#<title>[^<]*</title>#i", $prolog))
402 $prolog = preg_replace(
"#<title>[^<]*</title>#i",
"<title>".
$title.
"</title>", $prolog);
408 $p = mb_strpos(mb_substr($prolog,
$p),
")") +
$p;
409 $prolog = mb_substr($prolog, 0,
$p + 1).
";\n\$APPLICATION->SetTitle(\"".
EscapePHPString(
$title).
"\")".mb_substr($prolog,
$p + 1);
417 if(preg_match(
"'(\\\$APPLICATION->SetPageProperty\\(\"".preg_quote(
EscapePHPString($property_key),
"'").
"\" *, *)([\"\\'])(.*?)(?<!\\\\)([\"\\'])(\\);[\r\n]*)'i", $prolog, $regs)
418 || preg_match(
"'(\\\$APPLICATION->SetPageProperty\\(\\'".preg_quote(
EscapePHPString($property_key,
"'"),
"'").
"\\' *, *)([\"\\'])(.*?)(?<!\\\\)([\"\\'])(\\);[\r\n]*)'i", $prolog, $regs))
420 if ($property_val ==
'')
421 $prolog = str_replace($regs[1].$regs[2].$regs[3].$regs[4].$regs[5],
"", $prolog);
423 $prolog = str_replace($regs[1].$regs[2].$regs[3].$regs[4].$regs[5], $regs[1].$regs[2].
EscapePHPString($property_val, $regs[2]).$regs[4].$regs[5], $prolog);
427 if ($property_val <>
'')
429 $p = mb_strpos($prolog,
"prolog_before");
431 $p = mb_strpos($prolog,
"prolog.php");
433 $p = mb_strpos($prolog,
"header.php");
436 $p = mb_strpos(mb_substr($prolog,
$p),
")") +
$p;
437 $prolog = mb_substr($prolog, 0,
$p + 1).
";\n\$APPLICATION->SetPageProperty(\"".
EscapePHPString($property_key).
"\", \"".
EscapePHPString($property_val).
"\")".mb_substr($prolog,
$p + 1);
446 if(str_contains($src,
"<?"))
448 if(preg_match(
"/(<script[^>]*language\\s*=\\s*)('|\"|)php('|\"|)([^>]*>)/i", $src))
static GetFileTypeEx($fileName)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
$_SERVER["DOCUMENT_ROOT"]
SetPrologProperty($prolog, $property_key, $property_val)
SetPrologTitle($prolog, $title)
GetDirList($path, &$arDirs, &$arFiles, $arFilter=array(), $sort=array(), $type="DF", $bLogical=false, $task_mode=false)
GetTemplateContent($filename, $lang=LANG, $arTemplates=array())
CompareFiles($f1, $f2, $sort=array())
ParsePath($path, $bLast=false, $url=false, $param="", $bLogical=false)
GetFileTemplates($lang=LANG, $arTemplates=array())
if(!defined('SITE_ID')) $lang
EscapePHPString($str, $encloser='"')
bxstrrpos($haystack, $needle)
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
GetMessage($name, $aReplace=null)
sortByColumn(array &$array, $columns, $callbacks='', $defaultValueIfNotSetValue=null, $preserveKeys=false)
getLocalPath($path, $baseFolder="/bitrix")
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"