Module: nagvis
Branch: master
Commit: 9f7361a47ab376d7a0a75b9e5beff25a02133669
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=9f7361a47ab376d7a0a75b9e5beff25a02133669

Author: Lars Michelsen <[email protected]>
Date:   Sat Sep 26 00:59:36 2009 +0200

Rewrote parsing of view specific param handling

---

 .../frontend/nagvis-js/classes/CoreUriHandler.php  |    9 ---------
 .../frontend/nagvis-js/classes/FrontendModMap.php  |   15 ++++++++++++++-
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/share/frontend/nagvis-js/classes/CoreUriHandler.php 
b/share/frontend/nagvis-js/classes/CoreUriHandler.php
index 5f29766..39e8d6b 100644
--- a/share/frontend/nagvis-js/classes/CoreUriHandler.php
+++ b/share/frontend/nagvis-js/classes/CoreUriHandler.php
@@ -77,11 +77,6 @@ class CoreUriHandler {
                if(isset($_GET['show'])) {
                        $this->aOpts['show'] = $_GET['show'];
                }
-
-               // Optional: Map view search parameter
-               if(isset($_GET['search'])) {
-                       $this->aOpts['search'] = $_GET['search'];
-               }
        }
        
        private function setDefaults() {
@@ -98,10 +93,6 @@ class CoreUriHandler {
                if(!$this->isSetAndNotEmpty('show')) {
                        $this->aOpts['show'] = '';
                }
-
-               if(!$this->isSetAndNotEmpty('search')) {
-                       $this->aOpts['search'] = '';
-               }
        }
        
        private function validate() {
diff --git a/share/frontend/nagvis-js/classes/FrontendModMap.php 
b/share/frontend/nagvis-js/classes/FrontendModMap.php
index 4f13b75..f7d6073 100644
--- a/share/frontend/nagvis-js/classes/FrontendModMap.php
+++ b/share/frontend/nagvis-js/classes/FrontendModMap.php
@@ -9,7 +9,9 @@ class FrontendModMap extends FrontendModule {
 
                $UHANDLER = new CoreUriHandler($this->CORE); 
                $this->name = $UHANDLER->get('show');
-               $this->search = $UHANDLER->get('search');
+
+               // And parse the view specific options
+               $this->getMapOptions($UHANDLER);
                
                $this->aActions = Array(
                        'view' => REQUIRES_AUTHORISATION
@@ -30,6 +32,17 @@ class FrontendModMap extends FrontendModule {
                
                return $sReturn;
        }
+
+       private function getMapOptions(CoreUriHandler $UHANDLER) {
+               // Parse view specific uri params
+               $aKeys = Array('search' => '');
+               
+               // Load the specific params to the UriHandler
+               $UHANDLER->parseModSpecificUri($aKeys);
+               
+               // Now get those params
+               $this->search = $UHANDLER->get('search');
+       }
        
        private function showViewDialog() {
                // Only show when map name given


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to