source: products/geolocation/trunk/skins/geolocation/save_location.cpy

Last change on this file was 1, checked in by myroslav, 18 years ago

Building directory structure

  • Property svn:eol-style set to native
File size: 877 bytes
Line 
1# Controller Python Script "save_location"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind state=state
7##bind subpath=traverse_subpath
8##parameters=
9##title=
10#
11
12latitude       = context.REQUEST.get('latitude', 0)
13longitude      = context.REQUEST.get('longitude', 0)
14maplatitude    = context.REQUEST.get('maplatitude', 0)
15maplongitude   = context.REQUEST.get('maplongitude', 0)
16mapzoom        = context.REQUEST.get('mapzoom', 0)
17maptype        = context.REQUEST.get('maptype', 0)
18
19if not (maplatitude and maplongitude): mapcenter=()
20else: mapcenter = (float(maplatitude), float(maplongitude))
21
22context.restrictedTraverse('@@LocationView').editLocation(latitude, longitude)
23context.restrictedTraverse('@@MapView').editMapOptions(mapcenter, mapzoom, maptype)
24
25return state.set(portal_status_message="geoLocation property updated")
26
Note: See TracBrowser for help on using the repository browser.