File tree 4 files changed +85
-104
lines changed
assets/components/simplesearch
core/components/simplesearch/src
4 files changed +85
-104
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ description: >-
5
5
Evolution (minus the ajax). Only searches Resources; does not search dynamic
6
6
content.
7
7
author : modxcms
8
- version : 3.0.0-alpha
8
+ version : 3.0.0-beta
9
9
chunks :
10
10
- name : SearchForm
11
11
file : searchform.chunk.tpl
@@ -289,7 +289,7 @@ snippets:
289
289
lexicon : simplesearch:properties
290
290
systemSettings :
291
291
- key : driver_class
292
- value : \SimpleSearch\Driver\SimpleSearchDriverBasic
292
+ value : ' '
293
293
area : Drivers
294
294
- key : autosuggest_tv
295
295
value : simpleSearchAutoSuggestions
Original file line number Diff line number Diff line change 1
-
2
-
3
1
<?php
4
- /**
5
- * @var \Teleport\Transport\Transport $transport
6
- * @var array $object
7
- * @var array $options
8
- */
9
-
10
- switch ($ options [xPDOTransport::PACKAGE_ACTION ]) {
11
- case xPDOTransport::ACTION_UPGRADE :
12
- /** @var modX $modx */
13
- $ modx =& $ transport ->xpdo ;
14
2
15
- /** @var \MODX\Revolution\modSystemSetting $ss */
16
- $ ss = $ modx ->getObject (\MODX \Revolution \modSystemSetting::class, ['key ' => 'simplesearch.driver_class ' ]);
17
- if ($ ss && $ ss ->value === 'SimpleSearchDriverBasic ' ) {
18
- $ ss ->set ('value ' , '\SimpleSearch\Driver\SimpleSearchDriverBasic ' );
19
- $ ss ->save ();
20
- }
3
+ use MODX \Revolution \modSystemSetting ;
21
4
22
- break ;
5
+ /** @var array $options */
6
+ if ($ options [xPDOTransport::PACKAGE_ACTION ] === xPDOTransport::ACTION_UPGRADE ) {
7
+ /** @var xPDOTransport $transport */
8
+ /** @var modSystemSetting $setting */
9
+ $ setting = $ transport ->xpdo ->getObject (modSystemSetting::class, ['key ' => 'simplesearch.driver_class ' ]);
10
+ if ($ setting && $ setting ->value === 'SimpleSearchDriverBasic ' ) {
11
+ $ setting ->set ('value ' , '' );
12
+ $ setting ->save ();
13
+ }
23
14
}
24
15
25
16
return true ;
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
- require_once dirname (dirname (dirname (__DIR__ ))) . '/config.core.php ' ;
3
+ /** @var \MODX\Revolution\modX $modx */
4
+ require_once dirname (__DIR__ , 3 ) . '/config.core.php ' ;
4
5
require_once MODX_CORE_PATH . 'config/ ' . MODX_CONFIG_KEY . '.inc.php ' ;
5
6
require_once MODX_CONNECTORS_PATH . 'index.php ' ;
6
7
8
+ use SimpleSearch \Processors \Web \AutoSuggestions ;
7
9
use SimpleSearch \SimpleSearch ;
8
10
9
11
$ webActions = [
10
- 'web/autosuggestions '
12
+ 'web/autosuggestions ' => AutoSuggestions::class,
11
13
];
12
14
13
- if (!empty ($ _REQUEST ['action ' ]) && in_array ($ _REQUEST ['action ' ], $ webActions )) {
15
+ if (!empty ($ _REQUEST ['action ' ]) && array_key_exists ($ _REQUEST ['action ' ], $ webActions )) {
14
16
define ('MODX_REQP ' , false );
15
- }
16
17
17
- if (in_array ($ _REQUEST ['action ' ], $ webActions , true )) {
18
18
if ($ modx ->user ->hasSessionContext ($ modx ->context ->get ('key ' ))) {
19
19
$ _SERVER ['HTTP_MODAUTH ' ] = $ _SESSION ["modx. {$ modx ->context ->get ('key ' )}.user.token " ];
20
20
} else {
23
23
}
24
24
25
25
$ _REQUEST ['HTTP_MODAUTH ' ] = $ _SERVER ['HTTP_MODAUTH ' ];
26
+ $ _REQUEST ['action ' ] = $ webActions [$ _REQUEST ['action ' ]];
26
27
}
27
28
28
29
$ instance = $ modx ->services ->get ('simplesearch ' );
29
30
if ($ instance instanceof SimpleSearch) {
30
31
$ modx ->request ->handleRequest ([
31
32
'processors_path ' => $ instance ->config ['processors_path ' ],
32
- 'location ' => ''
33
+ 'location ' => '' ,
33
34
]);
34
35
}
You can’t perform that action at this time.
0 commit comments