Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
qfq
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
typo3
qfq
Commits
fbf8b204
Commit
fbf8b204
authored
1 year ago
by
Jan Haller
Browse files
Options
Downloads
Patches
Plain Diff
ipa_haller_jan (WIP): Added file support to wiki. Reformatting. refs #15634
parent
ec881eed
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!691
New version v24.3.0
,
!607
ipa_haller_jan: QFQ-Wiki. refs #15634
Pipeline
#9914
failed
1 year ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
extension/Resources/Private/Report/wiki.qfqr
+158
-82
158 additions, 82 deletions
extension/Resources/Private/Report/wiki.qfqr
with
158 additions
and
82 deletions
extension/Resources/Private/Report/wiki.qfqr
+
158
−
82
View file @
fbf8b204
...
...
@@ -14,7 +14,7 @@ form={{form:SE}}
# Add variables from S- to R-store
10 {
sql = SELECT '{{action:SE::w}}' AS _action
, '{{wpId:SC0:alnumx}}' AS _wpId
, '{{wpId:SC0:alnumx}}' AS _wpId
, '{{wpIdPrevious:S0}}' AS _wpIdPrevious
, '{{sectionId:S0}}' AS _sectionId
, '{{sectionIdEnd:S0}}' AS _sectionIdEnd
...
...
@@ -25,145 +25,149 @@ form={{form:SE}}
# Only executed if record needs to be updated
20 {
sql = SELECT
1
FROM DUAL
sql = SELECT
''
FROM DUAL
WHERE FIND_IN_SET('{{action:RE}}', 'new,editAll,editSection')
content = hideLevel
# Copy information from previous record (except author) into new one
30 {
sql = UPDATE WikiPage AS wp1
JOIN WikiPage AS wp2
JOIN WikiPage AS wp2
ON wp2.id = '{{wpIdPrevious:R0}}'
SET wp1.wpIdParent = wp2.wpIdParent
, wp1.pageSlug = wp2.pageSlug
, wp1.name = wp2.name
, wp1.author = QIFEMPTY('{{feUser:T}}', 'anonymous')
, wp1.roUser = wp2.roUser
, wp1.roGroup = wp2.roGroup
, wp1.roPublic = wp2.roPublic
, wp1.rwUser = wp2.rwUser
, wp1.rwGroup = wp2.rwGroup
, wp1.rwPublic = wp2.rwPublic
, wp1.pageLock = wp2.pageLock
, wp1.imageBorder = wp2.imageBorder
WHERE wp1.id = '{{wpId:R0}}'
, wp1.pageSlug = wp2.pageSlug
, wp1.name = wp2.name
, wp1.author = QIFEMPTY('{{feUser:T}}', 'anonymous')
, wp1.roUser = wp2.roUser
, wp1.roGroup = wp2.roGroup
, wp1.roPublic = wp2.roPublic
, wp1.rwUser = wp2.rwUser
, wp1.rwGroup = wp2.rwGroup
, wp1.rwPublic = wp2.rwPublic
, wp1.pageLock = wp2.pageLock
, wp1.imageBorder = wp2.imageBorder
WHERE wp1.id = '{{wpId:R0}}'
}
# Update previous versions with the id of the current record
40 {
sql = UPDATE WikiPage SET wpIdCurrent = '{{wpId:R0}}'
WHERE IFNULL(wpIdCurrent, id) = '{{wpIdPrevious:R0}}'
WHERE IFNULL(wpIdCurrent, id) = '{{wpIdPrevious:R0}}'
}
# Update all versions with the id of the current record
50 {
sql = UPDATE WikiPage SET wpIdParent = '{{wpId:R0}}'
WHERE wpIdParent = '{{wpIdPrevious:R0}}'
WHERE wpIdParent = '{{wpIdPrevious:R0}}'
}
#
Only executed if a section of the previous record has been edite
d
#
Update previous uploads with the current i
d
60 {
sql = SELECT 1
FROM DUAL
sql = UPDATE WikiAttachment SET wpId = '{{wpId:R0}}'
WHERE wpId = '{{wpIdPrevious:R0}}'
}
# Only executed if a section of the previous record has been edited
70 {
sql = SELECT ''
FROM DUAL
WHERE '{{action:RE}}' = 'editSection'
content = hideLevel
# Executes the function getWikiContentSection() from the PHP-script
# Parses the first section of the content until where the editing began
7
0 {
8
0 {
sql = SELECT 'F:typo3conf/ext/qfq/wikiScript.php|call:getWikiContentSection|arg:sectionIdStart=1§ionIdEnd={{sectionId:R0}}&id={{wpIdPrevious:R0}}&includeTag=true' AS _script
}
# Function returns the first section in V-Store
8
0 {
9
0 {
sql = SELECT '{{section:VE}}' AS _contentBefore
}
# Executes the function getWikiContentSection() from the PHP-script
# Parses the last section of the content from where the editing ended
9
0 {
10
0 {
sql = SELECT 'F:typo3conf/ext/qfq/wikiScript.php|call:getWikiContentSection|arg:sectionIdStart={{sectionIdEnd:R0}}&id={{wpIdPrevious:R0}}&includeTag=false' AS _script
}
# Function returns the last section in V-Store
1
0
0 {
1
1
0 {
sql = SELECT '{{section:VE}}' AS _contentAfter
}
# Update of the current record with the unchanged content
1
1
0 {
1
2
0 {
sql = UPDATE WikiPage SET content = CONCAT('{{contentBefore:RE}}', content, '{{contentAfter:RE}}')
WHERE id = '{{wpId:R0}}'
WHERE id = '{{wpId:R0}}'
}
}
}
# Sneaky reload of the page to remove SIP-URL after redirect from form
1
2
0 {
sql = SELECT '<script>window.location.href="{{
baseUrl:Y}}{{
pageSlug:T}}?wpId={{wpId:RE}}#{{headingTitle:RE}}";</script>'
FROM DUAL
1
3
0 {
sql = SELECT '<script>window.location.href="{{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
1
3
0 {
1
4
0 {
sql = SELECT id AS _wpId
FROM WikiPage
FROM WikiPage
WHERE id = '{{wpId:R0}}'
altsql = SELECT id AS _wpId
FROM WikiPage
WHERE pageSlug = '{{pageSlug:T}}'
AND ISNULL(wpIdCurrent)
AND ISNULL(wpIdParent)
ORDER BY modified DESC
LIMIT 1
FROM WikiPage
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
1
4
0 {
1
5
0 {
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
1
5
0 {
1
6
0 {
sql = SELECT CASE
WHEN '{{wikiAccess:VE}}' = 'ro' THEN '5'
WHEN '{{wikiAccess:VE}}' = 'rw' THEN '0'
WHEN '{{wikiAccess:VE}}' = 'off' THEN '5'
END AS _renderMode
WHEN '{{wikiAccess:VE}}' = 'ro' THEN '5'
WHEN '{{wikiAccess:VE}}' = 'rw' THEN '0'
WHEN '{{wikiAccess:VE}}' = 'off' THEN '5'
END AS _renderMode
}
# Grant access to developers
1
6
0 {
1
7
0 {
sql = SELECT IF('{{beUser:T}}' != '', '0', '{{renderMode:R0}}') AS _renderMode
}
# Prepare PDF Export
1
7
0 {
1
8
0 {
sql = SELECT CONCAT('U:id={{pageSlug:T}}&wpId={{wpId:R0}}&print=true'
, '&--disable-external-links'
, '&--margin-top=20'
, '&--margin-bottom=20'
, '&--margin-left=20'
, '&--margin-right=20'
, '&--header-left={{pageTitle:TE}}'
, '&--header-font-name=Open Sans'
, '&--header-spacing=5'
, '&--footer-left=[date]'
, '&--footer-right=[page]/[topage]'
, '&--footer-font-name=Open Sans'
, '&--footer-spacing=5'
, '&--footer-font-size=10'
, '&type=2'
, '&_sip=1'
, '|g:_blank|b:0|t:<span class="glyphicon glyphicon-print"></span> Print|d:Print wiki') AS '_pdf|pdfDownload|_hide'
, '&--disable-external-links'
, '&--margin-top=20'
, '&--margin-bottom=20'
, '&--margin-left=20'
, '&--margin-right=20'
, '&--header-left={{pageTitle:TE}}'
, '&--header-font-name=Open Sans'
, '&--header-spacing=5'
, '&--footer-left=[date]'
, '&--footer-right=[page]/[topage]'
, '&--footer-font-name=Open Sans'
, '&--footer-spacing=5'
, '&--footer-font-size=10'
, '&type=2'
, '&_sip=1'
, '|g:_blank|b:0|t:<span class="glyphicon glyphicon-print"></span> Print|d:Print wiki') AS '_pdf|pdfDownload|_hide'
}
# Dropdown for "Settings", "History", "Print" and "Add new page"
1
8
0 {
1
9
0 {
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|b:0|G:glyphicon glyphicon-backward|t:History'
...
...
@@ -178,8 +182,8 @@ sql = SELECT CONCAT('U:id={{pageSlug:T}}&wpId={{wpId:R0}}&print=true'
, '&rwPublic=', rwPublic
, '&pageLock=', pageLock
, '|s|b:0|G:glyphicon glyphicon-plus|t:Add new page|r:{{renderMode:RE}}'
) AS _link
FROM WikiPage
) AS _link
FROM WikiPage
WHERE id = '{{wpId:R0}}'
AND '{{history:RE}}' != 'true'
AND '{{print:RE}}' != 'true'
...
...
@@ -188,43 +192,115 @@ sql = SELECT CONCAT('U:id={{pageSlug:T}}&wpId={{wpId:R0}}&print=true'
# If no wiki page is found, a new one can be created
altsql = SELECT '<div style="float: right;">', 'p:{{pageSlug:T}}&form=wikiPage&r=0|s|b|N' AS _link, '</div>'
FROM DUAL
FROM DUAL
WHERE '{{history:RE}}' != 'true'
AND '{{beUser:T}}' != ''
AND '{{wpId:R0}}' = 0
rbeg = <div style="float: right;">
rend = </div>
}
# Executes function renderWiki() from the PHP-script
# Parses the content of the wiki page and returns it with edit links, replaced macros, etc.
19
0 {
20
0 {
sql = SELECT 'F:typo3conf/ext/qfq/wikiScript.php|call:renderWiki|arg:id={{wpId:R0}}&renderMode={{renderMode:RE}}&printMode={{print:RE}}' AS _script
FROM DUAL
FROM DUAL
WHERE '{{history:RE}}' != 'true'
AND ('{{wikiAccess:VE}}' != 'off'
OR '{{beUser:T}}' != '')
# User does not have the privileges to view the wiki page
altsql = SELECT '<p>Access denied. You don\'t have permissions to
access "{{baseUrl:Y}}{{pageSlug:T}}"
.</p>'
FROM DUAL
altsql = SELECT '<p>Access denied. You don\'t have permissions to
view this page
.</p>'
FROM DUAL
WHERE '{{wpId:R0}}' != 0
AND '{{history:RE}}' != 'true'
}
# Style for container containing the files
210 {
sql = SELECT IF('{{print:RE}}' = 'true', 'show', 'none') AS _styleContainer
}
# Continue only when not in "History"
220 {
sql = SELECT ''
FROM DUAL
WHERE '{{history:RE}}' != 'true'
AND '{{wpId:R0}}' != 0
# Prepare link and container to toggle files
230 {
sql = SELECT CONCAT('</br>'
, '<a class="wiki-files-link" style="cursor:pointer;"'
, 'onclick="$(\'#wiki-files-chevron-{{wpId:R0}}\').toggleClass(\'glyphicon-chevron-down glyphicon-chevron-right\');'
, '$(\'#wiki-files-container-{{wpId:R0}}\').fadeToggle(\'fast\');">'
, '<span class="wiki-files-chevron glyphicon glyphicon-chevron-right" id="wiki-files-chevron-{{wpId:R0}}"></span>'
, 'Files ('
, COUNT(id)
, ')'
, '</a>'
, '<div class="wiki-files-container" style="display:{{styleContainer:RE}};" id="wiki-files-container-{{wpId:R0}}">'
)
FROM WikiAttachment
WHERE wpId = '{{wpId:R0}}'
AND pathFileName != ''
stail = </div>
# Files
240 {
sql = SELECT CONCAT('p:{{pageSlug:T}}&form=wikiUpload&r=', id, '|s|b|E') AS _link
, CONCAT('F:', pathFileName
, '|t:', QLEFT(SUBSTRING_INDEX(pathFileName, '/', -1), 30)
, '|d:', SUBSTRING_INDEX(pathFileName, '/', -1)
, '|o:', SUBSTRING_INDEX(pathFileName, '/', -1)
, '|s|b|g:_blank|G:glyphicon glyphicon-paperclip|M:file'
) AS _link
, feUser
, modified
, CONCAT('U:table=WikiAttachment&r=', id, '|q:Do you want to delete <i>', SUBSTRING_INDEX(pathFileName, '/', -1), '</i> ?') AS _paged
FROM WikiAttachment
WHERE wpId = '{{wpId:R0}}'
AND pathFileName != ''
AND '{{history:RE}}' != 'true'
ORDER BY modified ASC
shead = <table class="table qfq-table-100">
<thead>
<tr>
<th>{{'p:{{pageSlug:T}}&form=wikiUpload&r=0&wpId={{wpId:R0}}|s|b|N' AS _link}}</th>
<th>File</th>
<th>User</th>
<th>Date</th>
<th></th>
</tr>
</thead>
<tbody>
stail = </tbody>
</table>
fbeg = <td>
fend = </td>
rbeg = <tr>
rend = </tr>
}
}
}
# History of the wiki page
2
0
0 {
2
5
0 {
sql = SELECT created, author
FROM WikiPage
FROM WikiPage
WHERE IFNULL(wpIdCurrent, id) = '{{wpId:R0}}'
AND pageSlug = '{{pageSlug:T}}'
AND '{{history:RE}}' = 'true'
ORDER BY created DESC
head = <table class="table qfq-table-50"><thead><tr><th>Updated</th><th>Author</th></thead><tbody>
tail = </tbody></table>
fbeg = <td>
fend = </td>
rbeg = <tr>
rend = </tr>
ORDER BY created DESC
head = {{'p:{{pageSlug:T}}&wpId={{wpId:R0}}|b|t:Back|G:glyphicon glyphicon-arrow-left' AS _link}}
<table class="table qfq-table-50"><thead><tr><th>Updated</th><th>Author</th></thead><tbody>
tail = </tbody></table>
fbeg = <td>
fend = </td>
rbeg = <tr>
rend = </tr>
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment