Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Open
LU API
Commits
154fe430
Commit
154fe430
authored
Sep 28, 2020
by
Dainis Abols
Browse files
Added Added Exclude list for search options
parent
0ad046b2
Changes
5
Hide whitespace changes
Inline
Side-by-side
cli/loadActivePages.php
View file @
154fe430
...
...
@@ -57,6 +57,9 @@ class loadActivePages
// Open connection
$this
->
mysqli
=
new
mysqli
(
$config
[
'DB'
][
'Connections'
][
'Default'
][
'host'
],
$config
[
'DB'
][
'Connections'
][
'Default'
][
'user'
],
$config
[
'DB'
][
'Connections'
][
'Default'
][
'password'
],
$config
[
'DB'
][
'Connections'
][
'Default'
][
'dbname'
]);
// Load excluded list
$this
->
excludedUids
=
explode
(
","
,
$config
[
'EXTENSIONS'
][
'lu_api'
][
'solrDatabase'
][
'searchExcludedUIds'
]);
}
/**
...
...
@@ -71,8 +74,12 @@ class loadActivePages
if
(
$result
=
$this
->
executeQuery
(
$query
))
{
while
(
$row
=
$result
->
fetch_object
())
{
if
(
$this
->
findValidTree
(
$row
->
pid
))
{
$this
->
validUids
[]
=
$row
->
uid
;
// Deny, if in exluded list
if
(
!
in_array
(
$row
->
uid
,
$this
->
excludedUids
))
{
// Check if valid parent
if
(
$this
->
findValidTree
(
$row
->
pid
))
{
$this
->
validUids
[]
=
$row
->
uid
;
}
}
}
}
...
...
@@ -83,8 +90,12 @@ class loadActivePages
*/
public
function
findValidTree
(
$pid
)
{
// Deny, if in exluded list
if
(
in_array
(
$pid
,
$this
->
excludedUids
))
{
return
false
;
}
// Check if valid parent
$query
=
"SELECT pid FROM pages WHERE uid =
{
$pid
}
AND (`starttime` = 0 OR UNIX_TIMESTAMP() >= `starttime`) AND (`endtime` = 0 OR `endtime` >= UNIX_TIMESTAMP()) AND `hidden` = 0 AND `deleted` = 0"
;
if
(
$result
=
$this
->
executeQuery
(
$query
))
{
while
(
$row
=
$result
->
fetch_object
())
{
if
(
$row
->
pid
==
0
||
$this
->
findValidTree
(
$row
->
pid
))
{
...
...
composer.json
View file @
154fe430
{
"name"
:
"luitd/lu-api"
,
"version"
:
"2.6.
3
"
,
"version"
:
"2.6.
4
"
,
"description"
:
"REST API Integration for TYPO3"
,
"type"
:
"typo3-cms-extension"
,
"keywords"
:
[
...
...
ext_conf_template.txt
View file @
154fe430
...
...
@@ -19,6 +19,9 @@ endPoints.ContractsList = http://luis.lu.lv/luis/LU_uznl.html
# cat=SOLR/set; type=string; label=LU Search DB
solrDatabase.search = lusearch
# cat=SOLR/set; type=string; label=Exclude UIDs from search
solrDatabase.searchExcludedUIds =
# cat=SOLR/set; type=string; label=Programme catalogue DB
solrDatabase.programmeCatalogue = kursu_katal_program_dati
...
...
ext_emconf.php
View file @
154fe430
...
...
@@ -14,7 +14,7 @@ $EM_CONF[$_EXTKEY] = [
'title'
=>
'LU API'
,
'description'
=>
'REST API Integration for TYPO3'
,
'category'
=>
'plugin'
,
'version'
=>
'2.6.
3
'
,
'version'
=>
'2.6.
4
'
,
'dependencies'
=>
'typo3'
,
'state'
=>
'stable'
,
'clearCacheOnLoad'
=>
true
,
...
...
readme.md
View file @
154fe430
...
...
@@ -4,7 +4,7 @@
## Version
2.
6.
3
2.
6.
4
## Dependencies
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment