Changeset 887 for trunk/Modules/Map
- Timestamp:
- Nov 20, 2020, 12:08:12 AM (4 years ago)
- Location:
- trunk/Modules/Map
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Map/Map.php
r874 r887 5 5 class PageNetworkMap extends Page 6 6 { 7 var $FullTitle = 'Mapa sítě'; 8 var $ShortTitle = 'Mapa sítě'; 9 var $ParentClass = 'PagePortal'; 7 function __construct(System $System) 8 { 9 parent::__construct($System); 10 $this->FullTitle = 'Mapa sítě'; 11 $this->ShortTitle = 'Mapa sítě'; 12 $this->ParentClass = 'PagePortal'; 13 } 10 14 //var $Load = 'initialize()'; 11 15 //var $Unload = 'GUnload()'; 12 16 13 function Show() 14 { 15 if (! $this->System->User->CheckPermission('Map', 'Show'))17 function Show(): string 18 { 19 if (!ModuleUser::Cast($this->System->GetModule('User'))->User->CheckPermission('Map', 'Show')) 16 20 return 'Nemáte oprávnění'; 17 21 … … 23 27 } 24 28 25 function ShowPosition() 29 function ShowPosition(): string 26 30 { 27 31 $DbResult = $this->Database->select('MapPosition', '*', '`Id`='.$_GET['i']); … … 44 48 } 45 49 46 function ShowMain() 50 function ShowMain(): string 47 51 { 48 52 $Map = new MapOpenStreetMaps($this->System); … … 242 246 class TypeMapPosition extends TypeString 243 247 { 244 function OnEdit( $Item)248 function OnEdit(array $Item): string 245 249 { 246 250 $Output = parent::OnEdit($Item); … … 255 259 class ModuleMap extends AppModule 256 260 { 257 function __construct( $System)261 function __construct(System $System) 258 262 { 259 263 parent::__construct($System); … … 263 267 $this->License = 'GNU/GPL'; 264 268 $this->Description = 'Show objects on Google maps'; 265 $this->Dependencies = array('Network' );269 $this->Dependencies = array('Network', 'User'); 266 270 $this->SupportedModels = array(); 267 271 } 268 272 269 function DoStart() 273 function DoStart(): void 270 274 { 271 275 $this->System->Pages['map'] = 'PageNetworkMap'; … … 310 314 } 311 315 312 function DoInstall() 316 function DoInstall(): void 313 317 { 314 318 $this->System->Database->query("CREATE TABLE IF NOT EXISTS `MapPosition` ( … … 320 324 } 321 325 322 function DoUninstall() 326 function DoUninstall(): void 323 327 { 324 328 $this->Database->query('DROP TABLE `MapPosition`'); -
trunk/Modules/Map/MapAPI.php
r874 r887 3 3 class MapMarker 4 4 { 5 var$Position;6 var$Text;5 public array $Position; 6 public string $Text; 7 7 } 8 8 9 9 class MapPolyLine 10 10 { 11 var$Points = array();12 var$Color = 'black';11 public array $Points = array(); 12 public string $Color = 'black'; 13 13 } 14 14 15 15 class Map extends Model 16 16 { 17 var$Position;18 var$Zoom;19 var$Key;17 public array $Position; 18 public int $Zoom; 19 public string $Key; 20 20 var $OnClickObject; 21 var$MarkerText;22 var$Markers;23 var$PolyLines;21 public string $MarkerText; 22 public array $Markers; 23 public array $PolyLines; 24 24 25 function __construct( $System)25 function __construct(System $System) 26 26 { 27 27 parent::__construct($System); … … 35 35 } 36 36 37 function Show() 37 function Show(): string 38 38 { 39 39 return ''; … … 43 43 class MapGoogle extends Map 44 44 { 45 function ShowPage( $Page)45 function ShowPage(Page $Page): string 46 46 { 47 47 $Page->Load = 'initialize()'; … … 113 113 class MapOpenStreetMaps extends Map 114 114 { 115 function GetPageHeader() 115 function GetPageHeader(): string 116 116 { 117 117 $Output = '<link rel="stylesheet" href="https://unpkg.com/leaflet@1.5.1/dist/leaflet.css" … … 124 124 } 125 125 126 function ShowPage( $Page)126 function ShowPage(Page $Page): string 127 127 { 128 128 $this->System->PageHeaders[] = array($this, 'GetPageHeader');
Note:
See TracChangeset
for help on using the changeset viewer.