--- ECHO_content/ECHO_Nav.py 2004/05/10 15:27:32 1.25 +++ ECHO_content/ECHO_Nav.py 2004/06/07 13:37:26 1.31 @@ -179,7 +179,7 @@ class ECHO_pageTemplate(ZopePageTemplate 'html/ECHO_pageTemplateDefault.html') manage_options=ZopePageTemplate.manage_options+( - {'label':'Weight and Type','action':'changeECHO_pageTemplateWeightForm'}, + {'label':'Main Config','action':'changeECHO_pageTemplateWeightForm'}, ) def content_html(self): @@ -284,6 +284,10 @@ class ECHO_navigation(Folder): displayedMetaTypes=displayTypes + def getR(self): + """re""" + return self.REQUEST + def __init__(self,id,title,pathToHierarchy): """init""" self.id=id @@ -361,7 +365,7 @@ class ECHO_navigation(Folder): tempObj=self.pathToHierarchy[0:] tempObj=re.sub("/",".",tempObj) tempObj="self.aq_parent"+tempObj - + #print tempObj objtemp=eval(tempObj) obj=objtemp @@ -391,7 +395,7 @@ class ECHO_navigation(Folder): for z in temp[x][1].getNavList(): listNav.append((z[0],z[1],None)) else: - # add label fals existiert und nicht leer + # add label falls existiert und nicht leer if hasattr(temp[x][1],'label'): if not temp[x][1].label=='': label=temp[x][1].label.encode('utf-8') @@ -435,14 +439,14 @@ class ECHO_navigation(Folder): def isSelectedPath(self,item): """test is path is already selected""" - found=re.search("\?(.*)",item[1]) + found=re.search("\?(.*)/",item[1]) if found: temp=re.sub(" ","%20",found.group(0)) #print temp+"::"+self.REQUEST['QUERY_STRING'] if ("?"+self.REQUEST['QUERY_STRING'])==temp: return 1 - if re.search(item[1],self.REQUEST['URL']): + if re.search(item[1]+"/",self.REQUEST['URL']): return 1 else: return 0 @@ -516,6 +520,16 @@ class ECHO_navigation(Folder): 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): """Zweite Ordnung""" @@ -527,8 +541,12 @@ class ECHO_navigation(Folder): splitted=ult_temp.split("/") - - start=[splitted[2]] + #print "AU",self.absolute_url(),splitted + #start=[splitted[2]] #orig + startNr= self.startOfHierarchy(splitted) + + start=[splitted[startNr]] + #print start keys=self.barFromHash(hash,start=start) @@ -553,7 +571,10 @@ class ECHO_navigation(Folder): ## else: ## 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 keys=self.barFromHash(hash,start=start) @@ -611,6 +632,7 @@ def createPath(url1,url2): if temp2[0]==test: del temp2[0] + #print "CP:"+url1+"::"+url2+"::"+url1+"/"+string.join(temp2,"/") return url1+"/"+string.join(temp2,"/") def sortWeight(x,y):