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

GlobalPage::messageToUser ( serverity = 'WARNING',
id,
vars = '' 
) [inherited]

Writes a Message to message array and does what to do... serverity: ERROR, WARNING, INFORMATION

Parameters:
String $serverity Serverity of the message (ERROR|WARNING|INFORMATION)
Integer $id Message Key in the language file
String $vars String to replace
Author:
Lars Michelsen <lars@vertical-visions.de>

Definition at line 147 of file GlobalPage.php.

References GlobalPage::messageBox(), and GlobalPage::printPage().

Referenced by GlobalPage::checkPermissions(), and GlobalPage::checkUser().

                                                                  {
            if (DEBUG&&DEBUGLEVEL&1) debug('Start method GlobalPage::messageToUser('.$serverity.','.$id.','.$vars.')');
            switch($serverity) {
                  case 'ERROR':
                        // print the message box and kill the script
                        $this->body = array_merge($this->body,$this->messageBox($serverity,$id,$vars));
                        if (DEBUG&&DEBUGLEVEL&1) debug('End method GlobalPage::messageToUser()');
                        $this->printPage();
                        // end of script
                  break;
                  case 'WARNING':
                  case 'INFORMATION':
                        // add the message to message Array - the printing will be done later, the message array has to be superglobal, not a class variable
                        $arrMessage = Array(Array('serverity' => $serverity, 'nr' => $id, 'vars' => $vars));
                        if(is_array($this->MAINCFG->getRuntimeValue('userMessages'))) {
                              $this->MAINCFG->setRuntimeValue('userMessages',array_merge($this->MAINCFG->getRuntimeValue('userMessages'),$arrMessage));
                        } else {
                              $this->MAINCFG->setRuntimeValue('userMessages',$arrMessage);
                        }
                  break;
            }
            if (DEBUG&&DEBUGLEVEL&1) debug('End method GlobalPage::messageToUser()');
      }


Generated by  Doxygen 1.6.0   Back to index