Esempio n. 1
0
 if ($arParams["SET_NAV_CHAIN"] != "N") {
     if ($arParams["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_GROUP) {
         $APPLICATION->AddChainItem($arResult["Group"]["NAME"], $arResult["Urls"]["Group"]);
         $APPLICATION->AddChainItem(GetMessage("SONET_C3_GROUP_SETTINGS"));
     } elseif ($arParams["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_USER) {
         $APPLICATION->AddChainItem($strTitleFormatted, $arResult["Urls"]["User"]);
         $APPLICATION->AddChainItem(GetMessage("SONET_C3_USER_SETTINGS"));
     }
 }
 if (!$arResult["Subscribe"] || count($arResult["Subscribe"]) <= 0) {
     $arResult["FatalError"] = GetMessage("SONET_C3_NO_SUBSCRIPTIONS") . ".";
 }
 $arResult["ShowForm"] = "Input";
 if ($_SERVER["REQUEST_METHOD"] == "POST" && strlen($_POST["save"]) > 0 && check_bitrix_sessid()) {
     $errorMessage = "";
     CSocNetLogEvents::DeleteByUserAndEntity($GLOBALS["USER"]->GetID(), $arParams["ENTITY_TYPE"], $arParams["ENTITY_ID"]);
     foreach ($arResult["Subscribe"] as $event_id_tmp => $arEventTmp) {
         if (!array_key_exists($event_id_tmp . "_transport", $_REQUEST) && !array_key_exists("cb_" . $event_id_tmp . "_transport", $_REQUEST) && !array_key_exists($event_id_tmp . "_visible", $_REQUEST) && !array_key_exists("cb_" . $event_id_tmp . "_visible", $_REQUEST) && (!array_key_exists($event_id_tmp . "_active", $_REQUEST) || $_REQUEST[$event_id_tmp . "_active"] != "S" && $_REQUEST[$event_id_tmp . "_active"] != "M")) {
             continue;
         }
         if (array_key_exists($event_id_tmp . "_transport", $_REQUEST)) {
             $subscribe_transport = $_REQUEST[$event_id_tmp . "_transport"];
         } else {
             switch ($_REQUEST[$event_id_tmp . "_active"]) {
                 case "M":
                     $subscribe_transport = "M";
                     break;
                 case "N":
                     $subscribe_transport = "N";
                     break;
                 default: