Diff for /ECHO_content/ECHO_Nav.py between versions 1.24 and 1.29

version 1.24, 2004/05/10 13:51:03 version 1.29, 2004/05/28 09:50:39
Line 284  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 361  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 391  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 435  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 516  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 527  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,showElements)          keys=self.barFromHash(hash,start=start)
                   
                   
         return keys          return keys
Line 553  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)
       start=splitted[startNr:order] 
         #print start          #print start
                 
         keys=self.barFromHash(hash,start=start)          keys=self.barFromHash(hash,start=start)
Line 611  def createPath(url1,url2): Line 631  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.24  
changed lines
  Added in v.1.29


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