| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php defined('BX_DOL') or die('hack attempt');
- /**
- * Copyright (c) UNA, Inc - https://una.io
- * MIT License - https://opensource.org/licenses/MIT
- *
- * @defgroup UnaBaseView UNA Base Representation Classes
- * @{
- */
- /**
- * System services related to Extended Search.
- *
- * @see BxDolSearchExtended
- */
- class BxBaseSearchExtendedServices extends BxDol
- {
- public function __construct()
- {
- parent::__construct();
- }
- public function serviceGetForm($aParams)
- {
- if(empty($aParams['object']))
- return '';
- $oSearch = BxDolSearchExtended::getObjectInstance($aParams['object']);
- if(!$oSearch || !$oSearch->isEnabled())
- return '';
- return $oSearch->getForm();
- }
- public function serviceGetResults($aParams)
- {
- if(empty($aParams['object']))
- return '';
- $oSearch = BxDolSearchExtended::getObjectInstance($aParams['object']);
- if(!$oSearch || !$oSearch->isEnabled())
- return '';
- $bShowEmpty = isset($aParams['show_empty']) && (bool)$aParams['show_empty'];
- $sResults = $oSearch->getResults();
- return !empty($sResults) ? $sResults : ($bShowEmpty ? MsgBox(_t('_Empty')) : '');
- }
- }
- /** @} */
|