25 BX_PERSONAL_ROOT.
"/templates",
28 foreach($folders as $folder)
36 while(($file = readdir(
$handle)) !==
false)
38 if($file ==
"." || $file ==
".." || !is_dir(
$path.
"/".$file))
41 if($file ==
".default")
52 $fname =
$path.
"/".$file.
"/description.php";
53 if(file_exists(($fname)))
69 if($arSelect ===
false || in_array(
"SCREENSHOT", $arSelect))
71 if(file_exists(
$path.
"/".$file.
"/lang/".LANGUAGE_ID.
"/screen.gif"))
72 $arTemplate[
"SCREENSHOT"] = $folder.
"/".$file.
"/lang/".LANGUAGE_ID.
"/screen.gif";
74 $arTemplate[
"SCREENSHOT"] = $folder.
"/".$file.
"/screen.gif";
78 if(file_exists(
$path.
"/".$file.
"/lang/".LANGUAGE_ID.
"/preview.gif"))
79 $arTemplate[
"PREVIEW"] = $folder.
"/".$file.
"/lang/".LANGUAGE_ID.
"/preview.gif";
81 $arTemplate[
"PREVIEW"] = $folder.
"/".$file.
"/preview.gif";
86 if($arSelect ===
false || in_array(
"CONTENT", $arSelect))
91 if($arSelect ===
false || in_array(
"STYLES", $arSelect))
93 if(file_exists(
$path.
"/".$file.
"/styles.css"))
99 if(file_exists(
$path.
"/".$file.
"/template_styles.css"))
110 if(is_array($arOrder))
113 static $fields =
array(
"ID"=>1,
"NAME"=>1,
"DESCRIPTION"=>1,
"SORT"=>1);
119 $columns[
$key] = (mb_strtoupper(
$val) ==
"DESC"? SORT_DESC : SORT_ASC);
137 if (
$io->FileExists($file))
138 return include($file);
152 $this->LAST_ERROR =
"";
158 $this->LAST_ERROR .=
GetMessage(
"MAIN_ENTER_TEMPLATE_ID").
" ";
160 $this->LAST_ERROR .=
GetMessage(
"MAIN_TEMPLATE_ID_EX").
" ";
163 $this->LAST_ERROR .=
GetMessage(
"MAIN_TEMPLATE_CONTENT_NA").
" ";
168 $this->LAST_ERROR .=
GetMessage(
"MAIN_TEMPLATE_CONTENT_NA").
" ";
169 $arMsg[] =
array(
"id"=>
"CONTENT",
"text"=>
GetMessage(
"MAIN_TEMPLATE_CONTENT_NA"));
173 $this->LAST_ERROR .=
GetMessage(
"MAIN_TEMPLATE_WORKAREA_NA").
" ";
174 $arMsg[] =
array(
"id"=>
"CONTENT",
"text"=>
GetMessage(
"MAIN_TEMPLATE_WORKAREA_NA"));
183 if($this->LAST_ERROR <>
'')
202 $p = mb_strpos(
$arFields[
"CONTENT"],
"#WORK_AREA#");
205 $footer = mb_substr(
$arFields[
"CONTENT"],
$p + mb_strlen(
"#WORK_AREA#"));
246 $p = mb_strpos(
$arFields[
"CONTENT"],
"#WORK_AREA#");
249 $footer = mb_substr(
$arFields[
"CONTENT"],
$p + mb_strlen(
"#WORK_AREA#"));
265 $ar_t = $db_t->Fetch();
270 $arFields[
"DESCRIPTION"] = $ar_t[
"DESCRIPTION"];
276 $arFields[
"EDITOR_STYLES"] = $ar_t[
"EDITOR_STYLES"];
288 if(
$ID ==
".default")
320 if($templPath ===
false)
327 foreach($arResTmp as $file)
329 switch($file[
"NAME"])
331 case "chain_template.php":
332 $file[
"DESCRIPTION"] =
GetMessage(
"MAIN_TEMPLATE_NAV");
335 $file[
"DESCRIPTION"] =
"";
338 if((
$p = mb_strpos($file[
"NAME"],
".menu_template.php"))!==
false)
339 $file[
"DESCRIPTION"] = str_replace(
"#MENU_TYPE#", mb_substr($file[
"NAME"], 0,
$p),
GetMessage(
"MAIN_TEMPLATE_MENU"));
344 $nTemplateLen = mb_strlen($templPath.
"/");
345 foreach($arDirsTmp as
$dir)
348 $arDir[
"DEPTH_LEVEL"] = $depth;
351 if($depth < $maxDepth)
353 $dirPath = mb_substr($arDir[
"ABS_PATH"], $nTemplateLen);
365 if(isset($stylesDesc) && is_array($stylesDesc))
368 if (is_array($curStylesDesc))
372 if (!is_array($curStylesDesc[
$code]))
373 unset($curStylesDesc[
$code]);
383 $APPLICATION->SaveFileContent($stylesPath,
'<'.
'?'.
"\nreturn ".var_export($curStylesDesc, 1).
";\n".
'?'.
'>');
392 $arDescription =
array(
394 "DESCRIPTION" =>
$arFields[
'DESCRIPTION'],
399 $arDescription[
"EDITOR_STYLES"] =
$arFields[
'EDITOR_STYLES'];
400 $APPLICATION->SaveFileContent($descPath,
'<'.
'?'.
"\n\$arTemplate = ".var_export($arDescription, 1).
";\n".
'?'.
'>');
static loadLanguageFile($file, $language=null, $normalize=true)
static sortByColumn(array &$array, $columns, $callbacks='', $defaultValueIfNotSetValue=null, $preserveKeys=false)
CheckFields($arFields, $ID=false)
static GetList($arOrder=array(), $arFilter=array(), $arSelect=false)
static SaveStyleDescription($stylesDesc=array(), $stylesPath)
static SaveDescription($arFields=array(), $descPath)
static __GetByStylesTitle($file)
static DirsRecursive($ID, $path="", $depth=0, $maxDepth=1)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
$_SERVER["DOCUMENT_ROOT"]
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
GetDirList($path, &$arDirs, &$arFiles, $arFilter=array(), $sort=array(), $type="DF", $bLogical=false, $task_mode=false)
EscapePHPString($str, $encloser='"')
DeleteDirFilesEx($path, $root=null)
GetMessage($name, $aReplace=null)
getLocalPath($path, $baseFolder="/bitrix")
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
if(empty($signedUserToken)) $key