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

NagVisMap::parseObjects (  ) 

Parses the Objects

Returns:
Array Array with Html Code
Author:
Lars Michelsen <lars@vertical-visions.de>

Reimplemented in NagVisBackground.

Definition at line 98 of file NagVisMap.php.

Referenced by parseMap().

                              {
            if (DEBUG&&DEBUGLEVEL&1) debug('Start method NagVisMap::parseObjects()');
            $ret = Array();
            foreach($this->objects AS $obj) {
                  switch($obj['type']) {
                        case 'textbox':
                              // css class of the textbox
                              $obj['class'] = 'box';
                              
                              // default background color
                              if(!isset($obj['background_color']) || $obj['background_color'] == '') {
                                    $obj['background_color'] = '#CCCCCC';
                              }
                              
                              // replace macros in text
                              $obj = $this->replaceMacros($obj);
                              
                              $ret = array_merge($ret,$this->textBox($obj));
                        break;
                        case 'shape':
                              if(isset($obj['url']) && $obj['url'] != '') {
                                    $link = 1;
                              } else {
                                    $link = 0;
                              }
                              
                              if(isset($obj['hover_url']) && $obj['hover_url'] != '') {
                                    $hoverMenu = 1;
                              } else {
                                    $hoverMenu = 0;
                              }
                              
                              $obj = $this->fixIcon($obj);
                              $ret[] = $this->parseIcon($obj,$link,$hoverMenu);
                        break;
                        default:
                              // replace macros in url/hover_url/label_text
                              $obj = $this->replaceMacros($obj);
                              
                              // Some specials for lines
                              if(isset($obj['line_type'])) {
                                    $obj = $this->getLineHoverArea($obj);
                              }
                              
                              $obj = $this->fixIcon($obj);
                              $ret[] = $this->parseIcon($obj);
                              
                              if($obj['label_show'] == '1') {
                                    $ret[] = $this->parseLabel($obj);
                              }
                        break;      
                  }
            }
            
            if (DEBUG&&DEBUGLEVEL&1) debug('End method NagVisMap::parseObjects(): Array(...)');
            return $ret;
      }


Generated by  Doxygen 1.6.0   Back to index