Cheetah
Public Member Functions | Public Attributes | List of all members
ChWsbCalendar Class Reference
Inheritance diagram for ChWsbCalendar:
ChBaseCalendar ChTemplCalendar CategoriesCalendar ChAdsCalendar ChBlogsCalendar ChPollCalendar ChSitesCalendar ChWsbFilesCalendar ChWsbProfilesCalendar ChWsbTextCalendar ChWsbTwigCalendar TagsCalendar

Public Member Functions

 __construct ($iYear, $iMonth)
 
 _getWeekNames ($isMiniMode=false)
 
 _getCalendarGrid (&$aCalendarGrid)
 
 _getCalendar ()
 
 getTitle ()
 
 getData ()
 
 getUnit (&$aData)
 
 getBaseUri ()
 
 getBrowseUri ()
 
 getEntriesNames ()
 
 getMonthUrl ($isNextMoths, $isMiniMode=false)
 

Public Attributes

 $iYear
 
 $iMonth
 
 $iPrevYear
 
 $iPrevMonth
 
 $iNextYear
 
 $iNextMonth
 
 $iFirstWeekDay
 
 $iNumDaysInMonth
 
 $sMonthName
 
 $iWeekStart
 
 $iWeekEnd
 

Detailed Description

This work, "Cheetah - https://www.cheetahwsb.com", is a derivative of "Dolphin Pro V7.4.2" by BoonEx Pty Limited - https://www.boonex.com/, used under CC-BY. "Cheetah" is licensed under CC-BY by Dean J. Bassett Jr. CC-BY License - http://creativecommons.org/licenses/by/3.0/ Calendar for your module content

Related classes: ChBaseCalendar - calendar base representation ChTemplCalendar - custom template representation

To add calendar to your content you need to inherit this class and override the following methids: getEntriesNames () getData () getBaseUri () getBrowseUri ()

see each function documentation for more information.

Example of usage: After overriding this class and adding necessary methods use thje following code to disp;lay calendar: This code is called from module class:

function actionCalendar ($iYear = '', $iMonth = '') { ch_import ('Calendar', $this->_aModule); $oCalendar = ch_instance ($this->_aModule['class_prefix'] . 'Calendar', array ($iYear, $iMonth, $this->_oDb, $this->_oTemplate, $this->_oConfig)); echo $oCalendar->display(); }

Memberships/ACL: vote - ACTION_ID_VOTE

Alerts: this class don't risa any alert

Definition at line 48 of file ChWsbCalendar.php.

Constructor & Destructor Documentation

◆ __construct()

ChWsbCalendar::__construct (   $iYear,
  $iMonth 
)

Member Function Documentation

◆ _getCalendar()

ChWsbCalendar::_getCalendar ( )

Reimplemented in TagsCalendar, and CategoriesCalendar.

Definition at line 145 of file ChWsbCalendar.php.

◆ _getCalendarGrid()

ChWsbCalendar::_getCalendarGrid ( $aCalendarGrid)

Definition at line 119 of file ChWsbCalendar.php.

◆ _getWeekNames()

ChWsbCalendar::_getWeekNames (   $isMiniMode = false)

Definition at line 101 of file ChWsbCalendar.php.

◆ getBaseUri()

ChWsbCalendar::getBaseUri ( )

return base calendar url year and month will be added to this url automatically so if your base url is /m/some_module/calendar/, it will be transormed to /m/some_module/calendar/YEAR/MONTH, like /m/some_module/calendar/2009/3

Reimplemented in TagsCalendar, ChSitesCalendar, ChPollCalendar, ChBlogsCalendar, ChAdsCalendar, ChWsbTwigCalendar, ChWsbTextCalendar, ChWsbProfilesCalendar, ChWsbFilesCalendar, and CategoriesCalendar.

Definition at line 246 of file ChWsbCalendar.php.

◆ getBrowseUri()

ChWsbCalendar::getBrowseUri ( )

return browse entries url year and month and day will be added to this url automatically so if your base url is /m/some_module/browse/calendar/, it will be transormed to /m/some_module/browse/calendar/YEAR/MONTH/DAY, like /m/some_module/browse/calendar/2009/3/15

