BxDolGridConnectionOut.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 UnaCore UNA Core
  7. * @{
  8. */
  9. /*
  10. * Outcoming connections. A profile connects another profiles.
  11. */
  12. class BxDolGridConnectionOut extends BxDolGridConnectionIn
  13. {
  14. public function __construct ($aOptions, $oTemplate = false)
  15. {
  16. parent::__construct ($aOptions, $oTemplate);
  17. $this->_sConnectionMethod = 'getConnectedContentAsSQLParts';
  18. }
  19. protected function _getActionDelete ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
  20. {
  21. if (!isLogged() || !$this->_bOwner)
  22. return '';
  23. return parent::_getActionDefault ($sType, $sKey, $a, $isSmall, $isDisabled, $aRow);
  24. }
  25. protected function _delete ($mixedId)
  26. {
  27. list($iId, $iViewedId) = $this->_prepareIds();
  28. if(!$this->_oConnection->isConnected($iViewedId, $iId))
  29. return true;
  30. return $this->_oConnection->removeConnection($iViewedId, $iId);
  31. }
  32. }
  33. /** @} */