version 1.8, 2004/01/06 15:44:13
|
version 1.13, 2004/01/12 13:25:26
|
Line 208 class ImageCollection(Folder, Persistent
|
Line 208 class ImageCollection(Folder, Persistent
|
|
|
def nextImage(self,request,selected=None): |
def nextImage(self,request,selected=None): |
"""show nextimage""" |
"""show nextimage""" |
|
try: |
ids=self.show_thumbs() |
ids=self.show_thumbs() |
if request.SESSION.has_key("filename"): |
if request.SESSION.has_key("filename"): |
filename=request.SESSION["filename"] |
filename=request.SESSION["filename"] |
Line 225 class ImageCollection(Folder, Persistent
|
Line 226 class ImageCollection(Folder, Persistent
|
return "<a href=\""+self.REQUEST['URL1']+"/selection?filename="+ids[nr+1]+"\" target=\"_top\">next image</a>" |
return "<a href=\""+self.REQUEST['URL1']+"/selection?filename="+ids[nr+1]+"\" target=\"_top\">next image</a>" |
else: |
else: |
return "<a href=\""+self.REQUEST['URL1']+"?filename="+ids[nr+1]+"\" target=\"_top\">next image</a>" |
return "<a href=\""+self.REQUEST['URL1']+"?filename="+ids[nr+1]+"\" target=\"_top\">next image</a>" |
|
except: |
|
return "" |
|
|
def prevImage(self,request,selected=None): |
def prevImage(self,request,selected=None): |
"""show nextimage""" |
"""show nextimage""" |
#return self.getId() |
#return self.getId() |
|
try: |
ids=self.show_thumbs() |
ids=self.show_thumbs() |
if request.SESSION.has_key("filename"): |
if request.SESSION.has_key("filename"): |
filename=request.SESSION["filename"] |
filename=request.SESSION["filename"] |
Line 246 class ImageCollection(Folder, Persistent
|
Line 250 class ImageCollection(Folder, Persistent
|
return "<a href=\""+self.REQUEST['URL1']+"/selection?filename="+ids[nr-1]+"\" target=\"_top\">previous image</a>" |
return "<a href=\""+self.REQUEST['URL1']+"/selection?filename="+ids[nr-1]+"\" target=\"_top\">previous image</a>" |
else: |
else: |
return "<a href=\""+self.REQUEST['URL1']+"?filename="+ids[nr-1]+"\" target=\"_top\">previous image</a>" |
return "<a href=\""+self.REQUEST['URL1']+"?filename="+ids[nr-1]+"\" target=\"_top\">previous image</a>" |
|
except: |
|
return "" |
|
|
def meta_default(self,filename): |
def meta_default(self,filename): |
"""url der metadaten""" |
"""url der metadaten""" |
Line 400 class ImageCollection(Folder, Persistent
|
Line 406 class ImageCollection(Folder, Persistent
|
|
|
def firstSets(self,selected=None): |
def firstSets(self,selected=None): |
ids=self.show_thumbs() |
ids=self.show_thumbs() |
|
if ids: |
if selected: |
if selected: |
return "<a href=\""+self.REQUEST['URL1']+"/selection?filename="+ids[0]+"\" target=\"_top\">first sets</a>" |
return "<a href=\""+self.REQUEST['URL1']+"/selection?filename="+ids[0]+"\" target=\"_top\">first sets</a>" |
else: |
else: |
Line 407 class ImageCollection(Folder, Persistent
|
Line 414 class ImageCollection(Folder, Persistent
|
|
|
def lastSets(self,selected=None): |
def lastSets(self,selected=None): |
ids=self.show_thumbs() |
ids=self.show_thumbs() |
|
if ids: |
colRows=self.getColTimesRow() |
colRows=self.getColTimesRow() |
|
|
if colRows[1]: |
if colRows[1]: |
Line 428 class ImageCollection(Folder, Persistent
|
Line 436 class ImageCollection(Folder, Persistent
|
"""show nextimage""" |
"""show nextimage""" |
ids=self.show_thumbs() |
ids=self.show_thumbs() |
colRows=self.getColTimesRow() |
colRows=self.getColTimesRow() |
|
if ids: |
if colRows[1]: |
if colRows[1]: |
|
|
if self.REQUEST.SESSION.has_key("filename"): |
if self.REQUEST.SESSION.has_key("filename"): |
Line 455 class ImageCollection(Folder, Persistent
|
Line 464 class ImageCollection(Folder, Persistent
|
#return self.getId() |
#return self.getId() |
ids=self.show_thumbs() |
ids=self.show_thumbs() |
colRows=self.getColTimesRow() |
colRows=self.getColTimesRow() |
|
if ids: |
if colRows[1]: |
if colRows[1]: |
if self.REQUEST.SESSION.has_key("filename"): |
if self.REQUEST.SESSION.has_key("filename"): |
filename=self.REQUEST.SESSION["filename"] |
filename=self.REQUEST.SESSION["filename"] |
Line 466 class ImageCollection(Folder, Persistent
|
Line 476 class ImageCollection(Folder, Persistent
|
nr=0 |
nr=0 |
else: |
else: |
nr=0 |
nr=0 |
|
try: |
|
num=ids.index(filename) |
|
except: |
|
num=0 |
|
|
if ids.index(filename)==0: |
if num==0: |
return "" |
return "" |
else: |
else: |
if selected: |
if selected: |
Line 499 class ImageCollection(Folder, Persistent
|
Line 513 class ImageCollection(Folder, Persistent
|
def setColTimesRow(self,cols,rows): |
def setColTimesRow(self,cols,rows): |
"""set coltimes row""" |
"""set coltimes row""" |
RESPONSE=self.REQUEST.RESPONSE |
RESPONSE=self.REQUEST.RESPONSE |
|
if not rows: |
|
rows=None |
|
if rows=="": |
|
rows=None |
|
|
|
if rows: |
RESPONSE.setCookie("ImageViewerRows",rows) |
RESPONSE.setCookie("ImageViewerRows",rows) |
RESPONSE.setCookie("ImageViewerCols",cols) |
RESPONSE.setCookie("ImageViewerCols",cols) |
|
|
RESPONSE.redirect(self.REQUEST['URL1']+"/setDone") |
RESPONSE.redirect(self.REQUEST['URL1']+"/setDone") |
|
|
def getColTimesRow(self): |
def getColTimesRow(self): |
|
"""coltimesrow""" |
|
|
REQUEST=self.REQUEST |
REQUEST=self.REQUEST |
"""matrix""" |
"""matrix""" |
Line 519 class ImageCollection(Folder, Persistent
|
Line 539 class ImageCollection(Folder, Persistent
|
rows=None |
rows=None |
|
|
if REQUEST.cookies.has_key("ImageViewerCols"): |
if REQUEST.cookies.has_key("ImageViewerCols"): |
print "COLS",REQUEST.cookies["ImageViewerCols"] |
#print "COLS",REQUEST.cookies["ImageViewerCols"] |
cols=int(REQUEST.cookies["ImageViewerCols"]) |
cols=int(REQUEST.cookies["ImageViewerCols"]) |
else: |
else: |
cols=4 |
cols=4 |
print cols,rows |
|
|
idsnumber=len(self.show_thumbs()) |
|
if rows: |
|
if cols*rows >idsnumber: |
|
rows=int(idsnumber/cols)+1 |
return (cols,rows) |
return (cols,rows) |
|
|
|
|
Line 545 class ImageCollection(Folder, Persistent
|
Line 569 class ImageCollection(Folder, Persistent
|
print "NOR:",numberOfRows |
print "NOR:",numberOfRows |
|
|
if numberOfRows: |
if numberOfRows: |
|
try: |
startPic=idsAll.index(startId) |
startPic=idsAll.index(startId) |
endPic=startPic+numberOfColumns*numberOfRows |
endPic=startPic+numberOfColumns*numberOfRows |
ids=idsAll[startPic:endPic] |
ids=idsAll[startPic:endPic] |
|
except: |
|
ids=idsAll |
else: |
else: |
ids=idsAll |
ids=idsAll |
|
|