Reimplemented in TagsCalendar, ChSitesCalendar, ChPollCalendar, ChBlogsCalendar, ChAdsCalendar, ChWsbTwigCalendar, ChWsbTextCalendar, ChWsbProfilesCalendar, ChWsbFilesCalendar, and CategoriesCalendar.

Definition at line 258 of file ChWsbCalendar.php.

◆ getData()

ChWsbCalendar::getData ( )

return records for current month, there is mandatory field Day - a day for current row use the following class variables to pass to your database query $this->iYear, $this->iMonth, $this->iNextYear, $this->iNextMonth

for example:

return $db->getAll (" SELECT *, DAYOFMONTH(FROM_UNIXTIME(EventStart)) AS Day FROM my_table WHERE Date >= UNIX_TIMESTAMP('{$this->iYear}-{$this->iMonth}-1') AND Date < UNIX_TIMESTAMP('{$this->iNextYear}-{$this->iNextMonth}-1') AND Status = 'approved'");

Reimplemented in TagsCalendar, ChSitesCalendar, ChPollCalendar, ChBlogsCalendar, ChAdsCalendar, ChWsbTwigCalendar, ChWsbTextCalendar, ChWsbProfilesCalendar, ChWsbFilesCalendar, and CategoriesCalendar.

Definition at line 221 of file ChWsbCalendar.php.

◆ getEntriesNames()

ChWsbCalendar::getEntriesNames ( )

return entries names in single and plural forms, for example: ('event', 'events') or ('profile', 'profiles')

Reimplemented in TagsCalendar, ChStoreCalendar, ChSitesCalendar, ChPollCalendar, ChGroupsCalendar, ChEventsCalendar, ChBlogsCalendar, ChAdsCalendar, ChWsbTwigCalendar, ChWsbTextCalendar, ChWsbProfilesCalendar, ChWsbFilesCalendar, and CategoriesCalendar.

Definition at line 268 of file ChWsbCalendar.php.

◆ getMonthUrl()

ChWsbCalendar::getMonthUrl (   $isNextMoths,
  $isMiniMode = false 
)

return url for previous/next month

Reimplemented in ChBlogsCalendar, ChWsbTwigCalendar, ChWsbTextCalendar, and ChWsbFilesCalendar.

Definition at line 277 of file ChWsbCalendar.php.

◆ getTitle()

ChWsbCalendar::getTitle ( )

Definition at line 200 of file ChWsbCalendar.php.

◆ getUnit()

ChWsbCalendar::getUnit ( $aData)

deprecated

return html for data unit for some day, it is:

  • icon 32x32 with link if data have associated image
  • data title with link if data have no associated image

Reimplemented in ChBlogsCalendar, ChWsbTextCalendar, ChWsbProfilesCalendar, and ChWsbFilesCalendar.

Definition at line 234 of file ChWsbCalendar.php.

Member Data Documentation

◆ $iFirstWeekDay

ChWsbCalendar::$iFirstWeekDay

Definition at line 51 of file ChWsbCalendar.php.

◆ $iMonth

ChWsbCalendar::$iMonth

Definition at line 50 of file ChWsbCalendar.php.

◆ $iNextMonth

ChWsbCalendar::$iNextMonth

Definition at line 50 of file ChWsbCalendar.php.

◆ $iNextYear

ChWsbCalendar::$iNextYear

Definition at line 50 of file ChWsbCalendar.php.

◆ $iNumDaysInMonth

ChWsbCalendar::$iNumDaysInMonth

Definition at line 51 of file ChWsbCalendar.php.

◆ $iPrevMonth

ChWsbCalendar::$iPrevMonth

Definition at line 50 of file ChWsbCalendar.php.

◆ $iPrevYear

ChWsbCalendar::$iPrevYear

Definition at line 50 of file ChWsbCalendar.php.

◆ $iWeekEnd

ChWsbCalendar::$iWeekEnd

Definition at line 51 of file ChWsbCalendar.php.

◆ $iWeekStart

ChWsbCalendar::$iWeekStart

Definition at line 51 of file ChWsbCalendar.php.

◆ $iYear

ChWsbCalendar::$iYear

Definition at line 50 of file ChWsbCalendar.php.

◆ $sMonthName

ChWsbCalendar::$sMonthName

Definition at line 51 of file ChWsbCalendar.php.


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