12 $userAliasesCache =
array(),
13 $arPassFormShowed =
array();
18 if (intval($main_params[
"IBlockID"]) <= 0)
24 if (isset($additional_params[
"cache_path"]) && !empty($additional_params[
"cache_path"]))
25 $cache_path = rtrim(trim($additional_params[
"cache_path"]),
'/');
27 $cache_path =
"/photogallery";
34 $this->arCache =
array(
35 "time" => intval($additional_params[
"cache_time"]),
36 "path" => str_replace(
"//",
"/", $cache_path)
38 $this->arError =
array(
39 "show_error" => ($additional_params[
"show_error"] ??
'') ===
"N" ?
"N" :
"Y",
40 "set_404" => $additional_params[
"set_404"] ==
"Y" ?
"Y" :
"N"
43 $this->IBlockID = intval($main_params[
"IBlockID"]);
45 if (!empty($main_params[
"GalleryID"]))
47 $this->Gallery = $this->
GetGallery($main_params[
"GalleryID"]);
51 $this->User[
"Permission"] = (!empty($main_params[
"Permission"]) ? $main_params[
"Permission"] : $this->
GetPermission());
60 "id" => serialize(
array(
61 "iblock_id" => $this->IBlockID,
62 "user_alias" => $gallery_id,
64 "gallery" => $gallery_id
67 "path" => $this->arCache[
"path"],
68 "time" => $this->arCache[
"time"]
71 if(($tzOffset = CTimeZone::GetOffset()) <> 0)
76 $cache =
new CPHPCache;
83 CModule::IncludeModule(
"iblock");
85 "IBLOCK_ACTIVE" =>
"Y",
86 "IBLOCK_ID" => $this->IBlockID,
91 $db_res = CIBlockSection::GetList(
103 $cache->EndDataCache(
$res);
110 if ($this->arError[
"show_error"] ==
"Y")
112 if ($this->arError[
"set_404"] ==
"Y")
114 @define(
"ERROR_404",
"Y");
121 if ($this->arError[
"show_error"] ==
"Y")
138 "id" => serialize(
array(
139 "iblock_id" => $this->IBlockID,
141 "gallery_id" => $this->Gallery && $this->Gallery[
'ID'] ? $this->Gallery[
'ID'] :
"0",
145 "path" => $this->arCache[
"path"],
146 "time" => $this->arCache[
"time"]
149 if(($tzOffset = CTimeZone::GetOffset()) <> 0)
154 $cache =
new CPHPCache;
161 CModule::IncludeModule(
"iblock");
163 "IBLOCK_ACTIVE" =>
"Y",
164 "IBLOCK_ID" => $this->IBlockID,
168 $db_res = CIBlockSection::GetList(
176 if ($this->arError[
"show_error"] ==
"Y")
178 if ($this->arError[
"set_404"] ==
"Y")
180 @define(
"ERROR_404",
"Y");
185 elseif ($arSection[
"ACTIVE"] !=
"Y" && $this->User[
"Permission"] <
"U")
187 if ($this->arError[
"show_error"] ==
"Y")
191 elseif ($this->Gallery && ($arSection[
"LEFT_MARGIN"] < $this->Gallery[
"LEFT_MARGIN"] ||
192 $this->Gallery[
"RIGHT_MARGIN"] < $arSection[
"RIGHT_MARGIN"]))
200 $arSection[
"SECTIONS_CNT"] = 0;
201 if (($arSection[
"RIGHT_MARGIN"] - $arSection[
"LEFT_MARGIN"]) > 1)
202 $arSection[
"SECTIONS_CNT"] = intval(CIBlockSection::GetCount(
array(
"SECTION_ID" => $arSection[
"ID"])));
204 $arSection[
"SECTION_ELEMENTS_CNT"] = $arSection[
"SECTION_ELEMENTS_CNT_ALL"] = $arSection[
"ELEMENTS_CNT"] = 0;
205 $arSection[
"ELEMENTS_CNT_ALL"] = intval(CIBlockSection::GetSectionElementsCount(
206 $arSection[
"ID"],
array(
"CNT_ALL" =>
"Y")));
209 if ($arSection[
"ELEMENTS_CNT_ALL"] > 0)
211 if ($arSection[
"SECTIONS_CNT"] > 0)
213 $arSection[
"SECTION_ELEMENTS_CNT_ALL"] = intval(CIBlockElement::GetList(
215 array(
"SECTION_ID" => $arSection[
"ID"]),
222 $arSection[
"SECTION_ELEMENTS_CNT_ALL"] = $arSection[
"ELEMENTS_CNT_ALL"];
224 if ($this->User[
"Permission"] <
"U")
226 $arSection[
"ELEMENTS_CNT"] = intval(CIBlockSection::GetSectionElementsCount($arSection[
"ID"],
array(
"CNT_ACTIVE" =>
"Y")));
230 $arSection[
"ELEMENTS_CNT"] = $arSection[
"ELEMENTS_CNT_ALL"];
233 if ($arSection[
"ELEMENTS_CNT"] <= 0)
234 $arSection[
"SECTION_ELEMENTS_CNT"] = 0;
236 elseif ($arSection[
"ELEMENTS_CNT_ALL"] == $arSection[
"ELEMENTS_CNT"])
237 $arSection[
"SECTION_ELEMENTS_CNT"] = $arSection[
"SECTION_ELEMENTS_CNT_ALL"];
238 elseif ($arSection[
"SECTIONS_CNT"] <= 0)
239 $arSection[
"SECTION_ELEMENTS_CNT"] = $arSection[
"ELEMENTS_CNT"];
242 $arSection[
"SECTION_ELEMENTS_CNT"] = intval(CIBlockElement::GetList(
244 array(
"SECTION_ID" => $arSection[
"ID"],
"ACTIVE" =>
"Y"),
251 $arUserFields =
$GLOBALS[
"USER_FIELD_MANAGER"]->GetUserFields(
"IBLOCK_".$this->IBlockID.
"_SECTION", $arSection[
"ID"], LANGUAGE_ID);
252 $arSection[
"USER_FIELDS"] = $arUserFields;
253 $arSection[
"DATE"] = $arSection[
"~DATE"] = $arUserFields[
"UF_DATE"] ??
null;
254 $arSection[
"~PASSWORD"] = $arUserFields[
"UF_PASSWORD"] ??
null;
255 if (is_array($arSection[
"~PASSWORD"]))
256 $arSection[
"PASSWORD"] = $arSection[
"~PASSWORD"][
"VALUE"];
258 $arSection[
"PICTURE"] = CFile::GetFileArray($arSection[
"PICTURE"]);
259 $arSection[
"DETAIL_PICTURE"] = CFile::GetFileArray($arSection[
"DETAIL_PICTURE"]);
260 $arSection[
"PATH"] =
array();
264 $arUserFields =
$GLOBALS[
"USER_FIELD_MANAGER"]->GetUserFields(
"IBLOCK_".$this->IBlockID.
"_SECTION",
$res[
"ID"], LANGUAGE_ID);
265 $res[
"~PASSWORD"] = $arUserFields[
"UF_PASSWORD"] ??
null;
266 if (is_array(
$res[
"~PASSWORD"]))
267 $res[
"PASSWORD"] =
$res[
"~PASSWORD"][
"VALUE"];
268 $arSection[
"PATH"][
$res[
"ID"]] =
$res;
275 $cache->EndDataCache($arSection);
286 CModule::IncludeModule(
"iblock");
287 $db_res = CIBlockSection::GetList(
290 "IBLOCK_ID" => $arSection[
"IBLOCK_ID"],
292 "!LEFT_MARGIN" => $arSection[
"LEFT_MARGIN"],
293 "!RIGHT_MARGIN" => $arSection[
"RIGHT_MARGIN"],
294 "!ID" => $arSection[
"ID"]),
300 if ($this->arError[
"show_error"] ==
"Y")
302 if ($this->arError[
"set_404"] ==
"Y")
304 @define(
"ERROR_404",
"Y");
318 $user_id = intval(
$GLOBALS[
"USER"]->GetID());
319 $user_groups =
$GLOBALS[
"USER"]->GetGroups();
321 if (!$this->IBlockID)
325 "id" => serialize(
array(
326 "iblock_id" => $this->IBlockID,
327 "permission" => $user_groups,
330 "path" => $this->arCache[
"path"],
331 "time" => $this->arCache[
"time"]
336 $cache =
new CPHPCache;
343 CModule::IncludeModule(
"iblock");
366 $arSection = (!is_array($arSection) ?
array() : $arSection);
367 if ($permission <
"R")
372 elseif ($permission <
"U" && !empty($arSection) && $arSection[
"ELEMENTS_CNT"] <= 0)
377 elseif ($permission <
"U" && !empty($arSection[
"PATH"]))
379 $password_checked =
true;
381 foreach ($arSection[
"PATH"] as
$key =>
$res)
383 if (empty(
$res[
"PASSWORD"]))
387 $_SESSION[
'PHOTOGALLERY'][
'SECTION'][$arSection[
"ID"]] = $arSection[
"PASSWORD"];
390 foreach ($arSection[
"PATH"] as
$key =>
$res)
392 if (empty(
$res[
"PASSWORD"]))
395 if (
$res[
"PASSWORD"] != ($_SESSION[
'PHOTOGALLERY'][
'SECTION'][
$res[
"ID"]] ??
null))
397 $password_checked =
false;
401 <div
class=
"photo-info-box photo-album-password">
402 <div
class=
"photo-info-box-inner">
405 <?
if (
$res[
"ID"] != $arSection[
"ID"]):?>
406 <?=
GetMessage(
"P_PARENT_ALBUM_IS_PASSWORDED")?>
410 <?=str_replace(
"#NAME#",
$res[
"NAME"],
GetMessage(
"P_ALBUM_IS_PASSWORDED_TITLE"))
412 <form method=
"post" action=
"<?=POST_FORM_ACTION_URI?>" class=
"photo-form">
414 <label
for=
"password_<?=$res["ID
"]?>"><?=
GetMessage(
"P_PASSWORD")?>: </label>
415 <input type=
"password" class=
"password" name=
"password_<?=$res["ID
"]?>" <?
416 ?>
id=
"password_<?=$res["ID
"]?>" value=
"" />
417 <input type=
"submit" class=
"submit" name=
"supply_password" value=
"<?=GetMessage("P_ENTER
")?>" />
422 self::$arPassFormShowed[$arSection[
"ID"]] =
true;
428 return $password_checked;
436 return isset(self::$arPassFormShowed[$sectId]) && self::$arPassFormShowed[$sectId];
450 $url = preg_replace(
"/#user_alias#/iu", $alias,
$path);
459 foreach($arUserIds as
$k => $id)
460 if (isset(self::$userAliasesCache[
$iblockId][$id]))
461 unset($arUserIds[
$k]);
463 if (
count($arUserIds) > 0)
465 CModule::IncludeModule(
"iblock");
467 $db_res = CIBlockSection::GetList(
468 array(
"ID",
"CREATED_BY",
"CODE",
"IBLOCK_ID",
"IBLOCK_SECTION_ID",
"ACTIVE"),
471 "IBLOCK_ACTIVE" =>
"Y",
474 "CREATED_BY" => $arUserIds
481 if (isset(self::$userAliasesCache[
$iblockId][
$res[
'CREATED_BY']]))
488 private static function GetUniqAjaxId()
490 $uniq = COption::GetOptionString(
"photogallery",
"~uniq_ajax_id",
"");
493 $uniq = md5(uniqid(rand(),
true));
494 COption::SetOptionString(
"photogallery",
"~uniq_ajax_id", $uniq);
501 return md5(implode(
'*',
$params).
"||".CPGalleryInterface::GetUniqAjaxId());
506 return (md5(implode(
'*',
$params).
"||".CPGalleryInterface::GetUniqAjaxId()) ===
$sign);
511 if (
$GLOBALS[
"USER"]->CanDoOperation(
'edit_php'))
516 "MESSAGE" =>
GetMessage(
"P_UPLOADER_TYPE_NOTIFY"),
517 "TAG" =>
"PHOTOGALLERY_UPLOADER",
518 "MODULE_ID" =>
"PHOTOGALLERY"
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
static DeleteByTag($tagId)
static SetStatus($status)
static GetSign($params=array())
__construct($main_params=array(), $additional_params=array())
GetSection($id, &$arSection, $params=array())
static CheckUploaderType($type="")
GetSectionGallery($arSection=array())
static HandleUserAliases($arUserIds=array(), $iblockId=0)
CheckPermission($permission="D", $arSection=array(), $bOutput=true)
static CheckSign($sign, $params=array())
IsPassFormDisplayed($sectId)
static GetPathWithUserAlias($path, $userId=false, $iblockId=0)
static GetUserAlias($userId=false, $iblockId=0)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
GetIBlockSectionPath($IBLOCK_ID, $SECTION_ID)
bitrix_sessid_post($varname='sessid', $returnInvocations=false)
check_bitrix_sessid($varname='sessid')
ShowError($strError, $cls="errortext")
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
GetMessage($name, $aReplace=null)
ShowNote($strNote, $cls="notetext")
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
if(empty($signedUserToken)) $key
</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."%"
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
$GLOBALS['_____370096793']