BxGlsrTemplate.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 Glossary Glossary
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. /*
  12. * Module representation.
  13. */
  14. class BxGlsrTemplate extends BxBaseModTextTemplate
  15. {
  16. /**
  17. * Constructor
  18. */
  19. function __construct(&$oConfig, &$oDb)
  20. {
  21. $this->MODULE = 'bx_glossary';
  22. parent::__construct($oConfig, $oDb);
  23. }
  24. /**
  25. * Use Gallery image for both because currently there is no Unit types with small thumbnails.
  26. */
  27. protected function getUnitThumbAndGallery ($aData)
  28. {
  29. list($sPhotoThumb, $sPhotoGallery) = parent::getUnitThumbAndGallery($aData);
  30. return array($sPhotoGallery, $sPhotoGallery);
  31. }
  32. function getAlphabeticalList($aLetterData, $sContentList)
  33. {
  34. $aVars = array();
  35. foreach ($aLetterData as $aLetter)
  36. array_push($aVars, array ('letter' => $aLetter['letter'], 'url' => $aLetter['url']));
  37. return $this->parseHtmlByName('alphabetical_list.html', array ('bx_repeat:items' => $aVars, 'content_list' => $sContentList));
  38. }
  39. function getAlphabeticalAnchor($sLetter)
  40. {
  41. return $this->parseHtmlByName('alphabetical_anchor.html', array ('letter' => $sLetter));
  42. }
  43. }
  44. /** @} */