/** * Init options */ protected function initOptions() { $this->Label = __('Pace'); $this->Color = self::COLOR; $pace = new \Runalyze\Activity\Pace(0, 1, $this->paceUnit); $this->UnitString = !$this->paceInTime ? str_replace(' ', '', $pace->appendix()) : ''; $this->UnitDecimals = 1; $this->TickSize = false; $this->ShowAverage = false; $this->ShowMaximum = false; $this->ShowMinimum = false; }
/** * Get fieldset for paces * @return \FormularFieldset */ public function getFieldsetPaces() { $Table = '<table class="fullwidth zebra-style"> <thead> <tr> <th>' . __('Name') . '</th> <th class="small">' . __('Pace') . '</th> <th class="small">' . __('Description') . '</th> </tr> </thead> <tbody>'; $VDOT = new VDOT(Configuration::Data()->vdot()); $PaceObject = new Runalyze\Activity\Pace(0, 1, SportFactory::getSpeedUnitFor(Configuration::General()->runningSport())); foreach ($this->getArrayForPaces() as $Pace) { $Table .= '<tr> <td class="b">' . $Pace['short'] . '</td> <td class=""><em>' . $PaceObject->setTime($VDOT->paceAt($Pace['limit-high'] / 100))->value() . '</em> - <em>' . $PaceObject->setTime($VDOT->paceAt($Pace['limit-low'] / 100))->value() . '</em>' . $PaceObject->appendix() . '</td> <td class="">' . $Pace['description'] . '</td> </tr>'; } $Table .= ' </tbody> </table>'; $Fieldset = new FormularFieldset(__('Training paces')); $Fieldset->addBlock($Table); $Fieldset->addInfo(__('These paces are based on Jack Daniels\' recommendation.')); return $Fieldset; }