Example #1
0
 /**
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function codeForColumns(Context $context, array $hiddenKeys = array())
 {
     $Code = '';
     if ($this->AutomaticDistanceComparison) {
         $context->setData(Keys\Distance::KEY_DISTANCE_COMPARISON, $this->LastDistance);
         $this->LastDistance = $context->activity()->distance();
     }
     foreach ($this->ActiveKeys as $keyid) {
         if (in_array($keyid, $hiddenKeys)) {
             $Code .= '<td></td>';
         } else {
             $Key = Keys::get($keyid);
             $class = $Key->cssClass() != '' ? ' class="' . $Key->cssClass() . '"' : '';
             $style = $this->Configuration->getStyle($keyid) != '' ? ' style="' . $this->Configuration->getStyle($keyid) . '"' : '';
             $Code .= '<td' . $class . $style . '>' . $Key->stringFor($context) . '</td>';
         }
     }
     return $Code;
 }