Logo Search packages:      
Sourcecode: nagvis version File versions  Download package

GlobalPage::messageBox ( serverity,
id,
vars 
) [inherited]

Creates a Messagebox for informations and errors

Parameters:
String $serverity Serverity of the message (ERROR|WARNING|INFORMATION)
String $id Number of the error messages
String $vars Strings to replace
Returns:
Array HTML Code
Author:
Michael Luebben <michael_luebben@web.de>

Lars Michelsen <lars@vertical-visions.de>

Definition at line 201 of file GlobalPage.php.

Referenced by GlobalPage::getUserMessages(), and GlobalPage::messageToUser().

                                                  {
            if (DEBUG&&DEBUGLEVEL&1) debug('Start method GlobalPage::messageBox('.$serverity.','.$id.','.$vars.')');
            $ret = Array();
            
            $LANG = new GlobalLanguage($this->MAINCFG,$this->languageRoot);
            
            switch($serverity) {
                  case 'ERROR':
                        $messageIcon = 'img_error.png';
                  break;
                  case 'WARNING':
                        $messageIcon = 'img_warning.png';
                  break;
                  case 'INFORMATION':
                        $messageIcon = 'img_information.png';
                  break;
            }
            
            if($serverity == 'ERROR') {
                  $ret[] = '<META http-equiv="refresh" content="60;">';
                  $ret[] = '<style type="text/css">.main { background-color: yellow; }</style>';
                  $ret[] = '<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">';
                  $ret[] = '<tr><td align="center">';
            }
            $ret[] = '<table class="messageBox" cellpadding="2" cellspacing="2">';
            $ret[] = '<tr><th width="40"><img src="'.$this->MAINCFG->getValue('paths','htmlimages').'internal/'.$messageIcon.'" align="left" />';
            $ret[] = '</th><th>'.$id.': '.$LANG->getMessageTitle($id,$vars).'</th></tr>';
            $ret[] = '<tr><td colspan="2">'.$LANG->getMessageText($id,$vars).'</td></tr></table>';
            if($serverity == 'ERROR') {
                  $ret[] = '</td></tr></table>';
            }
            
            if (DEBUG&&DEBUGLEVEL&1) debug('End method GlobalPage::messageBox(): Array(...)');
            return $ret;
      }


Generated by  Doxygen 1.6.0   Back to index