BxTimelineGridMute.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup Timeline Timeline
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxTimelineGridMute extends BxDolGridConnections
  12. {
  13. protected $_sModule;
  14. protected $_oModule;
  15. public function __construct ($aOptions, $oTemplate = false)
  16. {
  17. parent::__construct ($aOptions, $oTemplate);
  18. $this->_sModule = 'bx_timeline';
  19. $this->_oModule = BxDolModule::getInstance($this->_sModule);
  20. $this->_sObjectConnections = $this->_oModule->_oConfig->getObject('grid_mute');
  21. }
  22. public function init($bForceInit = false)
  23. {
  24. if(!parent::init($bForceInit))
  25. return false;
  26. $aSQLParts = $this->_oConnection->getConnectedContentAsSQLParts('p', 'id', $this->_oProfile->id());
  27. $this->addMarkers(array(
  28. 'join_connections' => $aSQLParts['join']
  29. ));
  30. return true;
  31. }
  32. protected function _getCellInfo ($mixedValue, $sKey, $aField, $aRow)
  33. {
  34. return parent::_getCellDefault(bx_time_js($aRow['added'], BX_FORMAT_DATE, true), $sKey, $aField, $aRow);
  35. }
  36. protected function _delete ($mixedId)
  37. {
  38. if(!$this->_bOwner)
  39. return false;
  40. if(!is_array($mixedId))
  41. $mixedId = array($mixedId);
  42. $iProfileId = $this->_oProfile->id();
  43. foreach($mixedId as $iId)
  44. if($this->_oConnection->isConnected($iProfileId, $iId))
  45. $this->_oConnection->removeConnection($iProfileId, $iId);
  46. return true;
  47. }
  48. }
  49. /** @} */