BxAdsGridLicensesAdministration.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 Ads Ads
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxAdsGridLicensesAdministration extends BxTemplGrid
  12. {
  13. protected $_sModule;
  14. protected $_oModule;
  15. public function __construct ($aOptions, $oTemplate = false)
  16. {
  17. $this->_sModule = 'bx_ads';
  18. $this->_oModule = BxDolModule::getInstance($this->_sModule);
  19. if(!$oTemplate)
  20. $oTemplate = $this->_oModule->_oTemplate;
  21. parent::__construct ($aOptions, $oTemplate);
  22. $this->_sDefaultSortingOrder = 'DESC';
  23. $this->_aQueryReset = array($this->_aOptions['order_get_field'], $this->_aOptions['order_get_dir'], $this->_aOptions['paginate_get_start'], $this->_aOptions['paginate_get_per_page']);
  24. $iProfileId = bx_get_logged_profile_id();
  25. if($iProfileId !== false)
  26. $this->_aQueryAppend['profile_id'] = (int)$iProfileId;
  27. }
  28. protected function _getCellProfileId($mixedValue, $sKey, $aField, $aRow)
  29. {
  30. return parent::_getCellDefault($this->_oModule->_oTemplate->getProfileLink($mixedValue), $sKey, $aField, $aRow);
  31. }
  32. protected function _getCellEntry($mixedValue, $sKey, $aField, $aRow)
  33. {
  34. $CNF = &$this->_oModule->_oConfig->CNF;
  35. $mixedValue = $this->_oModule->_oTemplate->getEntryLink(array(
  36. $CNF['FIELD_ID'] => $aRow['entry_id'],
  37. $CNF['FIELD_TITLE'] => $mixedValue,
  38. ));
  39. return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
  40. }
  41. protected function _getCellAdded($mixedValue, $sKey, $aField, $aRow)
  42. {
  43. return parent::_getCellDefault(bx_time_js($mixedValue, BX_FORMAT_DATE, true), $sKey, $aField, $aRow);
  44. }
  45. }
  46. /** @} */