Cheetah
ChWsbTwigCalendar.php
Go to the documentation of this file.
1 <?php
2 
8 ch_import ('ChTemplCalendar');
9 
14 {
15  var $oDb, $oConfig;
16 
18  {
19  parent::__construct($iYear, $iMonth);
20  $this->oDb = &$oDb;
21  $this->oConfig = &$oConfig;
22  }
23 
37  function getData ()
38  {
39  return $this->oDb->getEntriesByMonth ($this->iYear, $this->iMonth, $this->iNextYear, $this->iNextMonth);
40  }
41 
48  function getBaseUri ()
49  {
50  return CH_WSB_URL_ROOT . $this->oConfig->getBaseUri() . "calendar/";
51  }
52 
53  function getBrowseUri ()
54  {
55  return CH_WSB_URL_ROOT . $this->oConfig->getBaseUri() . "browse/calendar/";
56  }
57 
58  function getEntriesNames ()
59  {
60  // override this
61  }
62 
63  function getMonthUrl ($isNextMoths, $isMiniMode = false)
64  {
65  if ($isMiniMode && $this->iBlockID && $this->sDynamicUrl)
66  return "javascript:loadDynamicBlock('" . $this->iBlockID . "', '" . ch_append_url_params($this->sDynamicUrl, 'date=' . ($isNextMoths ? "{$this->iNextYear}/{$this->iNextMonth}" : "{$this->iPrevYear}/{$this->iPrevMonth}")) . "');";
67  else
68  return parent::getMonthUrl ($isNextMoths, $isMiniMode);
69  }
70 
71  function setBlockId($iBlockID)
72  {
73  $this->iBlockID = $iBlockID;
74  }
75 
76  function setDynamicUrl($s)
77  {
78  $this->sDynamicUrl = $s;
79  }
80 }
ChWsbTwigCalendar\getMonthUrl
getMonthUrl($isNextMoths, $isMiniMode=false)
Definition: ChWsbTwigCalendar.php:63
ChWsbCalendar\$iMonth
$iMonth
Definition: ChWsbCalendar.php:50
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
ChWsbTwigCalendar\getData
getData()
Definition: ChWsbTwigCalendar.php:37
php
ChWsbTwigCalendar
Definition: ChWsbTwigCalendar.php:14
ChWsbTwigCalendar\$oConfig
$oConfig
Definition: ChWsbTwigCalendar.php:15
ChWsbTwigCalendar\getBaseUri
getBaseUri()
Definition: ChWsbTwigCalendar.php:48
ChWsbTwigCalendar\$oDb
$oDb
Definition: ChWsbTwigCalendar.php:15
ChWsbTwigCalendar\setBlockId
setBlockId($iBlockID)
Definition: ChWsbTwigCalendar.php:71
ch_append_url_params
ch_append_url_params($sUrl, $mixedParams)
Definition: utils.inc.php:1697
ChWsbTwigCalendar\getBrowseUri
getBrowseUri()
Definition: ChWsbTwigCalendar.php:53
ChWsbTwigCalendar\getEntriesNames
getEntriesNames()
Definition: ChWsbTwigCalendar.php:58
ChWsbTwigCalendar\__construct
__construct($iYear, $iMonth, &$oDb, &$oConfig)
Definition: ChWsbTwigCalendar.php:17
$s
$s
Definition: embed.php:13
ChTemplCalendar
Definition: ChTemplCalendar.php:14
ChWsbCalendar\$iYear
$iYear
Definition: ChWsbCalendar.php:50
ChWsbTwigCalendar\setDynamicUrl
setDynamicUrl($s)
Definition: ChWsbTwigCalendar.php:76