Diff for /MPIWGWeb/MPIWGProjects.py between versions 1.47.2.2 and 1.47.2.5

version 1.47.2.2, 2005/05/26 08:47:29 version 1.47.2.5, 2005/05/27 08:34:37
Line 168  class MPIWGRoot(ZSQLExtendFolder): Line 168  class MPIWGRoot(ZSQLExtendFolder):
     folders=['MPIWGProject','Folder','ECHO_Navigation']      folders=['MPIWGProject','Folder','ECHO_Navigation']
     meta_type='MPIWGRoot'      meta_type='MPIWGRoot'
   
       def generateUrlProject(self,url):
           """erzeuge aus absoluter url, relative des Projektes"""
           splitted=url.split("/")
           length=len(splitted)
           short=splitted[length-2:length]
           base=self.REQUEST['URL1']+"/"+"/".join(short)
           return base
       
     def isNewCapital(self,text=None,reset=None):      def isNewCapital(self,text=None,reset=None):
         if reset:          if reset:
             self.REQUEST['capital']="A"              self.REQUEST['capital']="A"
Line 622  class MPIWGRoot(ZSQLExtendFolder): Line 630  class MPIWGRoot(ZSQLExtendFolder):
                   
         return returnList          return returnList
   
       def formatElementsAsList(self,elements):
           """formatiere tree als liste"""
           
           actualDepth=0
           ret=""
           for element in elements:
               if (element[0]>actualDepth):
                   #fuege soviele ul ein wie unterschied in tiefe
                   if element[0]==1:
                       ret+="""<div class="dept">\n"""
                   else:
                       for i in range(element[0]-actualDepth):
                           ret+="</li>\n<li><ul>\n"
                       
                   actualDepth=element[0]
                   
               elif (element[0]<actualDepth):
                   #fuege soviele /ul ein wie unterschied in tiefe
                   for i in range(-element[0]+actualDepth):
                       ret+="<br><br></li></ul></li>\n"
   
                   if element[0]==1:
                       department=int(element[3].getContent('xdata_05'))-1
                       
                       ret+="""</div>\n"""
                       ret+="""<div class="bildspalte"><img src="../grafik/dept%i.jpg" width="160" height="120" vspace="40"></div>
                       <div class="dept">\n<ul>\n
                       """%department
               
                   actualDepth=element[0]
               else:
                   ret+="""</li>\n"""
               ret+="""<li>\n"""
               
               if actualDepth==1:
                   departmentName={'1':'Department I','2':'Department II','3':'Department III', '4':'NWG','5':'NWG'} 
                   department=element[3].getContent('xdata_05')
                   ret+="""<img src="../grafik/totop.gif" vspace="10" border="0"></a><br><a name="dept%s"></a>%s: """%(department,departmentName[department])
   
               ret+="""<a href="%s">%s</a>"""%(self.generateUrlProject(element[3].absolute_url())+"/index.html",element[3].getContent('WEB_title'))
           return ret
   
     def formatElementForOverview(self,element):      def formatElementForOverview(self,element):
         """format the element for output in overview"""          """format the element for output in overview"""
Line 1094  class MPIWGProject(CatalogAware,Folder): Line 1143  class MPIWGProject(CatalogAware,Folder):
         """get attrbiute"""          """get attrbiute"""
         return getattr(self,field)          return getattr(self,field)
   
     def getContent(self,field):      def getContent(self,field,filter=None):
         """Inhalt des Feldes"""          """Inhalt des Feldes"""
                   
         text=u''          text=u''
Line 1126  class MPIWGProject(CatalogAware,Folder): Line 1175  class MPIWGProject(CatalogAware,Folder):
         if (text2=='') and (field=='WEB_project_header'):          if (text2=='') and (field=='WEB_project_header'):
             return self.getContent('WEB_title')              return self.getContent('WEB_title')
   
           if filter:
               splitted=text2.split("""<p class="picture">""")
               if len(splitted)>1:
                   tmp=splitted[1].split("</p>")
                   self.REQUEST.SESSION['image']=tmp[0].split("\"")[1].encode('utf-8')
                   split2="</p>".join(tmp[1:])
   
                   text3=splitted[0]+split2
   
                   splitted=text3.split("""<p class="picturetitle">""")
                   if len(splitted)>1:
                       tmp=splitted[1].split("</p>")
                       self.REQUEST.SESSION['imagecap']=tmp[0].encode('utf-8')
                       split4="".join(tmp[1:])
   
                       text5=splitted[0]+split4
                   else:
                       #keine caption
                       text5=text3
               else:
                   #kein bild
                   text5=text2
           else:
               text5=text2
   
         #teste ob WEB_project_description und keine führenden p tags          #teste ob WEB_project_description und keine führenden p tags
         if (len(text2)>4) and (not text2[0:3]=='<p>') and (field=='WEB_project_description'):          if (len(text5)>4) and (not text5[0:3]=='<p>') and (field=='WEB_project_description'):
             return "<p>"+text2+"</p>"              return "<p>"+text5+"</p>"
   
   
           #filter image
   
   
         return text2.encode('utf-8')          return text5.encode('utf-8')
           
     def show_html(self):      def show_html(self):
         """simple index"""          """simple index"""

Removed from v.1.47.2.2  
changed lines
  Added in v.1.47.2.5


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