Пример #1
0
 def renderNextPrevYearControls(self, month,year):
     "render the urls needed for next and previous years"
     format = '<a href="%s?%s">%s</a>'
     currentUrl = self.REQUEST.URL
     queryString = self.REQUEST.environ.get('QUERY_STRING', '')
     
     query = utility.updateQueryString(queryString, {'year:int': year+1, 'month:int':month})
     nextYear = format % (currentUrl,query,'&gt;&gt;')
     
     query = utility.updateQueryString(queryString, {'year:int': year-1, 'month:int':month})
     prevYear = format % (currentUrl,query,'&lt;&lt;')
     return prevYear,nextYear
Пример #2
0
 def renderPreviousMonthControl(self, monthPreviousYear,monthPrevious):
     "render the urls needed for next and previous year and month"
     format = '<a href="%s?%s">%s</a>'
     currentUrl = self.REQUEST.URL
     queryString = self.REQUEST.environ.get('QUERY_STRING', '')
     query = utility.updateQueryString(queryString, {'year:int': monthPreviousYear, 'month:int':monthPrevious})
     return format % (currentUrl,query,'&lt;')
Пример #3
0
    def renderNextPrevYearControls(self, month, year):
        "render the urls needed for next and previous years"
        format = '<a href="%s?%s">%s</a>'
        currentUrl = self.REQUEST.URL
        queryString = self.REQUEST.environ.get('QUERY_STRING', '')

        query = utility.updateQueryString(queryString, {
            'year:int': year + 1,
            'month:int': month
        })
        nextYear = format % (currentUrl, query, '&gt;&gt;')

        query = utility.updateQueryString(queryString, {
            'year:int': year - 1,
            'month:int': month
        })
        prevYear = format % (currentUrl, query, '&lt;&lt;')
        return prevYear, nextYear
Пример #4
0
 def renderPreviousMonthControl(self, monthPreviousYear, monthPrevious):
     "render the urls needed for next and previous year and month"
     format = '<a href="%s?%s">%s</a>'
     currentUrl = self.REQUEST.URL
     queryString = self.REQUEST.environ.get('QUERY_STRING', '')
     query = utility.updateQueryString(queryString, {
         'year:int': monthPreviousYear,
         'month:int': monthPrevious
     })
     return format % (currentUrl, query, '&lt;')
Пример #5
0
 def setSelectedDocument(self, selected):
     "set the selected document to redirect to"
     baseURL = self.REQUEST.other['URL']
     queryString = self.REQUEST.environ.get('QUERY_STRING', '')
     if selected:
         url = baseURL + '?' + utility.updateQueryString(queryString, {'selectedDocument': selected})
     else:
         url = baseURL + '?' + queryString
     urlFrom = self.REQUEST.other.get('HTTP_REFERRER', '')
     if urlFrom != url:
         self.REQUEST.other['redirectTo'] = url