Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dokuwiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
BRIC
dokuwiki
Commits
2eaa0567
Commit
2eaa0567
authored
6 years ago
by
peterfromearth
Browse files
Options
Downloads
Patches
Plain Diff
add check if a page has once existed and show new onceexisted page
parent
ba18cc87
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
inc/changelog.php
+9
-0
9 additions, 0 deletions
inc/changelog.php
inc/lang/en/onceexisted.txt
+3
-0
3 additions, 0 deletions
inc/lang/en/onceexisted.txt
inc/parserutils.php
+7
-1
7 additions, 1 deletion
inc/parserutils.php
with
19 additions
and
1 deletion
inc/changelog.php
+
9
−
0
View file @
2eaa0567
...
...
@@ -743,6 +743,15 @@ abstract class ChangeLog {
return
array
(
array_reverse
(
$revs1
),
array_reverse
(
$revs2
));
}
/**
* Checks if the ID has old revisons
* @return boolean
*/
public
function
hasRevisions
()
{
$file
=
$this
->
getChangelogFilename
();
return
file_exists
(
$file
);
}
/**
* Returns lines from changelog.
...
...
This diff is collapsed.
Click to expand it.
inc/lang/en/onceexisted.txt
0 → 100644
+
3
−
0
View file @
2eaa0567
======= This page does not exist anymore ======
You've followed a link to a page that no longer exists. You can check the list of [[?do=revisions|old revisions]] to see when and why it was deleted, access old revisions or restore it.
\ No newline at end of file
This diff is collapsed.
Click to expand it.
inc/parserutils.php
+
7
−
1
View file @
2eaa0567
...
...
@@ -82,7 +82,13 @@ function p_wiki_xhtml($id, $rev='', $excuse=true,$date_at=''){
if
(
file_exists
(
$file
)){
$ret
=
p_cached_output
(
$file
,
'xhtml'
,
$id
);
}
elseif
(
$excuse
){
$ret
=
p_locale_xhtml
(
'newpage'
);
//check if the page once existed
$changelog
=
new
PageChangelog
(
$id
);
if
(
$changelog
->
hasRevisions
())
{
$ret
=
p_locale_xhtml
(
'onceexisted'
);
}
else
{
$ret
=
p_locale_xhtml
(
'newpage'
);
}
}
}
...
...
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