Author:   Lars Michelsen <[email protected]>
Date:     Wed Jul 23 15:49:03 2014 +0200
Committer:   Lars Michelsen <[email protected]>
Commit-Date: Wed Jul 23 15:49:03 2014 +0200

Geomaps support multiple backends as object source now

---

 ChangeLog                            |    4 ++++
 share/server/core/sources/geomap.php |   24 ++++++++++++++++++------
 2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5f22dd6..64843a5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+1.8b6:
+Geomap:
+  * Geomaps support multiple backends as object source now
+
 1.8b5
 Frontend:
   * Multisite snapin: Parent maps in tree mode can now be clicked to open the 
map
diff --git a/share/server/core/sources/geomap.php 
b/share/server/core/sources/geomap.php
index e4f4e27..6c5a2ac 100644
--- a/share/server/core/sources/geomap.php
+++ b/share/server/core/sources/geomap.php
@@ -42,16 +42,28 @@ function geomap_read_csv($p) {
 
 function geomap_backend_locations($p) {
     global $_BACKEND;
-    $_BACKEND->checkBackendExists($p['backend_id'][0], true);
-    $_BACKEND->checkBackendFeature($p['backend_id'][0], 'getGeomapHosts', 
true);
-    return 
$_BACKEND->getBackend($p['backend_id'][0])->getGeomapHosts($p['filter_group']);
+    $hosts = array();
+    foreach ($p['backend_id'] AS $backend_id) {
+        $_BACKEND->checkBackendExists($backend_id, true);
+        $_BACKEND->checkBackendFeature($backend_id, 'getGeomapHosts', true);
+
+        $hosts = array_merge($hosts, 
$_BACKEND->getBackend($backend_id)->getGeomapHosts($p['filter_group']));
+    }
+    return $hosts;
 }
 
 function geomap_backend_program_start($p) {
     global $_BACKEND;
-    $_BACKEND->checkBackendExists($p['backend_id'][0], true);
-    $_BACKEND->checkBackendFeature($p['backend_id'][0], 'getProgramStart', 
true);
-    return $_BACKEND->getBackend($p['backend_id'][0])->getProgramStart();
+    $t = null;
+    foreach ($p['backend_id'] AS $backend_id) {
+        $_BACKEND->checkBackendExists($backend_id, true);
+        $_BACKEND->checkBackendFeature($backend_id, 'getProgramStart', true);
+
+        $this_t = $_BACKEND->getBackend($backend_id)->getProgramStart();
+        if ($t === null || $this_t > $t)
+            $t = $this_t;
+    }
+    return $t;
 }
 
 //


------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to