diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2020-08-03 12:54:37 +0200 |
---|---|---|
committer | npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com> | 2020-08-03 11:26:03 +0000 |
commit | 1a1b3e20e470a945dd9f5fab1d99174b10cbb141 (patch) | |
tree | aacff8872bcfd47685e9a9fb3e5e3a423e498f59 /lib/private/TemplateLayout.php | |
parent | 4987fe9a51f0b889d2b99428c967014d95bb13ae (diff) | |
download | nextcloud-server-1a1b3e20e470a945dd9f5fab1d99174b10cbb141.tar.gz nextcloud-server-1a1b3e20e470a945dd9f5fab1d99174b10cbb141.zip |
Fix unified search
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
Diffstat (limited to 'lib/private/TemplateLayout.php')
-rw-r--r-- | lib/private/TemplateLayout.php | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index 69eb26ab8b2..87a4d7badc1 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -44,34 +44,40 @@ namespace OC; -use OC\AppFramework\Http\Request; +use OC\Search\SearchQuery; use OC\Template\JSCombiner; use OC\Template\JSConfigHelper; use OC\Template\SCSSCacher; use OCP\AppFramework\Http\TemplateResponse; use OCP\Defaults; +use OCP\IConfig; use OCP\IInitialStateService; use OCP\Support\Subscription\IRegistry; +use OCP\Util; class TemplateLayout extends \OC_Template { private static $versionHash = ''; - /** - * @var \OCP\IConfig - */ + /** @var IConfig */ private $config; + /** @var IInitialStateService */ + private $initialState; + /** * @param string $renderAs * @param string $appId application id */ public function __construct($renderAs, $appId = '') { - // yes - should be injected .... - $this->config = \OC::$server->getConfig(); + /** @var IConfig */ + $this->config = \OC::$server->get(IConfig::class); - if (\OCP\Util::isIE()) { - \OC_Util::addStyle('ie'); + /** @var IInitialStateService */ + $this->initialState = \OC::$server->get(InitialStateService::class); + + if (Util::isIE()) { + Util::addStyle('ie'); } // Decide which page we show @@ -83,6 +89,9 @@ class TemplateLayout extends \OC_Template { $this->assign('bodyid', 'body-user'); } + $this->initialState->provideInitialState('unified-search', 'limit-default', SearchQuery::LIMIT_DEFAULT); + Util::addScript('dist/unified-search', null, true); + // Add navigation entry $this->assign('application', ''); $this->assign('appid', $appId); @@ -240,10 +249,8 @@ class TemplateLayout extends \OC_Template { } } } - - /** @var InitialStateService $initialState */ - $initialState = \OC::$server->query(InitialStateService::class); - $this->assign('initialStates', $initialState->getInitialStates()); + + $this->assign('initialStates', $this->initialState->getInitialStates()); } /** |