<tr> <td><?php echo RunalyzePluginPanel_Sportler::getDeleteLinkFor($Info['id']); ?> </td> <td><?php echo RunalyzePluginPanel_Sportler::getEditLinkFor($Info['id']); ?> </td> <?php foreach ($Fields as $Key => $Unit) { ?> <?php if ($Key == 'weight') { $Weight = new Weight($Info[$Key]); $Info[$Key] = $Weight->string(false) . ' <small>' . $Weight->unit() . '</small>'; } ?> <?php $Value = $Unit == 'date' ? date('d.m.Y', $Info[$Key]) : $Info[$Key]; ?> <?php if ($Unit == 'date') { $Unit = ''; } ?> <?php if ($Key == 'sleep_duration' && $Value > 0) { $Value = (new Duration($Value * 60))->string('G:i'); } ?>
/** * Display the content (old design) */ protected function displayContentInOldDesign() { $Weight = ''; $Analyse = ''; $UserData = new UserData(DataObject::$LAST_OBJECT); if ($this->Configuration()->value('use_weight')) { $UserWeight = new Weight($UserData->getWeight()); $Weight = __('Weight') . ': <strong>' . Helper::Unknown($UserWeight->string(false), '-') . ' ' . $UserWeight->unit() . '</strong><br>'; } if ($this->Configuration()->value('use_pulse')) { $Pulse = Helper::Unknown($UserData->getPulseRest(), '-') . ' bpm / ' . Helper::Unknown($UserData->getPulseMax()) . ' bpm'; } else { $Pulse = Helper::Unknown($UserData->getPulseMax(), '-') . ' bpm'; } if ($this->Configuration()->value('use_body_fat')) { $Analyse = __('Fat') . ': ' . Helper::Unknown($UserData->getBodyFat(), '-') . ' %, ' . __('Water') . ': ' . Helper::Unknown($UserData->getWater(), '-') . ' %, ' . __('Muscles') . ': ' . Helper::Unknown($UserData->getMuscles(), '-') . ' %'; } $AnalyseIsHidden = $this->Configuration()->value('use_weight') || $this->Configuration()->value('use_pulse'); if (!$AnalyseIsHidden && !$this->Configuration()->value('use_body_fat')) { return; } echo ' <div id="sportler-content"> <span class="right">' . $Pulse . '</span> ' . Ajax::flotChange($Weight, 'sportler_flots', 'sportler_weights') . ' ' . Ajax::flotChange($Analyse, 'sportler_flots', 'sportler_analyse', !$AnalyseIsHidden) . ' <div id="sportler_flots" class="flot-changeable" style="position:relative;width:320px;height:150px;margin:0 auto;"> <div class="flot ' . Ajax::$IMG_WAIT . '" id="sportler_weights" style="width:320px;height:150px;position:absolute;"></div> <div class="flot ' . Ajax::$IMG_WAIT . ($AnalyseIsHidden ? ' flot-hide' : '') . '" id="sportler_analyse" style="width:320px;height:150px;position:absolute;"></div> </div> </div>'; include FRONTEND_PATH . '../plugin/' . $this->key() . '/Plot.gewicht.php'; include FRONTEND_PATH . '../plugin/' . $this->key() . '/Plot.analyse.php'; }