def sidebar2(self, currentfolder): # JJW 10/18/07 ses = currentfolder.session result = '' foldlist = [] for fold in self.__dict__.values(): if type(fold) is OFS.Folder.Folder: foldlist.append(fold) foldlist.sort(comparesortorder) for fold in foldlist: url = updater.sesurl(ses, self.REQUEST, 'products/' + urllib.quote(fold.id), 1) result += li(link(url, fold.id)) if fold.id == currentfolder.id: doclist = [] for doc in fold.__dict__.values(): if type(doc) is OFS.DTMLDocument.DTMLDocument: doclist.append(doc) doclist.sort(comparesortorder) for doc in doclist: url = updater.sesurl( ses, self.REQUEST, 'products/' + urllib.quote(fold.id) + '/config?sku=' + doc.id(), 1) #url = ses.url (urllib.quote (fold.id) + '/config?sku=' + doc.id()) result += li(link(url, 'eRacks/' + doc.id()), cls='li2') return result
def django_cart_box (self): carturl = sesurl (self.session, self.REQUEST, 'cart', 1) checkouturl = sesurl (self.session, self.REQUEST, 'cart', 2) (totqty, grandtot) = cartcontents (self) if not totqty: return '' return TagStream() \ .div (cls="box xsmall center") \ .div('Your eRacks cart', cls="boxtitle small") \ .img (src='/images/cart', alt='Shopping Cart Image') \ .a(' %i item%s $%8.2f total' % (totqty, 's'*int(totqty!=1), grandtot), href=carturl).br \ .a ('View Cart', href=carturl) \ .span (' · ') \ .a ('Checkout', href=checkouturl) \ .render()
def sidebar(self, currentfolder): #images = getimages (self) ses = currentfolder.session result = '<table width="100%" border="0" cellpadding="0" cellspacing="0">\n' foldlist = [] for fold in self.__dict__.values(): if type(fold) is OFS.Folder.Folder: foldlist.append(fold) foldlist.sort(comparesortorder) for fold in foldlist: url = updater.sesurl(ses, self.REQUEST, 'products/' + urllib.quote(fold.id), 1) result = result + tr( td('· ' + link(url, fontb(1, fold.id)))) # td (link (url, img (self, 'blueball'))) + \ if fold.id == currentfolder.id: doclist = [] for doc in fold.__dict__.values(): if type(doc) is OFS.DTMLDocument.DTMLDocument: doclist.append(doc) doclist.sort(comparesortorder) result = result + '<tr><td>' for doc in doclist: url = updater.sesurl( ses, self.REQUEST, 'products/' + urllib.quote(fold.id) + '/config?sku=' + doc.id(), 1) #url = ses.url (urllib.quote (fold.id) + '/config?sku=' + doc.id()) result = result + ' ' + link( url, font(1, 'eRacks/' + doc.id())) + '<br>' result = result + '</td></tr>' result = result + '</table>' return result
def sidebar (self, currentfolder): #images = getimages (self) ses = currentfolder.session result = '<table width="100%" border="0" cellpadding="0" cellspacing="0">\n' foldlist = [] for fold in self.__dict__.values(): if type (fold) is OFS.Folder.Folder: foldlist.append (fold) foldlist.sort (comparesortorder) for fold in foldlist: url = updater.sesurl (ses, self.REQUEST, 'products/' + urllib.quote (fold.id), 1) result = result + tr (td (' · ' + link (url, fontb (1, fold.id)) )) # td (link (url, img (self, 'blueball'))) + \ if fold.id == currentfolder.id: doclist = [] for doc in fold.__dict__.values(): if type (doc) is OFS.DTMLDocument.DTMLDocument: doclist.append (doc) doclist.sort (comparesortorder) result = result + '<tr><td>' for doc in doclist: url = updater.sesurl (ses, self.REQUEST, 'products/' + urllib.quote (fold.id) + '/config?sku=' + doc.id(), 1) #url = ses.url (urllib.quote (fold.id) + '/config?sku=' + doc.id()) result = result + ' ' + link (url, font (1,'eRacks/'+ doc.id())) + '<br>' result = result + '</td></tr>' result = result + '</table>' return result
def surl(url, flag=0, self=self): # self.session.url return updater.sesurl(self.session, self.REQUEST, url, flag)
def surl (url, flag=0, self=self): # self.session.url return updater.sesurl (self.session, self.REQUEST, url, flag)