Cheetah
ChBlogsCalendar.php
Go to the documentation of this file.
1 <?php
2 
8 ch_import ('ChTemplCalendar');
9 
11 {
12  var $sDynamicUrl = '';
13  var $iBlockID = 0;
15 
17  {
18  parent::__construct($iYear, $iMonth);
19  $this->oBlogsModule = &$oModule;
20  }
21 
35  function getData ()
36  {
37  $sStatus = 'approval';
38  if($this -> oBlogsModule -> isAllowedApprove()
39  || $this -> oBlogsModule -> isAllowedPostEdit(-1)
40  || $this -> oBlogsModule -> isAllowedPostDelete(-1) ) {
41 
42  $sStatus = '';
43  }
44 
45  return $this->oBlogsModule->_oDb->getBlogPostsByMonth($this->iYear
46  , $this->iMonth, $this->iNextYear, $this->iNextMonth, $sStatus);
47  }
48 
54  function getUnit(&$aData)
55  {
56  $iPostID = (int)$aData['PostID'];
57  $sPostUri = $aData['PostUri'];
58  $sName = $aData['PostCaption'];
59  $sUrl = $this->oBlogsModule->genUrl($iPostID, $sPostUri, 'entry');
60 
61  return <<<EOF
62 <div style="width:95%;">
63  <a title="{$sName}" href="{$sUrl}">{$sName}</a>
64 </div>
65 EOF;
66  }
67 
74  function getBaseUri ()
75  {
76  return $this->oBlogsModule->sHomeUrl . $this->oBlogsModule->_oConfig->sUserExFile . "?action=show_calendar&date=";
77  }
78 
79  function getBrowseUri ()
80  {
81  return $this->oBlogsModule->sHomeUrl . $this->oBlogsModule->_oConfig->sUserExFile . "?action=show_calendar_day&date=";
82  }
83 
84  function getEntriesNames ()
85  {
86  return array(_t('_ch_blog_single'), _t('_ch_blog_plural'));
87  }
88 
89  function getMonthUrl ($isNextMoths, $isMiniMode = false)
90  {
91  if ($isMiniMode && $this->iBlockID && $this->sDynamicUrl)
92  return "javascript:loadDynamicBlock('" . $this->iBlockID . "', '" . ch_append_url_params($this->sDynamicUrl, 'date=' . ($isNextMoths ? "{$this->iNextYear}/{$this->iNextMonth}" : "{$this->iPrevYear}/{$this->iPrevMonth}")) . "');";
93  else
94  return parent::getMonthUrl ($isNextMoths, $isMiniMode);
95  }
96 
98  {
99  $this->iBlockID = $iBlockID;
100  }
101 
102  function setDynamicUrl($s)
103  {
104  $this->sDynamicUrl = $s;
105  }
106 }
$oModule
if(! @isAdmin()) $oModule
Definition: admin.php:25
ChWsbCalendar\$iMonth
$iMonth
Definition: ChWsbCalendar.php:50
ChBlogsCalendar\getUnit
getUnit(&$aData)
Definition: ChBlogsCalendar.php:54
ChBlogsCalendar\getData
getData()
Definition: ChBlogsCalendar.php:35
ChBlogsCalendar\$sDynamicUrl
$sDynamicUrl
Definition: ChBlogsCalendar.php:12
ChBlogsCalendar\__construct
__construct($iYear, $iMonth, &$oModule)
Definition: ChBlogsCalendar.php:16
ChBlogsCalendar\setDynamicUrl
setDynamicUrl($s)
Definition: ChBlogsCalendar.php:102
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
$sUrl
$sUrl
Definition: cart.php:15
php
a
Filter ExtractStyleBlocks Scope FilterParam ExtractStyleBlocksScope DESCRIPTION< p > If you would like users to be able to define external but only allow them to specify CSS declarations for a specific node and prevent them from fiddling with other use this directive It accepts any valid CSS and will prepend this to any CSS declaration extracted from the document For if this directive is set to< code > selector< code > a
Definition: Filter.ExtractStyleBlocks.Scope.txt:15
ch_append_url_params
ch_append_url_params($sUrl, $mixedParams)
Definition: utils.inc.php:1697
ChBlogsCalendar
Definition: ChBlogsCalendar.php:11
_t
_t($key, $arg0="", $arg1="", $arg2="")
Definition: languages.inc.php:509
ChBlogsCalendar\getBrowseUri
getBrowseUri()
Definition: ChBlogsCalendar.php:79
$s
$s
Definition: embed.php:13
ChTemplCalendar
Definition: ChTemplCalendar.php:14
ChBlogsCalendar\$iBlockID
$iBlockID
Definition: ChBlogsCalendar.php:13
ChBlogsCalendar\$oBlogsModule
$oBlogsModule
Definition: ChBlogsCalendar.php:14
ChBlogsCalendar\getEntriesNames
getEntriesNames()
Definition: ChBlogsCalendar.php:84
ChBlogsCalendar\getMonthUrl
getMonthUrl($isNextMoths, $isMiniMode=false)
Definition: ChBlogsCalendar.php:89
ChWsbCalendar\$iYear
$iYear
Definition: ChWsbCalendar.php:50
$sName
$sName
Definition: ChWsbAdminTools.php:853
$sStatus
$sStatus
Definition: actions.inc.php:11
ChBlogsCalendar\setBlockId
setBlockId($iBlockID)
Definition: ChBlogsCalendar.php:97
ChBlogsCalendar\getBaseUri
getBaseUri()
Definition: ChBlogsCalendar.php:74