<!-- Photo List <?php echo $arParams["ID"]; ?> --> <div class="empty-clear"></div> <?php foreach ($arResult["ELEMENTS_LIST"] as $key => $arItem) { if (!is_array($arItem)) { continue; } elseif ($arParams["SHOW_DATE"] == "Y") { $this_date = PhotoFormatDate($arItem["~DATE_CREATE"], "DD.MM.YYYY HH:MI:SS", "d.m.Y"); if ($this_date != $current_date) { $current_date = $this_date; ?> <div class="group-by-days photo-date"><?php echo PhotoDateFormat($arParams["NEW_DATE_TIME_FORMAT"], MakeTimeStamp($this_date, "DD.MM.YYYY")); ?> </div><?php } } $title = isset($arItem["PREVIEW_TEXT"]) && $arItem["PREVIEW_TEXT"] != '' ? $arItem["PREVIEW_TEXT"] : $arItem["NAME"]; $arItem["TITLE"] = $title . ($arItem["ACTIVE"] != "Y" ? GetMessage("P_PHOTO_NOT_APPROVED") : ""); if ($arParams["SHOW_COMMENTS"] != "N") { $arItem["COMMENTS"] = intVal($arParams["COMMENTS_TYPE"] != "blog" ? $arItem["PROPERTIES"]["FORUM_MESSAGE_CNT"]["VALUE"] : $arItem["PROPERTIES"]["BLOG_COMMENTS_CNT"]["VALUE"]); } call_user_func("__photo_template_" . $sTemplateName, $arItem, $arParams, $this); } ?> <div class="empty-clear"></div> <!-- Photo List End <?php echo $arParams["ID"];
} } elseif (intVal($_REQUEST["IBLOCK_SECTION_ID"]) > 0) { $arFields["IBLOCK_SECTION_ID"] = $_REQUEST["IBLOCK_SECTION_ID"]; } if (!empty($_REQUEST["PASSWORD"])) { $arFields["UF_PASSWORD"] = md5($_REQUEST["PASSWORD"]); $GLOBALS["UF_PASSWORD"] = md5($_REQUEST["PASSWORD"]); } $bs = new CIBlockSection(); $GLOBALS["USER_FIELD_MANAGER"]->EditFormAddFields("IBLOCK_" . $arParams["IBLOCK_ID"] . "_SECTION", $arFields); $ID = $bs->Add($arFields); if ($ID > 0) { $rsSection = CIBlockSection::GetList(array(), array("ID" => $ID), false); $arResultSection = $rsSection->GetNext(); $arResult["URL"] = CComponentEngine::MakePathFromTemplate($arParams["~SECTION_URL"], array("USER_ALIAS" => $arParams["USER_ALIAS"], "SECTION_ID" => $ID)); $arResultFields = array("IBLOCK_ID" => $arParams["IBLOCK_ID"], "DATE" => PhotoDateFormat($arParams["DATE_TIME_FORMAT"], MakeTimeStamp($_REQUEST["UF_DATE"], CSite::GetDateFormat())), "NAME" => $arResultSection["NAME"], "DESCRIPTION" => $arResultSection["DESCRIPTION"], "PASSWORD" => $arResultSection["UF_PASSWORD"], "ID" => $ID, "error" => "", "url" => $arResult["URL"]); } elseif ($bs->LAST_ERROR) { $strWarning .= $bs->LAST_ERROR; $bVarsFromForm = true; } else { $err = $GLOBALS['APPLICATION']->GetException(); if ($err) { $strWarning .= $err->GetString(); } $bVarsFromForm = true; } } elseif ($arParams["ACTION"] == "DROP") { @set_time_limit(1000); if (CIBlockSection::Delete($arResult["SECTION"]["ID"])) { // /Must Be deleted if ($arParams["BEHAVIOUR"] == "USER" && intVal($arResult["SECTION"]["IBLOCK_SECTION_ID"]) == intVal($arResult["GALLERY"]["ID"])) {
$arSelect = array("ID", "NAME", "DETAIL_TEXT", "DETAIL_TEXT_TYPE", "TAGS", "DATE_CREATE", "CREATED_BY"); $db_res = CIBlockElement::GetList(array(), array("ID" => $arParams["ELEMENT_ID"]), false, false, $arSelect); if ($db_res && ($res = $db_res->GetNext())) { $result = array("TAGS" => $res["TAGS"], "TITLE" => $res["NAME"], "DESCRIPTION" => $res["DETAIL_TEXT"], "DATE" => $res["DATE_CREATE"]); } else { $result = array("TAGS" => htmlspecialcharsEx($_REQUEST["TAGS"]), "TITLE" => htmlspecialcharsEx($_REQUEST["TITLE"]), "DESCRIPTION" => htmlspecialcharsEx($_REQUEST["DESCRIPTION"]), "DATE" => htmlspecialcharsEx($_REQUEST["DATE_CREATE"])); } } $arResult["URL"] = CComponentEngine::MakePathFromTemplate($arParams["~DETAIL_URL"], array("USER_ALIAS" => $arParams["USER_ALIAS"], "SECTION_ID" => $_REQUEST["TO_SECTION_ID"], "ELEMENT_ID" => $arResult["ELEMENT"]["ID"])); } } if (empty($arError)) { PClearComponentCache(array("search.page", "search.tags.cloud", "photogallery.detail/" . $arParams["IBLOCK_ID"] . "/detail/" . $_REQUEST["TO_SECTION_ID"] . "/", "photogallery.detail/" . $arParams["IBLOCK_ID"] . "/detail/" . $arResult["SECTION"]["ID"] . "/", "photogallery.detail.comment", "photogallery.detail.list/" . $arParams["IBLOCK_ID"] . "/detaillist/0", "photogallery.detail.list/" . $arParams["IBLOCK_ID"] . "/detaillist/" . $_REQUEST["TO_SECTION_ID"], "photogallery.detail.list/" . $arParams["IBLOCK_ID"] . "/detaillist/" . $arResult["SECTION"]["ID"], "photogallery.section/" . $arParams["IBLOCK_ID"] . "/section" . $arResult["SECTION"]["ID"], "photogallery.section/" . $arParams["IBLOCK_ID"] . "/section" . $arResult["SECTION"]["IBLOCK_SECTION_ID"], "photogallery.section.list/" . $arParams["IBLOCK_ID"] . "/section" . $arResult["SECTION"]["ID"], "photogallery.section.list/" . $arParams["IBLOCK_ID"] . "/sections" . $arResult["SECTION"]["IBLOCK_SECTION_ID"])); if ($arParams["AJAX_CALL"] == "Y") { $APPLICATION->RestartBuffer(); $result["DATE"] = PhotoDateFormat($arParams["DATE_TIME_FORMAT"], MakeTimeStamp($result["DATE"], CSite::GetDateFormat())); echo CUtil::PhpToJSObject($result); die; } else { LocalRedirect($arResult["URL"]); } } else { $bVarsFromForm = true; $e = new CAdminException($arError); $arResult["ERROR_MESSAGE"] = $e->GetString(); } } elseif ($_REQUEST["edit"] == "cancel") { LocalRedirect($arResult["~DETAIL_LINK"]); } /******************************************************************** /Action
return false; } elseif ($res == 301) { $url = CComponentEngine::MakePathFromTemplate($arParams["~SECTION_URL"], array("USER_ALIAS" => $arGallery["CODE"], "SECTION_ID" => $arParams["SECTION_ID"])); if ($url == POST_FORM_ACTION_URI) { $url = CComponentEngine::MakePathFromTemplate($arParams["~INDEX_URL"], array()); } LocalRedirect($url, false, "301 Moved Permanently"); return false; } elseif (!$oPhoto->CheckPermission($arParams["PERMISSION"], $arResult["SECTION"])) { if ($arParams["SET_TITLE"] == "Y") { $GLOBALS["APPLICATION"]->SetTitle(GetMessage('P_SECTION_ACCESS_DENIED')); } return false; } if (is_array($arResult["SECTION"]["~DATE"])) { $arResult["SECTION"]["DATE"]["VALUE"] = PhotoDateFormat($arParams["DATE_TIME_FORMAT"], MakeTimeStamp($arResult["SECTION"]["~DATE"]["VALUE"], CSite::GetDateFormat())); } /******************************************************************** /Main data ********************************************************************/ /******************************************************************** Prepare Data ********************************************************************/ $url = array(); if ($arParams["BEHAVIOUR"] == "USER" && $arResult["SECTION"]["IBLOCK_SECTION_ID"] == $arResult["GALLERY"]["ID"]) { $url["BACK_LINK"] = CComponentEngine::MakePathFromTemplate($arParams["~GALLERY_URL"], array("USER_ALIAS" => $arResult["GALLERY"]["CODE"])); } elseif (intVal($arResult["SECTION"]["IBLOCK_SECTION_ID"]) > 0) { $url["BACK_LINK"] = CComponentEngine::MakePathFromTemplate($arParams["~SECTION_URL"], array("USER_ALIAS" => $arParams["USER_ALIAS"], "SECTION_ID" => $arResult["SECTION"]["IBLOCK_SECTION_ID"])); } else { $url["BACK_LINK"] = CComponentEngine::MakePathFromTemplate($arParams["~INDEX_URL"], array()); }