Module: nagvis Branch: master Commit: 580428587fa2cc36885ad86a0f4073d406a06ad1 URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=580428587fa2cc36885ad86a0f4073d406a06ad1
Author: Lars Michelsen <[email protected]> Date: Tue Dec 14 19:33:53 2010 +0100 Bugfix: Fixed showmaps,showautomaps,... option usage on overview page --- share/frontend/nagvis-js/js/frontend.js | 14 +++++----- share/server/core/classes/GlobalIndexPage.php | 30 ++++++++++++------------ 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/share/frontend/nagvis-js/js/frontend.js b/share/frontend/nagvis-js/js/frontend.js index 314712c..2b791d3 100644 --- a/share/frontend/nagvis-js/js/frontend.js +++ b/share/frontend/nagvis-js/js/frontend.js @@ -1157,7 +1157,7 @@ function parseOverviewPage() { [ oPageProperties.showgeomap, 'overviewGeomap', 'Geomap' ], [ oPageProperties.showrotations, 'overviewRotations', oPageProperties.lang_rotationPools ] ]; for(var i = 0; i < types.length; i++) { - if(types[i][0]) { + if(types[i][0] === 1) { var oTable = document.createElement('table'); oTable.setAttribute('class', 'infobox'); oTable.setAttribute('className', 'infobox'); @@ -1209,7 +1209,7 @@ function parseOverviewMaps(aMapsConf) { } // Render the maps when enabled - if(oPageProperties.showmaps == 1) { + if(oPageProperties.showmaps === 1) { if(aMapsConf.length == 0) { document.getElementById('overviewMaps').parentNode.style.display = 'none'; return false; @@ -1278,7 +1278,7 @@ function parseOverviewAutomaps(aMapsConf) { } // Render the maps when enabled - if(oPageProperties.showautomaps == 1) { + if(oPageProperties.showautomaps === 1) { if(aMapsConf.length == 0) { document.getElementById('overviewAutomaps').parentNode.style.display = 'none'; return false; @@ -1341,7 +1341,7 @@ function parseOverviewGeomap() { eventlog("worker", "debug", "parseOverviewGeomap: Start setting geomap"); // Render the maps when enabled - if(oPageProperties.showgeomap == 1) { + if(oPageProperties.showgeomap === 1) { var oTable = document.getElementById('overviewGeomap'); var oTr = document.createElement('tr'); @@ -1352,7 +1352,7 @@ function parseOverviewGeomap() { oTd.style.width = '200px'; // Only show map thumb when configured - if(oPageProperties.showmapthumbs == 1) { + if(oPageProperties.showmapthumbs === 1) { oTd.style.height = '200px'; } @@ -1382,7 +1382,7 @@ function parseOverviewGeomap() { br = null; // Only show map thumb when configured - if(oPageProperties.showmapthumbs == 1) { + if(oPageProperties.showmapthumbs === 1) { oImg = document.createElement('img'); oImg.style.width = '200px'; oImg.style.height = '150px'; @@ -1423,7 +1423,7 @@ function parseOverviewGeomap() { function parseOverviewRotations(aRotationsConf) { eventlog("worker", "debug", "setOverviewObjects: Start setting rotations"); - if(oPageProperties.showrotations == 1 && aRotationsConf.length > 0) { + if(oPageProperties.showrotations === 1 && aRotationsConf.length > 0) { for(var i = 0, len = aRotationsConf.length; i < len; i++) { var oObj; diff --git a/share/server/core/classes/GlobalIndexPage.php b/share/server/core/classes/GlobalIndexPage.php index 22e7882..ced576b 100644 --- a/share/server/core/classes/GlobalIndexPage.php +++ b/share/server/core/classes/GlobalIndexPage.php @@ -265,25 +265,25 @@ class GlobalIndexPage { public function parseIndexPropertiesJson() { $arr = Array(); - $arr['cellsperrow'] = $this->CORE->getMainCfg()->getValue('index', 'cellsperrow'); - $arr['showautomaps'] = $this->CORE->getMainCfg()->getValue('index', 'showautomaps'); - $arr['showmaps'] = $this->CORE->getMainCfg()->getValue('index', 'showmaps'); - $arr['showgeomap'] = $this->CORE->getMainCfg()->getValue('index', 'showgeomap'); - $arr['showmapthumbs'] = $this->CORE->getMainCfg()->getValue('index', 'showmapthumbs'); - $arr['showrotations'] = $this->CORE->getMainCfg()->getValue('index', 'showrotations'); + $arr['cellsperrow'] = (int) $this->CORE->getMainCfg()->getValue('index', 'cellsperrow'); + $arr['showautomaps'] = (int) $this->CORE->getMainCfg()->getValue('index', 'showautomaps'); + $arr['showmaps'] = (int) $this->CORE->getMainCfg()->getValue('index', 'showmaps'); + $arr['showgeomap'] = (int) $this->CORE->getMainCfg()->getValue('index', 'showgeomap'); + $arr['showmapthumbs'] = (int) $this->CORE->getMainCfg()->getValue('index', 'showmapthumbs'); + $arr['showrotations'] = (int) $this->CORE->getMainCfg()->getValue('index', 'showrotations'); - $arr['page_title'] = $this->CORE->getMainCfg()->getValue('internal', 'title'); - $arr['favicon_image'] = $this->CORE->getMainCfg()->getValue('paths', 'htmlimages').'internal/favicon.png'; - $arr['background_color'] = $this->CORE->getMainCfg()->getValue('index','backgroundcolor'); + $arr['page_title'] = $this->CORE->getMainCfg()->getValue('internal', 'title'); + $arr['favicon_image'] = $this->CORE->getMainCfg()->getValue('paths', 'htmlimages').'internal/favicon.png'; + $arr['background_color'] = $this->CORE->getMainCfg()->getValue('index','backgroundcolor'); - $arr['lang_mapIndex'] = $this->CORE->getLang()->getText('mapIndex'); - $arr['lang_automapIndex'] = $this->CORE->getLang()->getText('Automap Index'); + $arr['lang_mapIndex'] = $this->CORE->getLang()->getText('mapIndex'); + $arr['lang_automapIndex'] = $this->CORE->getLang()->getText('Automap Index'); $arr['lang_rotationPools'] = $this->CORE->getLang()->getText('rotationPools'); - $arr['event_log'] = $this->CORE->getMainCfg()->getValue('defaults', 'eventlog'); - $arr['event_log_level'] = $this->CORE->getMainCfg()->getValue('defaults', 'eventloglevel'); - $arr['event_log_height'] = $this->CORE->getMainCfg()->getValue('defaults', 'eventlogheight'); - $arr['event_log_hidden'] = $this->CORE->getMainCfg()->getValue('defaults', 'eventloghidden'); + $arr['event_log'] = (int) $this->CORE->getMainCfg()->getValue('defaults', 'eventlog'); + $arr['event_log_level'] = $this->CORE->getMainCfg()->getValue('defaults', 'eventloglevel'); + $arr['event_log_height'] = (int) $this->CORE->getMainCfg()->getValue('defaults', 'eventlogheight'); + $arr['event_log_hidden'] = (int) $this->CORE->getMainCfg()->getValue('defaults', 'eventloghidden'); return json_encode($arr); } ------------------------------------------------------------------------------ Lotusphere 2011 Register now for Lotusphere 2011 and learn how to connect the dots, take your collaborative environment to the next level, and enter the era of Social Business. http://p.sf.net/sfu/lotusphere-d2d _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
