Skip to content
Snippets Groups Projects
Commit cdb876b1 authored by Jan Haller's avatar Jan Haller
Browse files

ipa_haller_jan (WIP): Updated report wiki.qfq. Because the navigation within...

ipa_haller_jan (WIP): Updated report wiki.qfq. Because the navigation within the wiki does not rely on SIP anymore, an additional level has been added (120). Because a page forward after editing the content is still necessary this level sneakingly reloads the page after updating the records to a URL without SIP. refs #15634
parent f3fed8dd
No related branches found
No related tags found
2 merge requests!691New version v24.3.0,!607ipa_haller_jan: QFQ-Wiki. refs #15634
Pipeline #9881 failed
......@@ -2,11 +2,11 @@
# Wiki
#
# {{action:SE::w}}
# {{wpId:S0}}
# {{wpId:SC0}}
# {{wpIdPrevious:S0}}
# {{sectionId:S0}}
# {{sectionIdEnd:S0}}
# {{history:SE}}
# {{history:CE}}
# {{print:SE}}
form={{form:SE}}
......@@ -14,11 +14,12 @@ form={{form:SE}}
# Add variables from S- to R-store
10 {
sql = SELECT '{{action:SE::w}}' AS _action
, '{{wpId:S0}}' AS _wpId
, '{{wpId:SC0:alnumx}}' AS _wpId
, '{{wpIdPrevious:S0}}' AS _wpIdPrevious
, '{{sectionId:S0}}' AS _sectionId
, '{{sectionIdEnd:S0}}' AS _sectionIdEnd
, '{{history:SE}}' AS _history
, '{{headingTitle:SE}}' AS _headingTitle
, '{{history:CE:alnumx}}' AS _history
, '{{print:SE}}' AS _print
}
......@@ -98,8 +99,15 @@ form={{form:SE}}
}
}
# If no id is in the R-store, the id of the root page will be used
# Sneaky reload of the page to remove SIP-URL after redirect from form
120 {
sql = SELECT '<script>window.location.href="{{baseUrl:Y}}{{pageSlug:T}}?wpId={{wpId:RE}}#{{headingTitle:RE}}";</script>'
FROM DUAL
WHERE '{{action:RE}}' != ''
}
# If no id is in the R-store, the id of the root page will be used
130 {
sql = SELECT id AS _wpId
FROM WikiPage
WHERE id = '{{wpId:R0}}'
......@@ -109,16 +117,18 @@ form={{form:SE}}
WHERE pageSlug = '{{pageSlug:T}}'
AND ISNULL(wpIdCurrent)
AND ISNULL(wpIdParent)
ORDER BY modified DESC
LIMIT 1
}
# Executes the function checkWikiAccess() from the PHP-script
# Checks the privileges of the user
130 {
140 {
sql = SELECT 'F:typo3conf/ext/qfq/wikiScript.php|call:checkWikiAccess|arg:id={{wpId:R0}}' AS _script
}
# Function returns the user privileges in V-Store and render mode gets set accordingly
140 {
150 {
sql = SELECT CASE
WHEN '{{wikiAccess:VE}}' = 'ro' THEN '5'
WHEN '{{wikiAccess:VE}}' = 'rw' THEN '0'
......@@ -127,12 +137,12 @@ form={{form:SE}}
}
# Grant access to developers
150 {
160 {
sql = SELECT IF('{{beUser:T}}' != '', '0', '{{renderMode:R0}}') AS _renderMode
}
# Prepare PDF Export
160 {
170 {
sql = SELECT CONCAT('U:id={{pageSlug:T}}&wpId={{wpId:R0}}&print=true'
, '&--disable-external-links'
, '&--margin-top=20'
......@@ -143,7 +153,7 @@ sql = SELECT CONCAT('U:id={{pageSlug:T}}&wpId={{wpId:R0}}&print=true'
, '&--header-font-name=Open Sans'
, '&--header-spacing=5'
, '&--footer-left=[date]'
, '&--footer-right=[page]/[topage] '
, '&--footer-right=[page]/[topage]'
, '&--footer-font-name=Open Sans'
, '&--footer-spacing=5'
, '&--footer-font-size=10'
......@@ -153,10 +163,10 @@ sql = SELECT CONCAT('U:id={{pageSlug:T}}&wpId={{wpId:R0}}&print=true'
}
# Dropdown for "Settings", "History", "Print" and "Add new page"
170 {
180 {
sql = SELECT CONCAT('z'
, '||p:{{pageSlug:T}}&form=wikiPage&r=', id, '|s|b:0|G:glyphicon glyphicon-cog|t:Settings|r:{{renderMode:RE}}'
, '||p:{{pageSlug:T}}&wpId={{wpId:R0}}&history=true|s|b:0|G:glyphicon glyphicon-backward|t:History'
, '||p:{{pageSlug:T}}&wpId={{wpId:R0}}&history=true|b:0|G:glyphicon glyphicon-backward|t:History'
, '||{{pdfDownload:RE}}'
, '||p:{{pageSlug:T}}&form=wikiPage&r=0'
,'&wpIdParent=', id
......@@ -188,7 +198,7 @@ sql = SELECT CONCAT('U:id={{pageSlug:T}}&wpId={{wpId:R0}}&print=true'
# Executes function renderWiki() from the PHP-script
# Parses the content of the wiki page and returns it with edit links, replaced macros, etc.
180 {
190 {
sql = SELECT 'F:typo3conf/ext/qfq/wikiScript.php|call:renderWiki|arg:id={{wpId:R0}}&renderMode={{renderMode:RE}}&printMode={{print:RE}}' AS _script
FROM DUAL
WHERE '{{history:RE}}' != 'true'
......@@ -203,7 +213,7 @@ sql = SELECT CONCAT('U:id={{pageSlug:T}}&wpId={{wpId:R0}}&print=true'
}
# History of the wiki page
190 {
200 {
sql = SELECT created, author
FROM WikiPage
WHERE IFNULL(wpIdCurrent, id) = '{{wpId:R0}}'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment