version 1.55, 2005/06/10 10:23:54
|
version 1.56, 2005/06/13 10:35:04
|
Line 178 class ECHO_basis:
|
Line 178 class ECHO_basis:
|
|
|
def getMapAreas(self): |
def getMapAreas(self): |
"""returns the list of MapAreas""" |
"""returns the list of MapAreas""" |
|
forcetypes = self.REQUEST.get('map_force_types', None) |
|
if forcetypes: |
|
typelist = forcetypes.split(',') |
|
else: |
|
typelist = None |
|
areas = [] |
# get all contained MapAreas |
# get all contained MapAreas |
areas = [res[1] for res in self.ZopeFind(self, obj_metatypes=('MapArea'))] |
for res in self.ZopeFind(self, obj_metatypes=('MapArea')): |
|
area = res[1] |
|
# check the allowed types |
|
if typelist is not None and area.getType() not in typelist: |
|
continue |
|
areas.append(area) |
return areas |
return areas |
|
|
def addMapArea(self, newarea): |
def addMapArea(self, newarea): |
Line 250 class ECHO_basis:
|
Line 261 class ECHO_basis:
|
if RESPONSE is not None: |
if RESPONSE is not None: |
RESPONSE.redirect('ECHO_graphicEntry') |
RESPONSE.redirect('ECHO_graphicEntry') |
|
|
def createJSAreas(self, areas, forcepermanent=None): |
def createJSAreas(self, areas): |
"""create area calls for JavaScript""" |
"""create area calls for JavaScript""" |
|
forceperm = self.REQUEST.get('map_force_permanent', None) |
js="\n" |
js="\n" |
for ob in areas: |
for ob in areas: |
if forcepermanent is not None: |
# check for force-permanent |
perm = forcepermanent |
if forceperm is not None: |
|
perm = forceperm |
else: |
else: |
perm = ob.isPermanent() |
perm = ob.isPermanent() |
js+="""addArea('%s', 'overview', %s, '%s', '%s');\n"""%(ob.getFullId(),ob.getCoordString(),ob.getType(),perm) |
js+="""addArea('%s', 'overview', %s, '%s', '%s');\n"""%(ob.getFullId(),ob.getCoordString(),ob.getType(),perm) |
Line 296 class ECHO_basis:
|
Line 309 class ECHO_basis:
|
tag = "" |
tag = "" |
if bt.isN4: |
if bt.isN4: |
# N4 needs layer for highlighting |
# N4 needs layer for highlighting |
tag += '<ilayer id="a.%s"><a onmouseover="highlightPair(\'%s\', true)" onmouseout="highlightPair(\'%s\', false)" href="%s" target="%s"'%(id,id,id,link,target) |
tag += '<ilayer id="a.%s"><a class="maplink" onmouseover="highlightPair(\'%s\', true)" onmouseout="highlightPair(\'%s\', false)" href="%s" target="%s"'%(id,id,id,link,target) |
tag += ">" + text + "</a></ilayer>" |
tag += ">" + text + "</a></ilayer>" |
else: |
else: |
# a-element |
# a-element |
tag = '<a id="a.%s" onmouseover="highlightPair(\'%s\', true)" onmouseout="highlightPair(\'%s\', false)" href="%s" target="%s"'%(id,id,id,link,target) |
tag = '<a id="a.%s" class="maplink" onmouseover="highlightPair(\'%s\', true)" onmouseout="highlightPair(\'%s\', false)" href="%s" target="%s"'%(id,id,id,link,target) |
if tiptext: |
if tiptext: |
tag += ' title="%s"'%tiptext |
tag += ' title="%s"'%tiptext |
tag += ">" + text + "</a>" |
tag += ">" + text + "</a>" |
Line 326 class ECHO_basis:
|
Line 339 class ECHO_basis:
|
if float(rot) < 0: |
if float(rot) < 0: |
marksrc = circlesrc |
marksrc = circlesrc |
tag += '<a href="%s"><img border="0" src="%s&rot=%s" /></a>'%(link,marksrc,rot) |
tag += '<a href="%s"><img border="0" src="%s&rot=%s" /></a>'%(link,marksrc,rot) |
|
elif ob.isTypeText(): |
|
# N4 - Text |
|
tag += '<div id="t.%s" class="maptext"'%(id) |
|
tag += 'style="visibility:hidden">' |
|
tag += ob.getText() |
|
tag += '</div>' |
else: |
else: |
# N4 - Area |
# N4 - Area |
tag += '<a href="%s"><img border="0" width="1000" height="1000" src="trans_img"'%(link) |
tag += '<a href="%s"><img border="0" width="1000" height="1000" src="trans_img"'%(link) |
Line 337 class ECHO_basis:
|
Line 356 class ECHO_basis:
|
# |
# |
# (more or less) DOM capable browser |
# (more or less) DOM capable browser |
# |
# |
tag = '<a id="b.%s" onmouseover="highlightPair(\'%s\', true)" onmouseout="highlightPair(\'%s\', false)" href="%s" target="%s">'%(id,id,id,link,target) |
tag = '<a id="b.%s" class="mapmarklink" onmouseover="highlightPair(\'%s\', true)" onmouseout="highlightPair(\'%s\', false)" href="%s" target="%s">'%(id,id,id,link,target) |
if ob.isTypeArrow(): |
if ob.isTypeArrow(): |
# DOM - Arrow |
# DOM - Arrow |
rot = ob.angle |
rot = ob.angle |