$arAddLinks[] = trim($arAddLinksTmp[$j]); } } $aMenuItem[] = $arAddLinks; $arParams = array(); $param_cnt = IntVal(${"param_cnt_" . $num}); for ($j = 1; $j <= IntVal($param_cnt); $j++) { $param_name = trim(${"param_name_" . $num . "_" . $j}); $param_value = trim(${"param_value_" . $num . "_" . $j}); if (strlen($param_name) > 0 || strlen($param_value) > 0) { $arParams[$param_name] = $param_value; } } $aMenuItem[] = $arParams; if ($USER->CanDoOperation('edit_php') || $_REQUEST['selected_type'][$num] != 'php') { $aMenuItem[] = ConditionCompose(${"condition_{$num}"}, $num); } else { $aMenuItem[] = $res["aMenuLinks"][$num - 1][4]; } $aMenuLinksTmp_[] = $aMenuItem; } $aMenuSort[] = IntVal(${"sort_" . $num}); } if (!$bSimple) { $aMenuLinksTmp = $aMenuLinksTmp_; } for ($i = 0, $l = count($aMenuSort) - 1; $i < $l; $i++) { for ($j = $i + 1, $len = count($aMenuSort); $j < $len; $j++) { if ($aMenuSort[$i] > $aMenuSort[$j]) { $tmpSort = $aMenuLinksTmp[$i]; $aMenuLinksTmp[$i] = $aMenuLinksTmp[$j];
$SITE_TEMPLATE = array(); $max_sort = 0; while ($arSiteRes = $dbSiteRes->Fetch()) { $SITE_TEMPLATE[$arSiteRes["ID"]] = $arSiteRes; if ($max_sort < $arSiteRes["SORT"]) { $max_sort = $arSiteRes["SORT"]; } } for ($i = 0; $i < 3; $i++) { $SITE_TEMPLATE["N" . $i] = array("SORT" => $max_sort + 1 + $i); } } else { $SITE_TEMPLATE = array(); foreach ($_POST["SITE_TEMPLATE"] as $key => $val) { if ($USER->CanDoOperation('edit_php') || $_POST['selected_type'][$key] != 'php') { $cond = ConditionCompose($val, $key); } else { if (isset($arTemplates[$key])) { $cond = $arTemplates[$key]; } else { continue; } } $SITE_TEMPLATE[$key] = array("TEMPLATE" => $val['TEMPLATE'], "SORT" => $val['SORT'], "CONDITION" => $cond); } } $signer = new Bitrix\Main\Security\Sign\Signer(); //templates $arSiteTemplates = array(); $templateSigns = array(); $db_res = CSiteTemplate::GetList(array("sort" => "asc", "name" => "asc"), array("TYPE" => ""), array("ID", "NAME"));