<?php /** * This file contains class::ImporterFiletypeXML * @package Runalyze\Import\Filetype */ ImporterWindowTabUpload::addInfo(__('xml-files from Polar, Suunto and RunningAHEAD are supported.')); /** * Importer: *.xml * * @author Hannes Christiansen * @package Runalyze\Import\Filetype */ class ImporterFiletypeXML extends ImporterFiletypeAbstract { /** * Allowed producer of XML files * @var string */ private static $ALLOWED_PRODUCER = 'Polar, Suunto, RunningAHEAD'; /** * Set parser * @param string $String string to parse */ protected function setParserFor($String) { if ($this->isFromPolar($String)) { $this->Parser = new ParserXMLpolarMultiple($String); } elseif ($this->isFromRunningAHEAD($String)) { $this->Parser = new ParserXMLrunningAHEADMultiple($String); } elseif ($this->isFromSuunto($String)) {
<?php /** * This file contains class::ImporterFiletypeHRM * @package Runalyze\Import\Filetype */ ImporterWindowTabUpload::addInfo(__('hrm- and gpx-files with the same name will be automatically combined.')); /** * Importer: *.hrm * * Files of *.hrm are from Polar * * @author Hannes Christiansen * @package Runalyze\Import\Filetype */ class ImporterFiletypeHRM extends ImporterFiletypeAbstract { /** * Set parser * @param string $String string to parse */ protected function setParserFor($String) { $this->Parser = new ParserHRMSingle($String); } }
{ return strpos($string, '<gx:Track') !== false; } /** * Is this a standard kml file? * @param string $string * @return bool */ private function isDefaultKML($string) { return strpos($string, '<coordinates') !== false; } /** * Is this a namespaced kml file? * @param string $string * @return bool */ private function isNamespacedKml($string) { return strpos($string, '<kml:coordinates') !== false; } /** * Throw error for unknown format */ private function throwErrorForUnknownFormat() { $this->Errors[] = sprintf(__('This file is not supported. Supported producers of %s-files: %s.'), 'kml', self::ALLOWED_PRODUCER); } } ImporterWindowTabUpload::addInfo(sprintf(__('%s-files are supported from: %s'), 'kml', ImporterFiletypeKML::ALLOWED_PRODUCER));
<?php /** * This file contains class::ImporterFiletypeKML * @package Runalyze\Import\Filetype */ ImporterWindowTabUpload::addInfo(__('kml-files from TomTom are supported.')); /** * Importer: *.xml * * @author Hannes Christiansen * @package Runalyze\Import\Filetype */ class ImporterFiletypeKML extends ImporterFiletypeAbstract { /** * Allowed producer of XML files * @var string */ private static $ALLOWED_PRODUCER = 'Google, TomTom'; /** * Set parser * @param string $string string to parse */ protected function setParserFor($string) { if ($this->isFromTomTom($string)) { $this->Parser = new ParserKMLtomtomMultiple($string); } elseif ($this->isDefaultKML($string)) { $this->Parser = new ParserKMLSingle($string); } else {