BxBaseModTextSearchResult.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  4. * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  5. *
  6. * @defgroup BaseText Base classes for text modules
  7. * @ingroup DolphinModules
  8. *
  9. * @{
  10. */
  11. bx_import('BxBaseModGeneralSearchResult');
  12. class BxBaseModTextSearchResult extends BxBaseModGeneralSearchResult
  13. {
  14. protected $aUnitViews = array('extended' => 'unit.html', 'gallery' => 'unit_gallery.html');
  15. protected $sUnitViewDefault = 'gallery';
  16. protected $sUnitViewParamName = 'unit_view';
  17. function __construct($sMode = '', $aParams = array())
  18. {
  19. parent::__construct($sMode, $aParams);
  20. $this->aGetParams = array($this->sUnitViewParamName);
  21. $this->sUnitTemplate = $this->aUnitViews[$this->sUnitViewDefault];
  22. if (isset($this->aUnitViews[bx_get($this->sUnitViewParamName)]))
  23. $this->sUnitTemplate = $this->aUnitViews[bx_get($this->sUnitViewParamName)];
  24. }
  25. function getDesignBoxMenu ()
  26. {
  27. $aMenu = parent::getDesignBoxMenu ();
  28. return array_merge(
  29. array(
  30. array('name' => 'gallery', 'title' => _t('_sys_menu_title_gallery'), 'link' => $this->getCurrentUrl(array($this->sUnitViewParamName => 'gallery')), 'icon' => 'th'),
  31. array('name' => 'extended', 'title' => _t('_sys_menu_title_extended'), 'link' => $this->getCurrentUrl(array($this->sUnitViewParamName => 'extended')), 'icon' => 'list'),
  32. ),
  33. $aMenu
  34. );
  35. }
  36. function _getPseud ()
  37. {
  38. return array(
  39. 'id' => 'id',
  40. 'title' => 'title',
  41. 'text' => 'text',
  42. 'added' => 'added',
  43. 'author' => 'author',
  44. 'photo' => 'photo',
  45. );
  46. }
  47. }
  48. /** @} */