Ignore:
Timestamp:
Apr 6, 2020, 11:17:40 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Improved code format.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/NetworkTopology/NetworkTopology.php

    r738 r873  
    1010  function Show()
    1111  {
    12     if(count($this->System->PathItems) > 1)
     12    if (count($this->System->PathItems) > 1)
    1313    {
    14       if($this->System->PathItems[1] == 'topologie.png') return($this->ShowImage());
    15         else return(PAGE_NOT_FOUND);
     14      if ($this->System->PathItems[1] == 'topologie.png') return ($this->ShowImage());
     15        else return (PAGE_NOT_FOUND);
    1616
    17     } else return($this->ShowOverview());
     17    } else return ($this->ShowOverview());
    1818  }
    1919
     
    2323    $this->FormatHTML = false;
    2424
    25     if(array_key_exists('debug', $_GET)) $debug = $_GET['debug'];
     25    if (array_key_exists('debug', $_GET)) $debug = $_GET['debug'];
    2626      else $debug = 0;
    2727
     
    5454      'FROM NetworkTopology LEFT JOIN NetworkDevice ON NetworkDevice.Id = NetworkTopology.Host '.
    5555      'LEFT JOIN NetworkDeviceType ON NetworkDevice.Type = NetworkDeviceType.Id');
    56     while($item = $DbResult->fetch_array())
     56    while ($item = $DbResult->fetch_array())
    5757    {
    5858      $id = $item['Id'];
     
    6262      $vlast = $item['Last'];
    6363      $xpos = $vleft * $spacex;
    64       if(($vtop > 0) or ($item['Name'] == $this->TopHostName))
     64      if (($vtop > 0) or ($item['Name'] == $this->TopHostName))
    6565      {
    66         if($vtop > 0) imageline($im, $xpos + $halfx, $vtop * $spacey, $xpos + $halfx, $vtop * $spacey + 8, $black);
    67         if($vfirst >= 0)
     66        if ($vtop > 0) imageline($im, $xpos + $halfx, $vtop * $spacey, $xpos + $halfx, $vtop * $spacey + 8, $black);
     67        if ($vfirst >= 0)
    6868        {
    6969          imageline($im, $vfirst*$spacex + $halfx, $vtop * $spacey + $spacey, $vlast*$spacex + $halfx, $vtop * $spacey + $spacey, $black);
     
    7171        }
    7272        //    $ip = explode('.',$item['IP']);
    73         //    if(!array_key_exists(3, $ip)) $ip[3] = '';
    74         if($item['IconName'] == 'comp')
     73        //    if (!array_key_exists(3, $ip)) $ip[3] = '';
     74        if ($item['IconName'] == 'comp')
    7575        {
    76           if($item['Online'] == 1) $color = $green;
     76          if ($item['Online'] == 1) $color = $green;
    7777          else $color = $black;
    7878          $image = $im_comp;
    7979        } else $image = $im_dev;
    80         if($item['IconName'] == 'device')
     80        if ($item['IconName'] == 'device')
    8181        {
    82           if($item['Online'] == 1) $color = $green;
     82          if ($item['Online'] == 1) $color = $green;
    8383          else $color = $red;
    8484          $image = $im_dev;
    8585        }
    86         if($item['ShowOnline'] == 0)
     86        if ($item['ShowOnline'] == 0)
    8787        {
    8888          $color = $gray;
     
    100100
    101101    // === Sestavení výsledného souboru ============================================
    102     if($debug == 0)
     102    if ($debug == 0)
    103103    {
    104104      Header("Content-type: image/png");
     
    109109      imagedestroy($im_dev);
    110110    }
    111     return('');
     111    return ('');
    112112  }
    113113
     
    126126zařízení, které jsou přes něj připojeny. U zařízení, kde není stav možné
    127127zjišťovat je použita <span style="color:gray">šedá barvou</span>.</p>';
    128     return($Output);
     128    return ($Output);
    129129  }
    130130}
Note: See TracChangeset for help on using the changeset viewer.