function fetchTemplates() { echo '{"result":' . json_encode(getLayers(TEMPLATE_ID())) . '}'; }
<?php require_once 'statistics.php'; require_once 'functions.php'; if (isset($_GET["function"])) { if ($_GET["function"] == "getLayers") { echo getLayers($_GET["mapFile"]); } else { if ($_GET["function"] == "getLayerAttributes") { echo getLayerAttributes($_GET["dataSource"], $_GET["layerName"], $_GET["onlyContinuesAttributes"]); } else { if ($_GET["function"] == "getClassesForLayer") { echo getClassesForLayer($_GET["mapFile"], $_GET["layerName"]); } else { if ($_GET["function"] == "getStylesForClass") { echo getStylesForClass($_GET["mapFile"], $_GET["layerName"], $_GET["classIndex"]); } else { if ($_GET["function"] == "getStylesForClasses") { echo getStylesForClasses($_GET["mapFile"], $_GET["layerName"]); } else { if ($_GET["function"] == "getSymbols") { echo getSymbols($_GET["mapFile"]); } } } } } } } if (isset($_POST["function"])) { if ($_POST["function"] == "applyNewClassification") {