Пример #1
0
 /**
  * Get search link
  * @return string
  */
 public function getSearchLink()
 {
     if (Request::isOnSharedPage()) {
         return $this->getName();
     }
     return ShoeFactory::getSearchLink($this->id());
 }
 /**
  * Add info link
  */
 protected function addInfoLink()
 {
     if (!Request::isOnSharedPage()) {
         $Linker = new Linker($this->Context->activity());
         $InfoLink = Ajax::window('<a href="' . $Linker->urlToRoundsInfo() . '">' . __('More details about your laps') . '</a>', 'normal');
         $this->Header = HTML::info($InfoLink);
     }
 }
Пример #3
0
 /**
  * Init own JS-library on frontend (direct output)
  */
 public static function initJSlibrary()
 {
     $Options = array();
     $Options['sharedView'] = Request::isOnSharedPage();
     echo self::wrapJS('Runalyze.init(' . json_encode($Options) . ');');
     if (defined('NOKIA_HERE_APPID') && NOKIA_HERE_APPID != '' && defined('NOKIA_HERE_TOKEN') && NOKIA_HERE_TOKEN != '') {
         echo self::wrapJS('Runalyze.Options.setNokiaLayerAuth("' . NOKIA_HERE_APPID . '", "' . NOKIA_HERE_TOKEN . '")');
     }
 }
 /**
  * Add info link
  */
 protected function addInfoLink()
 {
     if ($this->Context->trackdata()->has(Trackdata\Entity::DISTANCE) && $this->Context->trackdata()->has(Trackdata\Entity::TIME)) {
         if (!Request::isOnSharedPage()) {
             $Linker = new Linker($this->Context->activity());
             $InfoLink = Ajax::window('<a href="' . $Linker->urlToRoundsInfo() . '">' . __('More details about your laps') . '</a>', 'big');
             $this->Header = HTML::info($InfoLink);
         }
     }
 }
Пример #5
0
 /**
  * Add info link
  */
 protected function addInfoLink()
 {
     if ($this->Context->dataview()->vdot()->value() > 0 || $this->Context->activity()->jdIntensity() > 0) {
         if (!Request::isOnSharedPage()) {
             $Linker = new Activity\Linker($this->Context->activity());
             $InfoLink = Ajax::window('<a href="' . $Linker->urlToVDOTInfo() . '">' . __('More about VDOT calculation') . '</a>', 'small');
             $this->Footer = HTML::info($InfoLink);
         }
     }
 }
 /**
  * Add info link
  */
 protected function addInfoLink()
 {
     if (!Request::isOnSharedPage()) {
         $Linker = new Linker($this->Context->activity());
         $InfoLink = Ajax::window('<a href="' . $Linker->urlToElevationInfo() . '">' . __('More about elevation') . '</a>', 'normal');
         $this->Footer = HTML::info($InfoLink);
     } else {
         $this->Footer = '';
     }
     if ($this->Context->route()->hasCorrectedElevations()) {
         $this->Footer .= HTML::info(__('Elevation data were corrected.'));
     } elseif ($this->Context->route()->hasOriginalElevations() && Configuration::ActivityForm()->correctElevation()) {
         $this->Footer .= HTML::warning(__('Elevation data are not corrected.'));
     }
     // TODO: Add link to correct them now!
 }
Пример #7
0
 /**
  * Can find activity ID?
  * @return boolean
  */
 protected function canFindActivityID()
 {
     return Request::isOnSharedPage() && SharedLinker::getTrainingId() > 0;
 }
Пример #8
0
 /**
  * Has position data?
  * @return bool True if latitude and longitude arrays are set.
  */
 public function hasPositionData()
 {
     if (Request::isOnSharedPage() && $this->hidesMap()) {
         return false;
     }
     return $this->hasArrayLatitude() && $this->hasArrayLongitude();
 }
Пример #9
0
 /**
  * Display header
  */
 protected function displayHeader()
 {
     echo '<div class="panel-heading">';
     if (!Request::isOnSharedPage()) {
         $this->displayHeaderMenu();
     } else {
         $this->displaySharedMenu();
     }
     echo '<h1>' . $this->Context->dataview()->titleWithComment() . '</h1>';
     if (!Request::isOnSharedPage()) {
         $this->displayReloadLink();
     }
     echo '</div>';
 }
Пример #10
0
 /**
  * Get trainingspartner as links
  * @return string
  */
 public function partnerAsLinks()
 {
     if (\Request::isOnSharedPage()) {
         return $this->partner();
     }
     $links = array();
     foreach ($this->Activity->partner()->asArray() as $partner) {
         $links[] = SearchLink::to('partner', $partner, $partner, 'like');
     }
     return implode(', ', $links);
 }