Back to index

plone3  3.1.7
Public Member Functions
CMFCalendar.browser.calendartool.CalendarBoxView Class Reference
Inheritance diagram for CMFCalendar.browser.calendartool.CalendarBoxView:
Inheritance graph
[legend]
Collaboration diagram for CMFCalendar.browser.calendartool.CalendarBoxView:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def getMonthAndYear
def getNextMonthLink
def getPreviousMonthLink
def getDaysClass

Detailed Description

Definition at line 107 of file calendartool.py.


Member Function Documentation

def CMFCalendar.browser.calendartool.CalendarBoxView.getDaysClass (   self,
  day,
  month,
  year,
  event = None 
)
Determine the CSS class to use for the given day

Definition at line 172 of file calendartool.py.

00172 
00173     def getDaysClass(self, day, month, year, event=None):
00174         """ Determine the CSS class to use for the given day
00175         """
00176         current = DateTime()
00177 
00178         if ( current.year()==year and
00179              current.month()==month and
00180              current.day()==int(day) ):
00181             if event:
00182                 return 'todayevent'
00183             else:
00184                 return 'todaynoevent'
00185 
00186         if event:
00187             return 'event'
00188         else:
00189             return ''
Retrieve month/year tuple

Definition at line 112 of file calendartool.py.

00112 
00113     def getMonthAndYear(self):
00114         """ Retrieve month/year tuple
00115         """
00116         caltool = self._getTool('portal_calendar')
00117         current = DateTime()
00118         session = None
00119 
00120         # First priority goes to the data in the request
00121         year = self.request.get('year', None)
00122         month = self.request.get('month', None)
00123 
00124         # Next get the data from the SESSION
00125         if caltool.getUseSession():
00126             session = self.request.get('SESSION', None)
00127             if session:
00128                 if not year:
00129                     year = session.get('calendar_year', None)
00130                 if not month:
00131                     month = session.get('calendar_month', None)
00132 
00133         # Last resort to today
00134         if not year:
00135             year = current.year()
00136         if not month:
00137             month = current.month()
00138 
00139         # Then store the results in the session for next time
00140         if session:
00141             session.set('calendar_year', year)
00142             session.set('calendar_month', month)
00143 
00144         # Finally return the results
00145         return (year, month)

Here is the call graph for this function:

def CMFCalendar.browser.calendartool.CalendarBoxView.getNextMonthLink (   self,
  base_url,
  month,
  year 
)
Return URL for the next month link

Definition at line 146 of file calendartool.py.

00146 
00147     def getNextMonthLink(self, base_url, month, year):
00148         """ Return URL for the next month link
00149         """
00150         caltool = self._getTool('portal_calendar')
00151         nextMonthTime = caltool.getNextMonth(month, year)
00152 
00153         x = '%s?month:int=%d&year:int=%d' % ( base_url
00154                                             , nextMonthTime.month()
00155                                             , nextMonthTime.year()
00156                                             )
00157 
00158         return x

Here is the call graph for this function:

def CMFCalendar.browser.calendartool.CalendarBoxView.getPreviousMonthLink (   self,
  base_url,
  month,
  year 
)
Return URL for the previous month link

Definition at line 159 of file calendartool.py.

00159 
00160     def getPreviousMonthLink(self, base_url, month, year):
00161         """ Return URL for the previous month link
00162         """
00163         caltool = self._getTool('portal_calendar')
00164         prevMonthTime = caltool.getPreviousMonth(month, year)
00165 
00166         x = '%s?month:int=%d&year:int=%d' % ( base_url
00167                                             , prevMonthTime.month()
00168                                             , prevMonthTime.year()
00169                                             )
00170 
00171         return x

Here is the call graph for this function:


The documentation for this class was generated from the following file: