Module: nagvis
Branch: nagvis-1.4
Commit: f61917a78b65065cd1f513d68a6e751d7e5bdce6
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=f61917a78b65065cd1f513d68a6e751d7e5bdce6

Author: LaMi <[email protected]>
Date:   Fri Feb 12 22:20:55 2010 +0100

#180 Fix from last release did not really help - now fixed the problem with the 
broken images on the overview page

---

 nagvis/nagvis/includes/classes/GlobalIndexPage.php |   29 +++++++++++--------
 nagvis/nagvis/includes/js/NagVisMap.js             |    4 +-
 2 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/nagvis/nagvis/includes/classes/GlobalIndexPage.php 
b/nagvis/nagvis/includes/classes/GlobalIndexPage.php
index 2a25971..9192885 100644
--- a/nagvis/nagvis/includes/classes/GlobalIndexPage.php
+++ b/nagvis/nagvis/includes/classes/GlobalIndexPage.php
@@ -167,20 +167,25 @@ class GlobalIndexPage {
                                        }
                                        
           $fileName = $MAPCFG->BACKGROUND->getFileName();
-                                       if($this->CORE->checkGd(0) && $fileName 
!= '' && $fileName != 'none') {
-                                               $sThumbFile = 
$mapName.'-thumb.'.$this->getFileType($imgPath);
-                                               $sThumbPath = 
$this->CORE->MAINCFG->getValue('paths','var').$sThumbFile;
-                                               $sThumbPathHtml = 
$this->CORE->MAINCFG->getValue('paths','htmlvar').$sThumbFile;
-                                               
-                                               // Only create a new thumb when 
there is no cached one
-                                               $FCACHE = new 
GlobalFileCache($this->CORE, $imgPath, $sThumbPath);
-                                               if($FCACHE->isCached() === -1) {
-                                                       $image = 
$this->createThumbnail($imgPath, $sThumbPath);
+                                       
+                                       if($fileName != '' && $fileName != 
'none') {    
+                                               if($this->CORE->checkGd(0)) {
+                                                       $sThumbFile = 
$mapName.'-thumb.'.$this->getFileType($imgPath);
+                                                       $sThumbPath = 
$this->CORE->MAINCFG->getValue('paths','var').$sThumbFile;
+                                                       $sThumbPathHtml = 
$this->CORE->MAINCFG->getValue('paths','htmlvar').$sThumbFile;
+                                                       
+                                                       // Only create a new 
thumb when there is no cached one
+                                                       $FCACHE = new 
GlobalFileCache($this->CORE, $imgPath, $sThumbPath);
+                                                       if($FCACHE->isCached() 
=== -1) {
+                                                               $image = 
$this->createThumbnail($imgPath, $sThumbPath);
+                                                       }
+                                                       
+                                                       $image = 
$sThumbPathHtml;
+                                               } else {
+                                                       $image = $imgPathHtml;
                                                }
-                                               
-                                               $image = $sThumbPathHtml;
                                        } else {
-                                               $image = $imgPathHtml;
+                                               $image = '';
                                        }
                                        
                                        $arr = $MAP->MAPOBJ->parseJson();
diff --git a/nagvis/nagvis/includes/js/NagVisMap.js 
b/nagvis/nagvis/includes/js/NagVisMap.js
index 3c42d4a..575620d 100644
--- a/nagvis/nagvis/includes/js/NagVisMap.js
+++ b/nagvis/nagvis/includes/js/NagVisMap.js
@@ -81,11 +81,11 @@ var NagVisMap = NagVisStatefulObject.extend({
                br = null;
                
                // Map thumb
-    if(this.conf.overview_image != '') {
+    if(this.conf.overview_image && this.conf.overview_image != '') {
                oImg = document.createElement('img');
                oImg.style.width = '200px';
                  oImg.style.height = '150px';
-               oImg.src=this.conf.overview_image;
+               oImg.src = this.conf.overview_image;
                oLink.appendChild(oImg);
                  oImg = null;
     }


------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to