BxBaseModTextSearchResult.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. if (!$aMenu)
  29. return false;
  30. return array_merge(
  31. array(
  32. array('name' => 'gallery', 'title' => _t('_sys_menu_title_gallery'), 'link' => $this->getCurrentUrl(array($this->sUnitViewParamName => 'gallery')), 'icon' => 'th'),
  33. array('name' => 'extended', 'title' => _t('_sys_menu_title_extended'), 'link' => $this->getCurrentUrl(array($this->sUnitViewParamName => 'extended')), 'icon' => 'list'),
  34. ),
  35. $aMenu
  36. );
  37. }
  38. function _getPseud ()
  39. {
  40. return array(
  41. 'id' => 'id',
  42. 'title' => 'title',
  43. 'text' => 'text',
  44. 'added' => 'added',
  45. 'author' => 'author',
  46. 'photo' => 'photo',
  47. );
  48. }
  49. }
  50. /** @} */