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

Author: Lars Michelsen <[email protected]>
Date:   Sun Aug  8 23:32:17 2010 +0200

Removed unused language strings from WUI; Fixed non translated title of WUI 
add/modify properties dialog

---

 share/frontend/wui/classes/WuiCore.php            |   38 +--------------------
 share/frontend/wui/classes/WuiViewMap.php         |    1 -
 share/frontend/wui/classes/WuiViewWelcome.php     |    1 -
 share/frontend/wui/js/wui.js                      |    6 ++-
 share/userfiles/templates/default.wuiMap.html     |    1 -
 share/userfiles/templates/default.wuiWelcome.html |    1 -
 6 files changed, 5 insertions(+), 43 deletions(-)

diff --git a/share/frontend/wui/classes/WuiCore.php 
b/share/frontend/wui/classes/WuiCore.php
index 8421751..a07f150 100644
--- a/share/frontend/wui/classes/WuiCore.php
+++ b/share/frontend/wui/classes/WuiCore.php
@@ -116,43 +116,6 @@ class WuiCore extends GlobalCore {
                
                return json_encode($aArr);
        }
-       
-       /**
-        * Parses the needed language strings in json format
-        * for the menu
-        *
-        * @return  String    JSON encoded array
-        * @author  Lars Michelsen <[email protected]>
-        */
-       public function getJsLangMenu() {
-               $langMenu = Array(
-                       'overview' => $this->getLang()->getText('overview'),
-                       'restore' => $this->getLang()->getText('restore'),
-                       'properties' => $this->getLang()->getText('properties'),
-                       'addObject' => $this->getLang()->getText('addObject'),
-                       'nagVisConfig' => 
$this->getLang()->getText('nagVisConfig'),
-                       'help' => $this->getLang()->getText('help'),
-                       'open' => $this->getLang()->getText('open'),
-                       'openInNagVis' => 
$this->getLang()->getText('openInNagVis'),
-                       'manageMaps' => $this->getLang()->getText('manageMaps'),
-                       'manageBackends' => 
$this->getLang()->getText('manageBackends'),
-                       'manageBackgrounds' => 
$this->getLang()->getText('manageBackgrounds'),
-                       'manageShapes' => 
$this->getLang()->getText('manageShapes'),
-                       'icon' => $this->getLang()->getText('icon'),
-                       'line' => $this->getLang()->getText('line'),
-                       'special' => $this->getLang()->getText('special'),
-                       'host' => $this->getLang()->getText('host'),
-                       'service' => $this->getLang()->getText('service'),
-                       'hostgroup' => $this->getLang()->getText('hostgroup'),
-                       'servicegroup' => 
$this->getLang()->getText('servicegroup'),
-                       'map' => $this->getLang()->getText('map'),
-                       'textbox' => $this->getLang()->getText('textbox'),
-                       'shape' => $this->getLang()->getText('shape'),
-                       'manage' => $this->getLang()->getText('manage'),
-                       'stateless' => $this->getLang()->getText('Stateless'));
-               
-               return json_encode($langMenu);
-       }
 
        /**
         * Parses the needed language strings to javascript
@@ -206,6 +169,7 @@ class WuiCore extends GlobalCore {
                        'noPermissions' => 
$this->getLang()->getText('noPermissions'),
                        'minOneUserWriteAccess' => 
$this->getLang()->getText('minOneUserWriteAccess'),
                        'noSpaceAllowed' => 
$this->getLang()->getText('noSpaceAllowed'),
+                       'properties' => $this->getLang()->getText('properties'),
                        'manualInput' => 
$this->getLang()->getText('manualInput'));
                
                return json_encode($lang);
diff --git a/share/frontend/wui/classes/WuiViewMap.php 
b/share/frontend/wui/classes/WuiViewMap.php
index 2b1e0fe..614efd6 100644
--- a/share/frontend/wui/classes/WuiViewMap.php
+++ b/share/frontend/wui/classes/WuiViewMap.php
@@ -65,7 +65,6 @@ class WuiViewMap {
                                'userName' => 
$this->CORE->getAuthentication()->getUser(),
                                'mapObjects' => $this->MAP->parseObjects(),
                                'movable' => $this->MAP->getMoveableObjects(),
-                               'langMenu' => $this->CORE->getJsLangMenu(),
                                'lang' => $this->CORE->getJsLang(),
                                'validMainCfg' => 
$this->CORE->getJsValidMainConfig(),
                                'validMapCfg' => 
$this->MAP->getJsValidMapConfig(),
diff --git a/share/frontend/wui/classes/WuiViewWelcome.php 
b/share/frontend/wui/classes/WuiViewWelcome.php
index 89f1ae2..0794f7b 100644
--- a/share/frontend/wui/classes/WuiViewWelcome.php
+++ b/share/frontend/wui/classes/WuiViewWelcome.php
@@ -54,7 +54,6 @@ class WuiViewWelcome {
                                'base' => 
$this->CORE->getMainCfg()->getValue('paths', 'htmlbase'),
                                'generalProperties' => 
$this->CORE->getMainCfg()->parseGeneralProperties(),
                                'userName' => 
$this->CORE->getAuthentication()->getUser(),
-                               'langMenu' => $this->CORE->getJsLangMenu(),
                                'lang' => $this->CORE->getJsLang(),
                                'validMainCfg' => 
$this->CORE->getJsValidMainConfig(),
                                'mapOptions' => $this->CORE->getMapOptions()
diff --git a/share/frontend/wui/js/wui.js b/share/frontend/wui/js/wui.js
index a262cfa..76ee266 100644
--- a/share/frontend/wui/js/wui.js
+++ b/share/frontend/wui/js/wui.js
@@ -167,6 +167,9 @@ function get_click(newtype,nbclicks,action) {
 }
 
 function printLang(sLang,sReplace) {
+       if(typeof sLang === 'undefined')
+               return '';
+       
        sLang = sLang.replace(/<(\/|)(i|b)>/ig,'');
        
        // sReplace maybe optional
@@ -298,8 +301,7 @@ function get_click_pos(e) {
                        sUrl = 
oGeneralProperties.path_server+'?mod=Map&act=addModify&do=modify&show='+mapname+'&type='+objtype+'&id='+objid+'&coords='+coords;
                }
                
-               // FIXME: Title "+get_label('properties')+"
-               showFrontendDialog(sUrl, 'LABEL');
+               showFrontendDialog(sUrl, printLang(lang['properties'], ''));
                
                objid = -1;
                cpt_clicks = -1;
diff --git a/share/userfiles/templates/default.wuiMap.html 
b/share/userfiles/templates/default.wuiMap.html
index e5f12ee..947139f 100644
--- a/share/userfiles/templates/default.wuiMap.html
+++ b/share/userfiles/templates/default.wuiMap.html
@@ -5,7 +5,6 @@ oViewProperties = {$viewProperties};
 var mapname = '{$mapName}';
 var username = '{$userName}';
 
-var langMenu = {$langMenu};
 var lang = {$lang};
 var validMainConfig = {$validMainCfg};
 var validMapConfig = {$validMapCfg};
diff --git a/share/userfiles/templates/default.wuiWelcome.html 
b/share/userfiles/templates/default.wuiWelcome.html
index a9b2d99..61a1c7a 100644
--- a/share/userfiles/templates/default.wuiWelcome.html
+++ b/share/userfiles/templates/default.wuiWelcome.html
@@ -4,7 +4,6 @@ oGeneralProperties = {$generalProperties};
 var mapname = '';
 var username = '{$userName}';
 
-var langMenu = {$langMenu};
 var lang = {$lang};
 var validMainConfig = {$validMainCfg};
 


------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to