Diff for /ECHO_content/ECHO_Nav.py between versions 1.22 and 1.30

version 1.22, 2004/05/06 13:35:25 version 1.30, 2004/05/28 09:55:24
Line 13  import os.path Line 13  import os.path
 from Globals import package_home  from Globals import package_home
 import urllib  import urllib
 from ECHO_helpers import displayTypes,checkOnlyOneInGroup  from ECHO_helpers import displayTypes,checkOnlyOneInGroup
   from ECHO_collection import content_html
   
 class ECHO_contentType(Image):  class ECHO_contentType(Image):
     """ContentType Object"""      """ContentType Object"""
Line 181  class ECHO_pageTemplate(ZopePageTemplate Line 182  class ECHO_pageTemplate(ZopePageTemplate
         {'label':'Weight and Type','action':'changeECHO_pageTemplateWeightForm'},          {'label':'Weight and Type','action':'changeECHO_pageTemplateWeightForm'},
         )          )
   
       def content_html(self):
       """content_html"""
       return content_html(self,'pageTemplate')
   
     def changeECHO_pageTemplateWeightForm(self):      def changeECHO_pageTemplateWeightForm(self):
         """change"""          """change"""
         pt=PageTemplateFile('Products/ECHO_content/zpt/ChangeECHO_pageTemplateWeight.zpt').__of__(self)          pt=PageTemplateFile('Products/ECHO_content/zpt/ChangeECHO_pageTemplateWeight.zpt').__of__(self)
Line 279  class ECHO_navigation(Folder): Line 284  class ECHO_navigation(Folder):
   
     displayedMetaTypes=displayTypes      displayedMetaTypes=displayTypes
           
       def getR(self):
       """re"""
       return self.REQUEST
   
     def __init__(self,id,title,pathToHierarchy):      def __init__(self,id,title,pathToHierarchy):
         """init"""          """init"""
         self.id=id          self.id=id
Line 356  class ECHO_navigation(Folder): Line 365  class ECHO_navigation(Folder):
                 tempObj=self.pathToHierarchy[0:]                  tempObj=self.pathToHierarchy[0:]
                 tempObj=re.sub("/",".",tempObj)                  tempObj=re.sub("/",".",tempObj)
                 tempObj="self.aq_parent"+tempObj                  tempObj="self.aq_parent"+tempObj
           #print tempObj
                 objtemp=eval(tempObj)                  objtemp=eval(tempObj)
   
                 obj=objtemp                  obj=objtemp
Line 386  class ECHO_navigation(Folder): Line 395  class ECHO_navigation(Folder):
                     for z in temp[x][1].getNavList():                      for z in temp[x][1].getNavList():
                         listNav.append((z[0],z[1],None))                          listNav.append((z[0],z[1],None))
                 else:                  else:
                     # add label fals existiert und nicht leer                      # add label falls existiert und nicht leer
                     if hasattr(temp[x][1],'label'):                      if hasattr(temp[x][1],'label'):
                         if not temp[x][1].label=='':                          if not temp[x][1].label=='':
                             label=temp[x][1].label.encode('utf-8')                              label=temp[x][1].label.encode('utf-8')
Line 430  class ECHO_navigation(Folder): Line 439  class ECHO_navigation(Folder):
                           
     def isSelectedPath(self,item):      def isSelectedPath(self,item):
         """test is path is already selected"""          """test is path is already selected"""
         found=re.search("\?(.*)",item[1])          found=re.search("\?(.*)/",item[1])
         if found:          if found:
             temp=re.sub(" ","%20",found.group(0))              temp=re.sub(" ","%20",found.group(0))
             #print temp+"::"+self.REQUEST['QUERY_STRING']              #print temp+"::"+self.REQUEST['QUERY_STRING']
             if ("?"+self.REQUEST['QUERY_STRING'])==temp:              if ("?"+self.REQUEST['QUERY_STRING'])==temp:
                 return 1                  return 1
   
         if re.search(item[1],self.REQUEST['URL']):          if re.search(item[1]+"/",self.REQUEST['URL']):
             return 1              return 1
         else:          else:
             return 0              return 0
Line 511  class ECHO_navigation(Folder): Line 520  class ECHO_navigation(Folder):
   
     return len(self.barFromHash(self.createNavHash(0)))       return len(self.barFromHash(self.createNavHash(0))) 
   
       def startOfHierarchy(self,list):
           splitted=self.pathToHierarchy.split("/")
           last=splitted[len(splitted)-1]
           #print last,list
           try:
               nr=list.index(last)
           except:
               nr=0
           return nr+1
       
     def secondNavElements(self):      def secondNavElements(self):
         """Zweite Ordnung"""          """Zweite Ordnung"""
                   
Line 522  class ECHO_navigation(Folder): Line 541  class ECHO_navigation(Folder):
   
         splitted=ult_temp.split("/")          splitted=ult_temp.split("/")
                   
       #print "AU",self.absolute_url(),splitted
       #start=[splitted[2]] #orig
           startNr= self.startOfHierarchy(splitted)
           
       start=[splitted[startNr]]
   
         start=[splitted[2]]  
         #print start          #print start
                 
         keys=self.barFromHash(hash,start=start)          keys=self.barFromHash(hash,start=start)
Line 548  class ECHO_navigation(Folder): Line 571  class ECHO_navigation(Folder):
 ##         else:  ##         else:
 ##             start=[splitted[len(splitted)-1]]  ##             start=[splitted[len(splitted)-1]]
   
         start=splitted[2:order+1]          #start=splitted[2:order+1] #orig
           startNr= self.startOfHierarchy(splitted)
           #print startNr
       start=splitted[startNr:order+startNr-1] 
         #print start          #print start
                 
         keys=self.barFromHash(hash,start=start)          keys=self.barFromHash(hash,start=start)
Line 606  def createPath(url1,url2): Line 632  def createPath(url1,url2):
         if temp2[0]==test:          if temp2[0]==test:
             del temp2[0]              del temp2[0]
   
       #print "CP:"+url1+"::"+url2+"::"+url1+"/"+string.join(temp2,"/")
     return url1+"/"+string.join(temp2,"/")      return url1+"/"+string.join(temp2,"/")
   
 def sortWeight(x,y):  def sortWeight(x,y):

Removed from v.1.22  
changed lines
  Added in v.1.30


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