Changeset 382
- Timestamp:
- 07/07/06 09:40:16
- Files:
-
- geolocation/trunk/Extensions/Install.py (modified) (3 diffs)
- geolocation/trunk/__init__.py (modified) (1 diff)
- geolocation/trunk/browser/edit_location.pt (deleted)
- geolocation/trunk/browser/location.py (modified) (2 diffs)
- geolocation/trunk/config.py (added)
- geolocation/trunk/configure.zcml (modified) (1 diff)
- geolocation/trunk/skins (added)
- geolocation/trunk/skins/geolocation (added)
- geolocation/trunk/skins/geolocation/editLocation.js (added)
- geolocation/trunk/skins/geolocation/edit_location.cpt (added)
- geolocation/trunk/skins/geolocation/edit_location.cpt.metadata (added)
- geolocation/trunk/skins/geolocation/save_location.cpy (added)
- geolocation/trunk/skins/geolocation/save_location.cpy.metadata (added)
- geolocation/trunk/skins/geolocation/validate_location.vpy (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
geolocation/trunk/Extensions/Install.py
r381 r382 2 2 from cStringIO import StringIO 3 3 from Products.CMFCore.utils import getToolByName 4 from Products.CMFCore.DirectoryView import addDirectoryViews 5 6 from Products.geolocation.config import * 4 7 5 8 PORTAL_TYPES = ['Document', 'News Item', 'Event', 'Link', 'Image'] 9 10 def setupSkin(self, out, skinFolder): 11 """ Setup product skin layer """ 12 skinstool=getToolByName(self, 'portal_skins') 13 addDirectoryViews(skinstool, SKINS_DIR, GLOBALS) 14 for skin in skinstool.getSkinSelections(): 15 path = skinstool.getSkinPath(skin) 16 path = map(string.strip, string.split(path,',')) 17 if not skinFolder in path: 18 try: 19 path.insert( path.index('custom')+1, skinFolder) 20 except ValueError: 21 path.append(skinFolder) 22 path = string.join(path, ', ') 23 skinstool.addSkinSelection(skin, path) 24 out.write(' %s layer sucessfully installed into skin %s.\n' % (skinFolder, skin)) 25 else: 26 out.write(' %s layer was already installed into skin %s.\n' % (skinFolder, skin)) 27 28 def removeSkin(self, skins=[]): 29 """ Setup product skin layer """ 30 if skins: 31 skinstool = getToolByName(self, 'portal_skins') 32 for skinName in skinstool.getSkinSelections(): 33 path = skinstool.getSkinPath(skinName) 34 path = [i.strip() for i in path.split(',')] 35 for s in skins: 36 if s in path: 37 path.remove(s) 38 s += '/' 39 for layer in path: 40 if layer.startswith(s): 41 path.remove(layer) 42 path = ','.join(path) 43 skinstool.addSkinSelection(skinName, path) 6 44 7 45 def installGEOLocationAction(self): … … 29 67 """ Product installation """ 30 68 out = StringIO() 69 out.write('setupSkin... \n') 70 setupSkin(self, out, PROJECTNAME) 31 71 catalog = getToolByName(self, 'portal_catalog') 32 72 if 'geoLocation' not in catalog.indexes(): … … 41 81 def uninstall(self): 42 82 out = StringIO() 83 removeSkin(self, [PROJECTNAME,]) 43 84 uninstallGEOLocationAction(self) 44 85 out.write('Removed geolocation edit for content types') geolocation/trunk/__init__.py
r381 r382 1 # 1 from Products.CMFCore.DirectoryView import registerDirectory 2 3 from Products.geolocation.config import * 4 5 registerDirectory(SKINS_DIR, GLOBALS) geolocation/trunk/browser/location.py
r381 r382 17 17 self.request = request 18 18 self.location = IGEOLocated(self.context, None) 19 self.latitude = self.location and self.location.getLatitude() or 020 self.longitude = self.location and self.location.getLongitude() or 019 self.latitude = self.location and self.location.getLatitude() or None 20 self.longitude = self.location and self.location.getLongitude() or None 21 21 22 22 def editLocation(self, latitude=None, longitude=None): … … 25 25 self.context.reindexObject() 26 26 27 def getLatitude(self): 28 """ return location latitude """ 29 return self.latitude 30 31 def getLongitude(self): 32 """ return location longitude """ 33 return self.longitude geolocation/trunk/configure.zcml
r381 r382 51 51 permission="zope2.View" 52 52 allowed_interface=".interface.IGEOLocatedView" 53 allowed_attributes="getLatitude getLongitude" 53 54 /> 54 55 55 <browser:page56 <!-- <browser:page 56 57 for="*" 57 58 name="edit_location" 58 template="browser/edit_location. pt"59 template="browser/edit_location.cpt" 59 60 permission="zope2.View" 60 /> 61 /> --> 61 62 62 63 <browser:page
