Changeset 51:c5d3aabbf61b in documentViewer


Ignore:
Timestamp:
Jan 11, 2007, 8:27:17 PM (17 years ago)
Author:
dwinter
Branch:
default
Message:

textviewer now integrated, new modus auto introduced as standard for viewing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • documentViewer.py

    r50 r51  
    101101
    102102    security.declareProtected('View','index_html')
    103     def index_html(self,mode,url,viewMode="images",start=None,pn=1):
     103    def index_html(self,mode,url,viewMode="auto",start=None,pn=1):
    104104        '''
    105105        view it
    106         @param mode: defines which type of document is behind url
     106        @param mode: defines which type of document is behind url (text,images or auto)
    107107        @param url: url which contains display information
    108108        @param viewMode: if images display images, if text display text, default is images
     
    122122        pageinfo = self.getPageinfo(start=start,current=pn,docinfo=docinfo)
    123123        pt = getattr(self.template, 'viewer_main')
     124       
     125        if viewMode=="auto": # automodus gewaehlt
     126            if docinfo.get("textURL",'') and self.textViewerUrl: #texturl gesetzt und textViewer konfiguriert
     127                viewMode="text"
     128            else:
     129                viewMode="images"
     130               
    124131        return pt(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode)
    125132 
     
    419426        zLOG.LOG("documentViewer (getdocinfo)", zLOG.INFO,"mode: %s, url: %s"%(mode,url))
    420427        # look for cached docinfo in session
    421         # XXXX Sesion abgeschaltet
    422         if self.REQUEST.SESSION.has_key('docinfo_XX'):
     428        if self.REQUEST.SESSION.has_key('docinfo'):
    423429            docinfo = self.REQUEST.SESSION['docinfo']
    424430            # check if its still current
Note: See TracChangeset for help on using the changeset viewer.