Cheetah
ChStoreCmts.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'] . '/ChStoreSearchResult.php');
24  return (new ChStoreSearchResult())->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['uri'];
35  }
36 
37  function isPostReplyAllowed ($isPerformAction = false)
38  {
39  if (!parent::isPostReplyAllowed($isPerformAction))
40  return false;
41 
42  $oMain = $this->getMain();
43  $aDataEntry = $oMain->_oDb->getEntryById($this->getId ());
44  return $oMain->isAllowedComments($aDataEntry);
45  }
46 
47  function isEditAllowedAll ()
48  {
49  $oMain = $this->getMain();
50  $aDataEntry = $oMain->_oDb->getEntryById($this->getId ());
51  if ($oMain->isAllowedCreatorCommentsDeleteAndEdit ($aDataEntry))
52  return true;
53  return parent::isEditAllowedAll ();
54  }
55 
56  function isRemoveAllowedAll ()
57  {
58  $oMain = $this->getMain();
59  $aDataEntry = $oMain->_oDb->getEntryById($this->getId ());
60  if ($oMain->isAllowedCreatorCommentsDeleteAndEdit ($aDataEntry))
61  return true;
62  return parent::isRemoveAllowedAll ();
63  }
64 }
ChStoreCmts\isEditAllowedAll
isEditAllowedAll()
Definition: ChStoreCmts.php:47
$aPathInfo
$aPathInfo
Definition: cmd.php:12
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
ChStoreCmts\getMain
getMain()
Definition: ChStoreCmts.php:20
ChStoreCmts\getBaseUrl
getBaseUrl()
Definition: ChStoreCmts.php:27
ChStoreCmts
Definition: ChStoreCmts.php:11
ChTemplCmtsView
Definition: ChTemplCmtsView.php:14
ChStoreSearchResult
Definition: ChStoreSearchResult.php:11
ChStoreCmts\isRemoveAllowedAll
isRemoveAllowedAll()
Definition: ChStoreCmts.php:56
ChStoreCmts\__construct
__construct($sSystem, $iId)
Definition: ChStoreCmts.php:15
empty
Attr AllowedRel this is empty
Definition: Attr.AllowedRel.txt:7
ChStoreCmts\isPostReplyAllowed
isPostReplyAllowed($isPerformAction=false)
Definition: ChStoreCmts.php:37