Cheetah
modules
cheetah
news
classes
ChNewsModule.php
Go to the documentation of this file.
1
<?
php
2
8
ch_import
(
'ChWsbTextModule'
);
9
10
require_once(
'ChNewsCalendar.php'
);
11
require_once(
'ChNewsCmts.php'
);
12
require_once(
'ChNewsVoting.php'
);
13
require_once(
'ChNewsSearchResult.php'
);
14
require_once(
'ChNewsData.php'
);
15
116
class
ChNewsModule
extends
ChWsbTextModule
117
{
121
function
__construct
(
$aModule
)
122
{
123
parent::__construct(
$aModule
);
124
125
//--- Define Membership Actions ---//
126
defineMembershipActions
(array(
'news delete'
),
'ACTION_ID_'
);
127
}
128
132
function
serviceNewsRss
($iLength = 0,
$sType
=
'archive'
)
133
{
134
return
$this->
actionRss
($iLength,
$sType
);
135
}
136
140
function
actionGetNews
($sSampleType =
'all'
, $iStart = 0,
$iPerPage
= 0)
141
{
142
return
$this->
actionGetEntries
($sSampleType, $iStart,
$iPerPage
);
143
}
144
148
function
_createObjectCalendar
($iYear, $iMonth)
149
{
150
return
new
ChNewsCalendar
($iYear, $iMonth, $this->_oDb, $this->_oConfig);
151
}
152
function
_createObjectCmts
(
$iId
)
153
{
154
return
new
ChNewsCmts
($this->_oConfig->getCommentsSystemName(),
$iId
);
155
}
156
function
_createObjectVoting
(
$iId
)
157
{
158
return
new
ChNewsVoting
($this->_oConfig->getVotesSystemName(),
$iId
);
159
}
160
function
_isDeleteAllowed
($bPerform =
false
)
161
{
162
if
(!
isLogged
())
163
return
false
;
164
165
if
(
isAdmin
())
166
return
true
;
167
168
$aCheckResult =
checkAction
(
getLoggedId
(), ACTION_ID_NEWS_DELETE, $bPerform);
169
return
$aCheckResult[
CHECK_ACTION_RESULT
] ==
CHECK_ACTION_RESULT_ALLOWED
;
170
}
171
}
ChNewsModule\serviceNewsRss
serviceNewsRss($iLength=0, $sType='archive')
Definition:
ChNewsModule.php:132
ChWsbModule\isLogged
isLogged()
Definition:
ChWsbModule.php:113
CHECK_ACTION_RESULT_ALLOWED
const CHECK_ACTION_RESULT_ALLOWED
Definition:
membership_levels.inc.php:60
$aModule
$aModule
Definition:
classifieds.php:21
ChNewsModule
Definition:
ChNewsModule.php:117
ch_import
ch_import($sClassName, $aModule=array())
Definition:
utils.inc.php:1218
CHECK_ACTION_RESULT
const CHECK_ACTION_RESULT
Definition:
membership_levels.inc.php:54
php
$iId
$iId
Definition:
license.php:15
$iPerPage
else $iPerPage
Definition:
browse.php:61
isAdmin
isAdmin()
Definition:
index.php:649
ChWsbTextModule\actionGetEntries
actionGetEntries($sSampleType='all', $iStart=0, $iPerPage=0)
Definition:
ChWsbTextModule.php:460
ChNewsModule\_isDeleteAllowed
_isDeleteAllowed($bPerform=false)
Definition:
ChNewsModule.php:160
ChNewsModule\__construct
__construct($aModule)
Definition:
ChNewsModule.php:121
ChNewsCalendar
Definition:
ChNewsCalendar.php:11
ChNewsModule\_createObjectCmts
_createObjectCmts($iId)
Definition:
ChNewsModule.php:152
$sType
$sType
Definition:
actions.inc.php:11
getLoggedId
getLoggedId()
Definition:
profiles.inc.php:32
checkAction
checkAction($iMemberId, $actionID, $performAction=false, $iForcedProfID=0, $isCheckMemberStatus=true)
Definition:
membership_levels.inc.php:313
defineMembershipActions
defineMembershipActions($aActionsAll, $sPrefix='CH_')
Definition:
membership_levels.inc.php:744
ChNewsModule\_createObjectVoting
_createObjectVoting($iId)
Definition:
ChNewsModule.php:156
ChNewsModule\actionGetNews
actionGetNews($sSampleType='all', $iStart=0, $iPerPage=0)
Definition:
ChNewsModule.php:140
ChWsbTextModule
Definition:
ChWsbTextModule.php:22
ChNewsVoting
Definition:
ChNewsVoting.php:11
ChNewsCmts
Definition:
ChNewsCmts.php:11
ChWsbTextModule\actionRss
actionRss($iLength=0, $sType='archive')
Definition:
ChWsbTextModule.php:425
ChNewsModule\_createObjectCalendar
_createObjectCalendar($iYear, $iMonth)
Definition:
ChNewsModule.php:148
Generated by
1.8.20