Ejemplo n.º 1
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if ($context->hasData(self::ROUTE_NAME_KEY) && $context->data(self::ROUTE_NAME_KEY) != '') {
         return \Helper::Cut($context->data(self::ROUTE_NAME_KEY), self::DEFAULT_CUT);
     }
     return '';
 }
Ejemplo n.º 2
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     $string = '';
     if ($context->hasData(self::CONCAT_TAGIDS_KEY) && $context->data(self::CONCAT_TAGIDS_KEY) != '') {
         $ids = explode(',', $context->data(self::CONCAT_TAGIDS_KEY));
         $Factory = new \Runalyze\Model\Factory(\SessionAccountHandler::getId());
         foreach ($ids as $id) {
             $string .= '#' . $Factory->tag($id)->tag() . ' ';
         }
     }
     return $string;
 }
Ejemplo n.º 3
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 '';
 }
Ejemplo n.º 4
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if ($context->hasData(parent::CONCAT_EQUIPMENT_KEY) && $context->data(parent::CONCAT_EQUIPMENT_KEY) != '') {
         $ids = explode(',', $context->data(parent::CONCAT_EQUIPMENT_KEY));
         $Factory = new \Runalyze\Model\Factory(\SessionAccountHandler::getId());
         $names = array();
         foreach (array_unique($ids) as $id) {
             $names[] = $Factory->equipment($id)->name();
         }
         $Icon = new \Runalyze\View\Icon('fa-cubes');
         $Icon->setTooltip(implode(', ', $names));
         return $Icon->code();
     }
     return '';
 }
Ejemplo n.º 5
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();
 }
Ejemplo n.º 6
0
 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     if ($context->hasData(parent::CONCAT_EQUIPMENT_KEY) && $context->data(parent::CONCAT_EQUIPMENT_KEY) != '') {
         $ids = explode(',', $context->data(parent::CONCAT_EQUIPMENT_KEY));
         $Factory = new \Runalyze\Model\Factory(\SessionAccountHandler::getId());
         $mainTypeID = $context->sport()->mainEquipmentTypeID();
         $names = array();
         foreach (array_unique($ids) as $id) {
             $Equipment = $Factory->equipment($id);
             if ($Equipment->typeid() == $mainTypeID) {
                 $names[] = $Factory->equipment($id)->name();
             }
         }
         return implode(', ', $names);
     }
     return '';
 }