$arResult["ERROR"] = 'module "mobileapp" not installed'; } if ($USER->IsAuthorized() && check_bitrix_sessid() && !isset($arResult["ERROR"])) { $action = isset($_REQUEST['action']) ? trim($_REQUEST['action']) : ''; switch ($action) { case "get_fields_html": $arFields = isset($_REQUEST['fields']) ? $_REQUEST['fields'] : array(); $filterId = isset($_REQUEST['filter_id']) ? $_REQUEST['filter_id'] : ''; if (strlen($filterId) > 0 && !empty($arFields)) { $arFieldsToSave = array(); $arFields = $APPLICATION->ConvertCharsetArray($arFields, 'utf-8', SITE_CHARSET); foreach ($arFields as $fieldId => $arField) { $arFieldsToSave[$fieldId] = $arField["VALUE"]; } CAdminMobileFilter::setFields($filterId, $arFieldsToSave); $arResult["HTML"] = CAdminMobileFilter::getHtml($arFields); } else { $arResult["ERROR"] = "Insufficient data"; } break; } } else { $arResult["ERROR"] = "Access denied"; } if (isset($arResult["ERROR"])) { $arResult["RESULT"] = "ERROR"; } else { $arResult["RESULT"] = "OK"; } $arResult = $APPLICATION->ConvertCharsetArray($arResult, SITE_CHARSET, 'utf-8'); die(json_encode($arResult));
if ($arResult["SHOW_FIELDS_LIST"]) { require $_SERVER['DOCUMENT_ROOT'] . $templateFolder . '/dialogs/fields.php'; return; } $arData = array(); $arFilteredFields = array(); foreach ($arParams['FIELDS'] as $fieldID => $arField) { if (in_array($fieldID, $arResult["VISIBLE_FIELDS"])) { $arFilteredFields[$fieldID] = $arField; } } ?> <div id="mapp_filter_content"> <?php echo CAdminMobileFilter::getHtml($arFilteredFields, isset($arParams["GET_JS"]) ? true : false); ?> </div> <script type="text/javascript"> app.setPageTitle({title: "<?php echo GetMessage("MOBILE_APP_FILTER_TITLE"); ?> "}); BX.message({ MOBILE_APP_FILTER_SAVING: "<?php echo GetMessage("MOBILE_APP_FILTER_SAVING"); ?> "