Exemplo n.º 1
0
 /**
  * Merges the summary output from objects and all child objects together
  */
 protected function mergeSummaryOutput($arrStates, $objLabel, $finish = true, $continue = false)
 {
     if (NagVisStatefulObject::$langMemberStates === null) {
         NagVisStatefulObject::$langMemberStates = l('Contains');
     }
     if ($this->sum[OUTPUT] === null) {
         $this->sum[OUTPUT] = '';
     }
     if (!$continue) {
         $this->sum[OUTPUT] .= NagVisStatefulObject::$langMemberStates . ' ';
     }
     foreach ($arrStates as $state => $num) {
         if ($num > 0) {
             $this->sum[OUTPUT] .= $num . ' ' . state_str($state) . ', ';
         }
     }
     // If some has been added remove last comma, else add a simple 0
     if (substr($this->sum[OUTPUT], -2, 2) == ', ') {
         $this->sum[OUTPUT] = rtrim($this->sum[OUTPUT], ', ');
     } else {
         $this->sum[OUTPUT] .= '0 ';
     }
     $this->sum[OUTPUT] .= ' ' . $objLabel;
     if ($finish) {
         $this->sum[OUTPUT] .= '.';
     }
 }