--- ECHO_content/ECHO_Nav.py 2005/10/26 16:14:29 1.61 +++ ECHO_content/ECHO_Nav.py 2005/10/28 17:49:45 1.64 @@ -99,16 +99,18 @@ class ECHO_ZCatalogElement(SimpleItem): return getattr(self,self.catalogId).uniqueValuesFor(self.field) def getNavList(self): - """ausgabe der treffer list für navigation""" + """ausgabe der treffer list fuer navigation""" records=self.getKeywordList() - + records=[x.encode('utf-8') for x in records] + records.sort() if not records: return [] else: ret=[] for record in records: + #print "RC",record #if record: # ret.append((record,self.baseUrl+urllib.quote(record))) @@ -125,9 +127,10 @@ def manage_addECHO_ZCatalogElementForm(s pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','AddECHO_ZCatalogElement.zpt')).__of__(self) return pt() -def manage_addECHO_ZCatalogElement(self,id,title,field,baseUrl,weight,contentType,RESPONSE=None): +def manage_addECHO_ZCatalogElement(self,id,title,field,catalogId,baseUrl,weight,contentType,RESPONSE=None): """Add an ECHO_ZCatalogelement""" - self._setObject(id,ECHO_ZCatalogElement(id,title,field,baseUrl,weight,contentType)) + + self._setObject(id,ECHO_ZCatalogElement(id,title,field,catalogId,baseUrl,weight,contentType)) if RESPONSE is not None: RESPONSE.redirect('manage_main') @@ -269,8 +272,12 @@ class ECHO_sqlElement(SimpleItem): """ausgabe der treffer list fuer navigation""" #naechste schritte sind trial and error, warum geht mal das eine mal das andere 2.3 / 2.4 ?? + try: - records=self.searchQuery(self.aq_parent,query=self.query) #python 2.4 version (??) + try: + records=self.ZSQLSimpleSearch(query=self.query) + except: + records=self.searchQuery(self.aq_parent,query=self.query) #python 2.4 version (??) except: records=self.searchQuery()#python 2.3 version(??) @@ -654,12 +661,17 @@ class ECHO_navigation(Folder): try: label=temp[x][1].getLabel() except: - label=temp[x][1].label + label=temp[x][1].label.encode('utf-8') else: label=temp[x][1].title.encode('utf-8') else: label=temp[x][1].title.encode('utf-8') + try: + label=label.encode('utf-8') + except: + label=label.decode('latin-1') + if location: loc=getattr(temp[x][1],'location','top')