Example #1
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if (!$context->activity()->weather()->condition()->isUnknown() && ($context->hasSport() || $context->sport()->isOutside())) {
         return $context->activity()->weather()->condition()->icon()->code();
     }
     return '';
 }
Example #2
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if (!$context->activity()->weather()->temperature()->isUnknown() && !($context->hasSport() && !$context->sport()->isOutside())) {
         return \Runalyze\Activity\Temperature::format($context->activity()->weather()->temperature()->value(), true, false);
     }
     return '';
 }
Example #3
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if ($context->activity()->get(Activity\Entity::ROUTEID) > 0) {
         return \Helper::Cut($context->factory()->route($context->activity()->get(Activity\Entity::ROUTEID))->name(), self::DEFAULT_CUT);
     }
     return '';
 }
Example #4
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if (!$context->activity()->weather()->pressure()->isUnknown() && !($context->hasSport() && !$context->sport()->isOutside())) {
         return $context->activity()->weather()->pressure()->string();
     }
     return '';
 }
Example #5
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if (!$context->activity()->weather()->temperature()->isUnknown() && !$context->activity()->weather()->windSpeed()->isUnknown() && !($context->hasSport() && !$context->sport()->isOutside())) {
         return $context->dataview()->windChillFactor()->string();
     }
     return '';
 }
Example #6
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if (!$context->activity()->splits()->isEmpty()) {
         if ($context->activity()->splits()->hasActiveAndInactiveLaps() || round($context->activity()->splits()->totalDistance()) != round($context->activity()->distance()) || $context->hasType() && $context->type()->id() == Configuration::General()->competitionType()) {
             $Icon = new Icon(Icon::CLOCK);
             $Icon->setTooltip($this->stringForActiveLaps($context->activity()->splits()));
             return $Icon->code();
         }
     }
     return '';
 }
Example #7
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if ($context->activity()->distance() > 0) {
         if ($context->hasData(self::DURATION_SUM_WITH_DISTANCE_KEY)) {
             if ($context->data(self::DURATION_SUM_WITH_DISTANCE_KEY) > 0) {
                 $Pace = new Activity\Pace($context->data(self::DURATION_SUM_WITH_DISTANCE_KEY), $context->activity()->distance(), $context->hasSport() ? $context->sport()->paceUnitEnum() : Activity\Pace::STANDARD);
                 return $Pace->valueWithAppendix();
             }
             return '';
         }
         return $context->dataview()->pace()->valueWithAppendix();
     }
     return '';
 }
Example #8
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if ($context->activity()->hrAvg() > 0) {
         return $context->dataview()->hrAvg()->string();
     }
     return '';
 }
Example #9
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if ($context->activity()->isPublic()) {
         return '<a href="' . $context->linker()->publicUrl() . '" target="_blank">' . Icon::$ATTACH . '</a>';
     }
     return '';
 }
Example #10
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if ($context->hasData(self::KEY_DISTANCE_COMPARISON)) {
         return $context->dataview()->distance() . $this->distanceComparison($context->activity()->distance(), $context->data(self::KEY_DISTANCE_COMPARISON));
     }
     return $context->dataview()->distance();
 }
Example #11
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     $weather = $context->activity()->weather();
     if ((!$weather->windSpeed()->isUnknown() || !$weather->windDegree()->isUnknown()) && !($context->hasSport() && !$context->sport()->isOutside())) {
         return (new WindIcon($weather->windSpeed(), $weather->windDegree()))->code();
     }
     return '';
 }
Example #12
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if ($context->isRunning() && $context->dataview()->usedVdot() > 0) {
         if (!$context->activity()->usesVDOT()) {
             return '<span class="unimportant">' . $context->dataview()->vdot()->value() . '</span>';
         }
         return $context->dataview()->vdot()->value();
     }
     return '';
 }
Example #13
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     return $context->activity()->totalStrokes();
 }
Example #14
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     return \Helper::Cut($context->activity()->partner()->asString(), 20);
 }
Example #15
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     return \Helper::Cut($context->activity()->comment(), 20);
 }
Example #16
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     return $context->activity()->swolf();
 }
Example #17
0
 /**
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 protected function privacyIconAndLabel(Context $context)
 {
     if ($context->activity()->isPublic()) {
         $privacyLabel = __('Make private');
         $privacyIcon = 'fa-lock';
     } else {
         $privacyLabel = __('Make public');
         $privacyIcon = 'fa-unlock';
     }
     return '<i class="fa fa-fw ' . $privacyIcon . '"></i> ' . $privacyLabel;
 }
Example #18
0
 /**
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function codeForPublicIcon(Context $context)
 {
     if ($context->activity()->isPublic()) {
         return \HTML::td(\Icon::$ADD_SMALL_GREEN, 'link');
     }
     return '<td></td>';
 }