Cheetah
ChGroupsCmts.php
Go to the documentation of this file.
1 <?php
2 
8 ch_import('ChTemplCmtsView');
9 
11 {
15  function __construct($sSystem, $iId)
16  {
17  parent::__construct($sSystem, $iId);
18  }
19 
20  function getMain()
21  {
22  return ChWsbModule::getInstance('ChGroupsModule');
23  }
24 
25  function getBaseUrl()
26  {
27  $oMain = $this->getMain();
28  $aEntry = $oMain->_oDb->getEntryById($this->getId());
29  if(empty($aEntry) || !is_array($aEntry))
30  return '';
31 
32  return CH_WSB_URL_ROOT . $oMain->_oConfig->getBaseUri() . 'view/' . $aEntry['uri'];
33  }
34 
35  function isPostReplyAllowed ($isPerformAction = false)
36  {
37  if (!parent::isPostReplyAllowed($isPerformAction))
38  return false;
39 
40  $oMain = $this->getMain();
41  $aDataEntry = $oMain->_oDb->getEntryById($this->getId ());
42  return $oMain->isAllowedComments($aDataEntry);
43  }
44 
45  function isEditAllowedAll ()
46  {
47  $oMain = $this->getMain();
48  $aDataEntry = $oMain->_oDb->getEntryById($this->getId ());
49  if ($oMain->isAllowedCreatorCommentsDeleteAndEdit ($aDataEntry))
50  return true;
51  return parent::isEditAllowedAll ();
52  }
53 
54  function isRemoveAllowedAll ()
55  {
56  $oMain = $this->getMain();
57  $aDataEntry = $oMain->_oDb->getEntryById($this->getId ());
58  if ($oMain->isAllowedCreatorCommentsDeleteAndEdit ($aDataEntry))
59  return true;
60  return parent::isRemoveAllowedAll ();
61  }
62 }
ChGroupsCmts\isPostReplyAllowed
isPostReplyAllowed($isPerformAction=false)
Definition: ChGroupsCmts.php:35
ChGroupsCmts\__construct
__construct($sSystem, $iId)
Definition: ChGroupsCmts.php:15
ChWsbModule\getInstance
static getInstance($sClassName)
Definition: ChWsbModule.php:89
ChGroupsCmts\isEditAllowedAll
isEditAllowedAll()
Definition: ChGroupsCmts.php:45
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
php
$iId
$iId
Definition: license.php:15
ChWsbCmts\getId
getId()
Definition: ChWsbCmts.php:228
ChGroupsCmts\isRemoveAllowedAll
isRemoveAllowedAll()
Definition: ChGroupsCmts.php:54
ChTemplCmtsView
Definition: ChTemplCmtsView.php:14
ChGroupsCmts\getBaseUrl
getBaseUrl()
Definition: ChGroupsCmts.php:25
ChGroupsCmts
Definition: ChGroupsCmts.php:11
ChGroupsCmts\getMain
getMain()
Definition: ChGroupsCmts.php:20
empty
Attr AllowedRel this is empty
Definition: Attr.AllowedRel.txt:7