From dab52b1b99a51c204c0c78408f4bc3ca98b9d6fc Mon Sep 17 00:00:00 2001 From: Juan Francisco Onielfa Veneros Date: Wed, 25 Nov 2020 14:22:57 +0100 Subject: [PATCH] Added diffusion method 'build_geolocation_data_geojson' (converts text area value to geojson data) --- lib/dedalo/config/version.inc | 5 ++++- lib/dedalo/diffusion/class.diffusion_sql.php | 22 ++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/lib/dedalo/config/version.inc b/lib/dedalo/config/version.inc index 99ccf14f01..b2e29dda20 100644 --- a/lib/dedalo/config/version.inc +++ b/lib/dedalo/config/version.inc @@ -1950,6 +1950,9 @@ Fix issue wit double quotes on set config_auto.php file contents + Valencia 25-11-2020 5.7.14 + Added diffusion method 'build_geolocation_data_geojson' (converts text area value to geojson data) + WORK IN PROGRESS component_date : mark as "red or similar" restricted an other terms based in x param.. @@ -1970,7 +1973,7 @@ # Version - $DEDALO_VERSION = '5.7.13'; + $DEDALO_VERSION = '5.7.14'; if(defined('DEVELOPMENT_SERVER') && DEVELOPMENT_SERVER===true) { $DEDALO_VERSION .= '.'.time(); } diff --git a/lib/dedalo/diffusion/class.diffusion_sql.php b/lib/dedalo/diffusion/class.diffusion_sql.php index 9c47674ecb..6ce974e9f4 100644 --- a/lib/dedalo/diffusion/class.diffusion_sql.php +++ b/lib/dedalo/diffusion/class.diffusion_sql.php @@ -3384,6 +3384,28 @@ public static function build_geolocation_data($options, $dato) { + /** + * BUILD_GEOLOCATION_DATA_GEOJSON + * @return string + */ + public static function build_geolocation_data_geojson($options, $dato) { + + $request_options = new stdClass(); + $request_options->raw_text = $dato; + + $options = new stdClass(); + $options->raw_text = false; + foreach ($request_options as $key => $value) {if (property_exists($options, $key)) $options->$key = $value;} + + + $ar_elements = component_text_area::build_geolocation_data_geojson($options->raw_text); + $response = json_encode($ar_elements, JSON_UNESCAPED_UNICODE); + + return (string)$response; // json_encoded object + }//end build_geolocation_data_geojson + + + /** * RETURN_EMPTY_STRING * Fake method to return true always