BxBaseStudioAuditGrid.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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 UnaView UNA Studio Representation classes
  7. * @ingroup UnaStudio
  8. * @{
  9. */
  10. class BxBaseStudioAuditGrid extends BxDolStudioAuditGrid
  11. {
  12. function __construct($aOptions, $oTemplate = false)
  13. {
  14. parent::__construct($aOptions, $oTemplate);
  15. }
  16. protected function _getCellAdded($mixedValue, $sKey, $aField, $aRow)
  17. {
  18. return parent::_getCellDefault(bx_time_js($mixedValue), $sKey, $aField, $aRow);
  19. }
  20. protected function _getCellAction ($mixedValue, $sKey, $aField, $aRow)
  21. {
  22. return parent::_getCellDefault(_t($aRow['action_lang_key'], $aRow['action_lang_key_params']), $sKey, $aField, $aRow);
  23. }
  24. protected function _getCellContent ($mixedValue, $sKey, $aField, $aRow)
  25. {
  26. $mixedValue = '';
  27. if ($aRow['content_id'] > 0 && $aRow['content_info_object'] != ''){
  28. $oContentInfo = BxDolContentInfo::getObjectInstance($aRow['content_info_object']);
  29. if ($oContentInfo){
  30. $sTitle = $oContentInfo->getContentTitle($aRow['content_id']);
  31. if ($sTitle != ''){
  32. $mixedValue = $this->_oTemplate->parseHtmlByName('account_link.html', array(
  33. 'href' => $oContentInfo->getContentLink($aRow['content_id']),
  34. 'title' => $sTitle,
  35. 'content' => $sTitle,
  36. 'class' => 'bx-def-font-grayed'
  37. ));
  38. }
  39. }
  40. }
  41. if ($mixedValue == ''){
  42. $mixedValue = $aRow['content_title'];
  43. }
  44. return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
  45. }
  46. protected function _getCellContext ($mixedValue, $sKey, $aField, $aRow)
  47. {
  48. if ($aRow['context_profile_id'] > 0){
  49. $oProfile = BxDolProfile::getInstance($aRow['context_profile_id']);
  50. if ($oProfile){
  51. $sProfile = $oProfile->getDisplayName();
  52. $mixedValue = $this->_oTemplate->parseHtmlByName('account_link.html', array(
  53. 'href' => $oProfile->getUrl(),
  54. 'title' => $sProfile,
  55. 'content' => $sProfile,
  56. 'class' => 'bx-def-font-grayed'
  57. ));
  58. }
  59. else{
  60. $mixedValue = $aRow['context_profile_title'];
  61. }
  62. }
  63. else{
  64. $mixedValue = '';
  65. }
  66. return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
  67. }
  68. protected function _getCellModule ($mixedValue, $sKey, $aField, $aRow)
  69. {
  70. $oModule = bxDolModule::getInstance($aRow['content_module']);
  71. if($oModule instanceof iBxDolContentInfoService){
  72. $mixedValue = $oModule->_aModule['title'];
  73. }
  74. return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
  75. }
  76. protected function _getCellProfile ($mixedValue, $sKey, $aField, $aRow)
  77. {
  78. if ($aRow['profile_id'] > 0){
  79. $oProfile = BxDolProfile::getInstance($aRow['profile_id']);
  80. if ($oProfile){
  81. $sProfile = $oProfile->getDisplayName();
  82. $mixedValue = $this->_oTemplate->parseHtmlByName('account_link.html', array(
  83. 'href' => $oProfile->getUrl(),
  84. 'title' => $sProfile,
  85. 'content' => $sProfile,
  86. 'class' => 'bx-def-font-grayed'
  87. ));
  88. }
  89. else{
  90. $mixedValue = 'deleted';
  91. }
  92. }
  93. else{
  94. $mixedValue = '';
  95. }
  96. return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
  97. }
  98. }
  99. /** @} */