Diff for /ECHO_content/VLPExtension.py between versions 1.10 and 1.13

version 1.10, 2004/06/25 11:02:16 version 1.13, 2004/07/16 16:31:12
Line 3  from Products.PageTemplates.PageTemplate Line 3  from Products.PageTemplates.PageTemplate
 from Products.PageTemplates.PageTemplate import PageTemplate  from Products.PageTemplates.PageTemplate import PageTemplate
 from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate  from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate
   
   try:
 from Products.zogiLib import zogiLib  from Products.zogiLib import zogiLib
   except:
       print "Zogilib not installed, VLP_resource will not work"
   
   import xml.dom.minidom
   import urllib
   
 def getText(nodelist):  def getText(nodelist):
   
Line 215  class VLP_resource(ECHO_resource): Line 221  class VLP_resource(ECHO_resource):
                           
     def show(self):      def show(self):
         """show the rendered file"""          """show the rendered file"""
   
           if self.REQUEST.get('p',None):
               self.REQUEST.set('pn',self.file2page(self.REQUEST.get('p',None)))
              
   
         pt=PageTemplateFile('Products/ECHO_content/vlp/library_template.zpt').__of__(self)          pt=PageTemplateFile('Products/ECHO_content/vlp/library_template.zpt').__of__(self)
         pt.content_type="text/html"          pt.content_type="text/html"
         return pt()          return pt()
Line 223  class VLP_resource(ECHO_resource): Line 234  class VLP_resource(ECHO_resource):
           
     def index_meta(self):      def index_meta(self):
         """index_meta"""          """index_meta"""
           
         pt=PageTemplateFile('Products/ECHO_content/vlp/index_meta.zpt').__of__(self)          pt=PageTemplateFile('Products/ECHO_content/vlp/index_meta.zpt').__of__(self)
         pt.content_type="text/html"          pt.content_type="text/html"
         return pt()          return pt()
           
       def file2page(self,p):
           """converts filename to pagenumber"""
           dom=xml.dom.minidom.parse(urllib.urlopen(getattr(self,'index.xml').absolute_url()))
           
           for page in dom.getElementsByTagName('page'):
               if page.getAttribute('file')==p:
                   return page.getAttribute('nr')
               
           return 0
   
     def dir2index(self):      def dir2index(self):
         """dir to index"""          """dir to index"""
Line 245  class VLP_resource(ECHO_resource): Line 266  class VLP_resource(ECHO_resource):
         for x in ret:          for x in ret:
             if not (x[0]=="."):              if not (x[0]=="."):
                                   
                 temp.append(calculateName(x))                  temp.append((calculateName(x),os.path.splitext(x)[0]))
         return temp          return temp
   
       
     def firstPage(self,url=None):      def firstPage(self,url=None):
         """showlink to the first image"""          """showlink to the first image"""
         if self.REQUEST.get('pn')=="1": #erste seinte dann kein a tag          if self.REQUEST.get('pn')=="1": #erste seinte dann kein a tag

Removed from v.1.10  
changed lines
  Added in v.1.13


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>