Module: nagvis Branch: nagvis-1.4 Commit: cc281dcffb1df4f6d1c5e7a95151b5c40a5bc028 URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=cc281dcffb1df4f6d1c5e7a95151b5c40a5bc028
Author: LaMi <[email protected]> Date: Sun Mar 7 14:07:21 2010 +0100 fix-get_class-object.dpatch by Hendrik Frenzel <[email protected]>; DP: add is_object() to check for object before use get_class() --- .../nagvis/includes/classes/GlobalHeaderMenu.php | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nagvis/nagvis/includes/classes/GlobalHeaderMenu.php b/nagvis/nagvis/includes/classes/GlobalHeaderMenu.php index f2cfd37..16a9141 100644 --- a/nagvis/nagvis/includes/classes/GlobalHeaderMenu.php +++ b/nagvis/nagvis/includes/classes/GlobalHeaderMenu.php @@ -84,7 +84,7 @@ class GlobalHeaderMenu { */ public function replaceDynamicMacros() { // Replace some special macros - if($this->OBJPAGE !== null && get_class($this->OBJPAGE) == 'NagVisMapCfg') { + if($this->OBJPAGE !== null && (is_object($this->OBJPAGE) && get_class($this->OBJPAGE) == 'NagVisMapCfg')) { $arrKeys[] = '[current_map]'; $arrKeys[] = '[current_map_alias]'; $arrVals[] = $this->OBJPAGE->getName(); @@ -122,7 +122,7 @@ class GlobalHeaderMenu { } // auto select current map - if(get_class($this->OBJPAGE) == 'NagVisMapCfg' && ($mapName == $this->OBJPAGE->getName() || $mapName == '__automap' && isset($_GET['automap']))) { + if((is_object($this->OBJPAGE) && get_class($this->OBJPAGE) == 'NagVisMapCfg') && ($mapName == $this->OBJPAGE->getName() || $mapName == '__automap' && isset($_GET['automap']))) { $sReplaceObj = str_replace('[selected]','selected="selected"',$sReplaceObj); } else { $sReplaceObj = str_replace('[selected]','',$sReplaceObj); @@ -138,7 +138,7 @@ class GlobalHeaderMenu { } // Select overview in header menu when no map shown - if(get_class($this->OBJPAGE) != 'NagVisMapCfg') { + if((is_object($this->OBJPAGE) && get_class($this->OBJPAGE) != 'NagVisMapCfg')) { $this->code = str_replace('[selected]','selected="selected"', $this->code); } ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
