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

NagVisMap::createLink ( &$  obj  ) 

Creates a link to Nagios, when this is not set in the Config-File

Parameters:
Array $obj Array with object informations
Returns:
String The Link
Author:
Michael Luebben <michael_luebben@web.de>

Lars Michelsen <lars@vertical-visions.de>

Definition at line 305 of file NagVisMap.php.

                                 {
            if (DEBUG&&DEBUGLEVEL&1) debug('Start method NagVisMap::createLink(&$obj)');
            if($obj['type'] == 'service') {
                  $name = 'host_name';
            } else {
                  $name = $obj['type'] . '_name';
            }
            
            if(isset($obj['url']) && $obj['url'] != '') {
                  $link = '<a href="'.$obj['url'].'" target="'.$obj['url_target'].'">';
                  } else {
                        switch($obj['type']) {
                              case 'map':
                                    $link = '<a href="'.$this->MAINCFG->getValue('paths', 'htmlbase').'/index.php?map='.$obj[$name].'" target="'.$obj['url_target'].'">';
                              break;
                              case 'host':
                                    $link = '<a href="'.$this->MAINCFG->getValue('backend_'.$obj['backend_id'], 'htmlcgi').'/status.cgi?host='.$obj[$name].'" target="'.$obj['url_target'].'">';
                              break;
                              case 'service':
                                    $link = '<a href="'.$this->MAINCFG->getValue('backend_'.$obj['backend_id'], 'htmlcgi').'/extinfo.cgi?type=2&amp;host='.$obj[$name].'&amp;service='.$obj['service_description'].'" target="'.$obj['url_target'].'">';
                              break;
                              case 'hostgroup':
                                    $link = '<a href="'.$this->MAINCFG->getValue('backend_'.$obj['backend_id'], 'htmlcgi').'/status.cgi?hostgroup='.$obj[$name].'&amp;style=detail" target="'.$obj['url_target'].'">';
                              break;
                              case 'servicegroup':
                                    $link = '<a href="'.$this->MAINCFG->getValue('backend_'.$obj['backend_id'], 'htmlcgi').'/status.cgi?servicegroup='.$obj[$name].'&amp;style=detail" target="'.$obj['url_target'].'">';
                              break;
                        }
            }
            if (DEBUG&&DEBUGLEVEL&1) debug('End method NagVisMap::createLink(): '.$link);
            return $link;
      }


Generated by  Doxygen 1.6.0   Back to index