version 1.20, 2007/01/11 12:03:17
|
version 1.21, 2007/01/11 20:27:17
|
Line 100 class documentViewer(Folder):
|
Line 100 class documentViewer(Folder):
|
|
|
|
|
security.declareProtected('View','index_html') |
security.declareProtected('View','index_html') |
def index_html(self,mode,url,viewMode="images",start=None,pn=1): |
def index_html(self,mode,url,viewMode="auto",start=None,pn=1): |
''' |
''' |
view it |
view it |
@param mode: defines which type of document is behind url |
@param mode: defines which type of document is behind url (text,images or auto) |
@param url: url which contains display information |
@param url: url which contains display information |
@param viewMode: if images display images, if text display text, default is images |
@param viewMode: if images display images, if text display text, default is images |
|
|
Line 121 class documentViewer(Folder):
|
Line 121 class documentViewer(Folder):
|
docinfo = self.getDocinfo(mode=mode,url=url) |
docinfo = self.getDocinfo(mode=mode,url=url) |
pageinfo = self.getPageinfo(start=start,current=pn,docinfo=docinfo) |
pageinfo = self.getPageinfo(start=start,current=pn,docinfo=docinfo) |
pt = getattr(self.template, 'viewer_main') |
pt = getattr(self.template, 'viewer_main') |
|
|
|
if viewMode=="auto": # automodus gewaehlt |
|
if docinfo.get("textURL",'') and self.textViewerUrl: #texturl gesetzt und textViewer konfiguriert |
|
viewMode="text" |
|
else: |
|
viewMode="images" |
|
|
return pt(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode) |
return pt(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode) |
|
|
|
|
Line 418 class documentViewer(Folder):
|
Line 425 class documentViewer(Folder):
|
"""returns docinfo depending on mode""" |
"""returns docinfo depending on mode""" |
zLOG.LOG("documentViewer (getdocinfo)", zLOG.INFO,"mode: %s, url: %s"%(mode,url)) |
zLOG.LOG("documentViewer (getdocinfo)", zLOG.INFO,"mode: %s, url: %s"%(mode,url)) |
# look for cached docinfo in session |
# look for cached docinfo in session |
# XXXX Sesion abgeschaltet |
if self.REQUEST.SESSION.has_key('docinfo'): |
if self.REQUEST.SESSION.has_key('docinfo_XX'): |
|
docinfo = self.REQUEST.SESSION['docinfo'] |
docinfo = self.REQUEST.SESSION['docinfo'] |
# check if its still current |
# check if its still current |
if docinfo is not None and docinfo.get('mode') == mode and docinfo.get('url') == url: |
if docinfo is not None and docinfo.get('mode') == mode and docinfo.get('url') == url: |