BxTemplCmtsMenuUnitMeta.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 UnaTemplate UNA Template Classes
  7. * @{
  8. */
  9. /**
  10. * @see BxDolMenu
  11. */
  12. class BxTemplCmtsMenuUnitMeta extends BxBaseCmtsMenuUnitMeta
  13. {
  14. public function __construct ($aObject, $oTemplate = false)
  15. {
  16. parent::__construct ($aObject, $oTemplate);
  17. }
  18. protected function _getMenuItemAuthor($aItem)
  19. {
  20. list($sAuthorName, $sAuthorLink, $sAuthorIcon, $sAuthorUnit, $sAuthorBadges) = $this->_oCmts->getAuthorInfo($this->_aCmt['cmt_author_id']);
  21. $sResult = '';
  22. if(!empty($sAuthorLink))
  23. $sResult = $this->getUnitMetaItemLink($sAuthorName, array(
  24. 'href' => $sAuthorLink,
  25. 'class' => $this->_sStylePrefix . '-username bx-def-font-author whitespace-nowrap hover:underline',
  26. 'title' => bx_html_attribute($sAuthorName),
  27. )). $sAuthorBadges;
  28. else
  29. $sResult = $this->getUnitMetaItemText($sAuthorName, array(
  30. 'class' => $this->_sStylePrefix . '-username bx-def-font-author whitespace-nowrap'
  31. )). $sAuthorBadges;
  32. return $sResult;
  33. }
  34. }
  35. /** @} */