version 1.86, 2004/05/13 21:28:47
|
version 1.87, 2004/05/18 22:30:09
|
Line 124 def sendFile(self, filename, type):
|
Line 124 def sendFile(self, filename, type):
|
self.REQUEST.RESPONSE.write(file(fn).read()) |
self.REQUEST.RESPONSE.write(file(fn).read()) |
return |
return |
|
|
|
class BrowserCheck: |
|
"""check the browsers request to find out the browser type""" |
|
|
|
def __init__(self, zope): |
|
self.ua = zope.REQUEST.get_header("HTTP_USER_AGENT") |
|
self.isN4 = (string.find(self.ua, 'Mozilla/4.') > -1) and (string.find(self.ua, 'MSIE') < 0) |
|
self.isIE = string.find(self.ua, 'MSIE') > -1 |
|
self.nav = self.ua[string.find(self.ua, '('):] |
|
ie = string.split(self.nav, "; ")[1] |
|
if string.find(ie, "MSIE") > -1: |
|
self.versIE = string.split(ie, " ")[1] |
|
self.isMac = string.find(self.ua, 'Macintosh') > -1 |
|
self.isWin = string.find(self.ua, 'Windows') > -1 |
|
self.isIEWin = self.isIE and self.isWin |
|
self.isIEMac = self.isIE and self.isMac |
|
|
|
|
def writeMetadata(url,metadict): |
def writeMetadata(url,metadict): |
"""Einlesen der Metadaten und und erstellen des geänderten XML file""" |
"""Einlesen der Metadaten und und erstellen des geaenderten XML file""" |
|
|
try: |
try: |
geturl="" |
geturl="" |
Line 1043 class ECHO_collection(Folder, Persistent
|
Line 1059 class ECHO_collection(Folder, Persistent
|
pt=PageTemplateFile(os.path.join(package_home(globals()), 'zpt/ECHO_content_map_frag_js')).__of__(self) |
pt=PageTemplateFile(os.path.join(package_home(globals()), 'zpt/ECHO_content_map_frag_js')).__of__(self) |
return pt() |
return pt() |
|
|
|
def createMapImg(self): |
|
"""generate img-tag for map""" |
|
bt = BrowserCheck(self) |
|
tag = "" |
|
src = self.REQUEST['URL1'] + "/overview" |
|
if bt.isN4: |
|
tag += '<ilayer id="overview" visibility="show"><img src="%s"></ilayer>'%src |
|
else: |
|
tag += '<img id="overview" src="%s" />'%src |
|
return tag |
|
|
def createMapLink(self, ob, text=None): |
def createMapLink(self, ob, text=None): |
"""generate map link""" |
"""generate map link""" |
|
bt = BrowserCheck(self) |
id = ob[1] |
id = ob[1] |
link = ob[1] |
link = ob[1] |
if text == None: |
if text == None: |
text = ob[2] |
text = ob[2] |
|
tag = "" |
|
if bt.isN4: |
|
tag += '<ilayer id="a.%s"><a onmouseover="highlightPair(\'%s\', true)" onmouseout="highlightPair(\'%s\', false)" href="%s" target="_blank"'%(id,id,id,link) |
|
tag += ">" + text + "</a></ilayer>" |
|
else: |
tag = '<a id="a.%s" onmouseover="highlightPair(\'%s\', true)" onmouseout="highlightPair(\'%s\', false)" href="%s" target="_blank"'%(id,id,id,link) |
tag = '<a id="a.%s" onmouseover="highlightPair(\'%s\', true)" onmouseout="highlightPair(\'%s\', false)" href="%s" target="_blank"'%(id,id,id,link) |
if ob[3].contentType == 'text-popup': |
if ob[3].contentType == 'text-popup': |
tag += ' title="%s"'%ob[3].description |
tag += ' title="%s"'%ob[3].description |
Line 1061 class ECHO_collection(Folder, Persistent
|
Line 1094 class ECHO_collection(Folder, Persistent
|
link = ob[1] |
link = ob[1] |
vtype = ob[5] |
vtype = ob[5] |
ctype = ob[3].contentType |
ctype = ob[3].contentType |
|
bt = BrowserCheck(self) |
|
tag = "" |
|
|
|
if bt.isN4: |
|
tag += '<layer id="i.%s" onmouseover="highlightPair(\'%s\', true)" onmouseout="highlightPair(\'%s\', false)">'%(id,id,id) |
|
if vtype == "view point": |
|
rot = ob[4][4] |
|
tag += '<a href="%s"><img border="0" src="%s&rot=%s" /></a>'%(link,arrowsrc,rot) |
|
else: |
|
tag += '<a href="%s"><img border="0" width="1000" height="1000" src="trans_img"'%(link) |
|
if ctype == "text-popup": |
|
desc = ob[3].description |
|
tag += ' alt="%s"'%desc |
|
tag += ' /></a>' |
|
tag += '</layer>' |
|
else: |
tag = '<a id="b.%s" onmouseover="highlightPair(\'%s\', true)" onmouseout="highlightPair(\'%s\', false)" href="%s" target="_blank">'%(id,id,id,link) |
tag = '<a id="b.%s" onmouseover="highlightPair(\'%s\', true)" onmouseout="highlightPair(\'%s\', false)" href="%s" target="_blank">'%(id,id,id,link) |
if vtype == "view point": |
if vtype == "view point": |
rot = ob[4][4] |
rot = ob[4][4] |
tag += '<img id="i.%s" src="%s&rot=%s" border="1" style="position:absolute; top:-100px; left:-100px; border-style:none" />'%(id,arrowsrc,rot) |
if bt.isIEWin and bt.versIE > 5: |
|
tag += '<span id="i.%s" style="position:absolute; top:-100px; left:-100px; border-style:none; border-width=1px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'%s&rot=%s\');"><img style="visibility:hidden" src="%s&rot=%s" /></span>'%(id,arrowsrc,rot,arrowsrc,rot) |
else: |
else: |
tag += '<span id="i.%s" style="position:absolute; top:-100px; left:-100px; border-style:none"'%(id) |
tag += '<img id="i.%s" src="%s&rot=%s" border="1" style="position:absolute; top:-100px; left:-100px; border-style:none;" />'%(id,arrowsrc,rot) |
|
else: |
|
if bt.isIEWin: |
|
tag += '<div id="i.%s" style="position:absolute; top:-100px; left:-100px;background:url(area_img)"'%(id) |
|
else: |
|
tag += '<div id="i.%s" style="position:absolute; top:-100px; left:-100px;"'%(id) |
if ctype == "text-popup": |
if ctype == "text-popup": |
desc = ob[3].description |
desc = ob[3].description |
tag += ' title="%s"'%desc |
tag += ' title="%s"'%desc |
tag += ' />' |
tag += '> </div>' |
tag += '</a>' |
tag += '</a>' |
return tag |
return tag |
|
|
Line 1292 class ECHO_collection(Folder, Persistent
|
Line 1346 class ECHO_collection(Folder, Persistent
|
"""area image""" |
"""area image""" |
return sendFile(self, 'images/red.gif', 'image/gif') |
return sendFile(self, 'images/red.gif', 'image/gif') |
|
|
|
def trans_img(self): |
|
"""empty image""" |
|
return sendFile(self, 'images/trans.gif', 'image/gif') |
|
|
def hl_lib_js(self): |
def hl_lib_js(self): |
"""javascript""" |
"""javascript""" |
return sendFile(self, 'js/hl_lib.js', 'text/plain') |
return sendFile(self, 'js/hl_lib.js', 'text/plain') |