Cheetah
ChEventsCmts.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  $aPathInfo = pathinfo(__FILE__);
23  require_once ($aPathInfo['dirname'] . '/ChEventsSearchResult.php');
24  return (new ChEventsSearchResult())->getMain();
25  }
26 
27  function getBaseUrl()
28  {
29  $oMain = $this->getMain();
30  $aEntry = $oMain->_oDb->getEntryById($this->getId());
31  if(empty($aEntry) || !is_array($aEntry))
32  return '';
33 
34  return CH_WSB_URL_ROOT . $oMain->_oConfig->getBaseUri() . 'view/' . $aEntry['EntryUri'];
35  }
36 
37  function isPostReplyAllowed ($isPerformAction = false)
38  {
39  if (!parent::isPostReplyAllowed($isPerformAction))
40  return false;
41 
42  $oMain = $this->getMain();
43  $aEvent = $oMain->_oDb->getEntryByIdAndOwner($this->getId (), 0, true);
44  return $oMain->isAllowedComments($aEvent);
45  }
46 
47  function isEditAllowedAll ()
48  {
49  $oMain = $this->getMain();
50  $aEvent = $oMain->_oDb->getEntryByIdAndOwner($this->getId (), 0, true);
51  if ($oMain->isAllowedCreatorCommentsDeleteAndEdit ($aEvent))
52  return true;
53  return parent::isEditAllowedAll ();
54  }
55 
56  function isRemoveAllowedAll ()
57  {
58  $oMain = $this->getMain();
59  $aEvent = $oMain->_oDb->getEntryByIdAndOwner($this->getId (), 0, true);
60  if ($oMain->isAllowedCreatorCommentsDeleteAndEdit ($aEvent))
61  return true;
62  return parent::isRemoveAllowedAll ();
63  }
64 }
$aPathInfo
$aPathInfo
Definition: cmd.php:12
ChEventsCmts\__construct
__construct($sSystem, $iId)
Definition: ChEventsCmts.php:15
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
php
ChEventsCmts
Definition: ChEventsCmts.php:11
$iId
$iId
Definition: license.php:15
ChWsbCmts\getId
getId()
Definition: ChWsbCmts.php:228
ChEventsCmts\isEditAllowedAll
isEditAllowedAll()
Definition: ChEventsCmts.php:47
ChTemplCmtsView
Definition: ChTemplCmtsView.php:14
ChEventsCmts\getBaseUrl
getBaseUrl()
Definition: ChEventsCmts.php:27
ChEventsSearchResult
Definition: ChEventsSearchResult.php:11
ChEventsCmts\isPostReplyAllowed
isPostReplyAllowed($isPerformAction=false)
Definition: ChEventsCmts.php:37
ChEventsCmts\isRemoveAllowedAll
isRemoveAllowedAll()
Definition: ChEventsCmts.php:56
ChEventsCmts\getMain
getMain()
Definition: ChEventsCmts.php:20
empty
Attr AllowedRel this is empty
Definition: Attr.AllowedRel.txt:7