Change log folder
This commit is contained in:
@@ -19,7 +19,7 @@ use \Settings;
|
||||
class Converter extends PhpObject {
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct(__CLASS__, Settings::DEBUG);
|
||||
parent::__construct(__CLASS__);
|
||||
}
|
||||
|
||||
public static function convertToGeoJson($sCodeName) {
|
||||
@@ -36,8 +36,11 @@ class Converter extends PhpObject {
|
||||
|
||||
public static function isGeoJsonValid($sCodeName) {
|
||||
$bResult = false;
|
||||
$sGpxFilePath = Geo::getFilePath($sCodeName, Gpx::EXT);
|
||||
$sGeoJsonFilePath = Geo::getFilePath($sCodeName, GeoJson::EXT);
|
||||
if(file_exists($sGeoJsonFilePath) && filemtime($sGeoJsonFilePath) > filemtime(Geo::getFilePath($sCodeName, Gpx::EXT))) $bResult = true;
|
||||
|
||||
//No need to generate if gpx is missing
|
||||
if(!file_exists($sGpxFilePath) || file_exists($sGeoJsonFilePath) && filemtime($sGeoJsonFilePath) > filemtime(Geo::getFilePath($sCodeName, Gpx::EXT))) $bResult = true;
|
||||
return $bResult;
|
||||
}
|
||||
}
|
||||
@@ -80,33 +83,36 @@ class Gpx extends Geo {
|
||||
|
||||
private function parseFile() {
|
||||
$this->addNotice('Parsing: '.$this->sFilePath);
|
||||
$oXml = simplexml_load_file($this->sFilePath);
|
||||
if(!file_exists($this->sFilePath)) $this->addError($this->sFilePath.' file missing');
|
||||
else {
|
||||
$oXml = simplexml_load_file($this->sFilePath);
|
||||
|
||||
//Tracks
|
||||
$this->addNotice('Converting '.count($oXml->trk).' tracks');
|
||||
foreach($oXml->trk as $aoTrack) {
|
||||
$asTrack = array(
|
||||
'name' => (string) $aoTrack->name,
|
||||
'desc' => str_replace("\n", '', ToolBox::fixEOL((strip_tags($aoTrack->desc)))),
|
||||
'cmt' => ToolBox::fixEOL((strip_tags($aoTrack->cmt))),
|
||||
'color' => (string) $aoTrack->extensions->children('gpxx', true)->TrackExtension->DisplayColor,
|
||||
'points'=> array()
|
||||
);
|
||||
//Tracks
|
||||
$this->addNotice('Converting '.count($oXml->trk).' tracks');
|
||||
foreach($oXml->trk as $aoTrack) {
|
||||
$asTrack = array(
|
||||
'name' => (string) $aoTrack->name,
|
||||
'desc' => str_replace("\n", '', ToolBox::fixEOL((strip_tags($aoTrack->desc)))),
|
||||
'cmt' => ToolBox::fixEOL((strip_tags($aoTrack->cmt))),
|
||||
'color' => (string) $aoTrack->extensions->children('gpxx', true)->TrackExtension->DisplayColor,
|
||||
'points'=> array()
|
||||
);
|
||||
|
||||
foreach($aoTrack->trkseg as $asSegment) {
|
||||
foreach($asSegment as $asPoint) {
|
||||
$asTrack['points'][] = array(
|
||||
'lon' => (float) $asPoint['lon'],
|
||||
'lat' => (float) $asPoint['lat'],
|
||||
'ele' => (int) $asPoint->ele
|
||||
);
|
||||
foreach($aoTrack->trkseg as $asSegment) {
|
||||
foreach($asSegment as $asPoint) {
|
||||
$asTrack['points'][] = array(
|
||||
'lon' => (float) $asPoint['lon'],
|
||||
'lat' => (float) $asPoint['lat'],
|
||||
'ele' => (int) $asPoint->ele
|
||||
);
|
||||
}
|
||||
}
|
||||
$this->asTracks[] = $asTrack;
|
||||
}
|
||||
$this->asTracks[] = $asTrack;
|
||||
}
|
||||
|
||||
//Waypoints
|
||||
$this->addNotice('Ignoring '.count($oXml->wpt).' waypoints');
|
||||
//Waypoints
|
||||
$this->addNotice('Ignoring '.count($oXml->wpt).' waypoints');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ class Email extends PhpObject {
|
||||
private $asDests;
|
||||
|
||||
public function __construct($sServName, $sTemplateName='') {
|
||||
parent::__construct(__CLASS__);
|
||||
$this->sServName = $sServName;
|
||||
$this->setTemplate($sTemplateName);
|
||||
$this->asDests = array();
|
||||
|
||||
@@ -54,7 +54,7 @@ class Feed extends PhpObject {
|
||||
private $iLastUpdate;
|
||||
|
||||
public function __construct(Db &$oDb, $iFeedId=0) {
|
||||
parent::__construct(__CLASS__, Settings::DEBUG);
|
||||
parent::__construct(__CLASS__);
|
||||
$this->oDb = &$oDb;
|
||||
if($iFeedId > 0) $this->setFeedId($iFeedId);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ class Map extends PhpObject {
|
||||
private $asMaps;
|
||||
|
||||
public function __construct(Db &$oDb) {
|
||||
parent::__construct(__CLASS__, Settings::DEBUG);
|
||||
parent::__construct(__CLASS__);
|
||||
$this->oDb = &$oDb;
|
||||
$this->setMaps();
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ class Media extends PhpObject {
|
||||
private $iMediaId;
|
||||
|
||||
public function __construct(Db &$oDb, &$oProject, $iMediaId=0) {
|
||||
parent::__construct(__CLASS__, Settings::DEBUG);
|
||||
parent::__construct(__CLASS__);
|
||||
$this->oDb = &$oDb;
|
||||
$this->oProject = &$oProject;
|
||||
$this->asMedia = array();
|
||||
|
||||
@@ -22,14 +22,16 @@ class Project extends PhpObject {
|
||||
*/
|
||||
private $oDb;
|
||||
|
||||
|
||||
private $iProjectId;
|
||||
private $sMode;
|
||||
private $sName;
|
||||
private $sCodeName;
|
||||
private $sMode;
|
||||
private $asActive;
|
||||
private $asGeo;
|
||||
|
||||
public function __construct(Db &$oDb, $iProjectId=0) {
|
||||
parent::__construct(__CLASS__, Settings::DEBUG);
|
||||
parent::__construct(__CLASS__);
|
||||
$this->oDb = &$oDb;
|
||||
if($iProjectId > 0) $this->setProjectId($iProjectId);
|
||||
}
|
||||
@@ -179,10 +181,10 @@ class Project extends PhpObject {
|
||||
if($this->getProjectId() > 0) {
|
||||
$asProject = $this->getProject();
|
||||
|
||||
$this->sName = $asProject['name'];
|
||||
$this->sCodeName = $asProject['codename'];
|
||||
$this->sMode = $asProject['mode'];
|
||||
$this->asActive = array('from'=>$asProject['active_from'], 'to'=>$asProject['active_to']);
|
||||
$this->sCodeName = $asProject['codename'];
|
||||
$this->sName = $asProject['name'];
|
||||
$this->asGeo = array('geofile'=>$asProject['geofilepath'], 'gpxfile'=>$asProject['gpxfilepath']);
|
||||
}
|
||||
else $this->addError('Error while setting project: no project ID');
|
||||
|
||||
@@ -47,7 +47,7 @@ class Spot extends Main
|
||||
|
||||
public function __construct($sProcessPage, $sTimezone)
|
||||
{
|
||||
parent::__construct($sProcessPage, true, __FILE__, $sTimezone);
|
||||
parent::__construct($sProcessPage, true, $sTimezone);
|
||||
|
||||
$this->oUser = new User($this->oDb);
|
||||
|
||||
@@ -248,8 +248,7 @@ class Spot extends Main
|
||||
}
|
||||
|
||||
$bSuccess = $oEmail->send();
|
||||
if(!$bSuccess) $sDesc = $oEmail->ErrorInfo;
|
||||
else $sDesc = 'mail_sent';
|
||||
$sDesc = $bSuccess?'mail_sent':'mail_failure';
|
||||
}
|
||||
else $sDesc = 'no_new_msg';
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ class User extends PhpObject {
|
||||
private $asUserInfo;
|
||||
|
||||
public function __construct(Db &$oDb) {
|
||||
parent::__construct(__CLASS__, Settings::DEBUG);
|
||||
parent::__construct(__CLASS__);
|
||||
$this->oDb = &$oDb;
|
||||
$this->iUserId = 0;
|
||||
$this->asUserInfo = array(
|
||||
|
||||
Reference in New Issue
Block a user