Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AdminLTE renderer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
IML Open Source
AdminLTE renderer
Commits
c5fe56f1
Commit
c5fe56f1
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
add pageinclude class
parent
bc919acd
Branches
Branches containing commit
No related tags found
1 merge request
!3
Fix missing files
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public_html/classes/pageinclude.class.php
+53
-0
53 additions, 0 deletions
public_html/classes/pageinclude.class.php
with
53 additions
and
0 deletions
public_html/classes/pageinclude.class.php
0 → 100644
+
53
−
0
View file @
c5fe56f1
<?php
class
pageinclude
{
protected
$_request
;
protected
$_sPageFile
;
protected
$_sPagesDir
;
/**
* init
* @return bool
*/
public
function
__construct
(){
$this
->
_sPagesDir
=
__DIR__
.
'/../pages/'
;
return
true
;
}
protected
function
_detectPagefile
(){
$_request
=
$_SERVER
[
'REQUEST_URI'
];
$sPagefile
=
preg_replace
(
'/\?.*$/'
,
''
,
$_request
);
if
(
$sPagefile
==
"/"
){
$sPagefile
=
"/index"
;
}
return
$sPagefile
.
=
".php"
;
}
/**
* set another base dir for pages
* @param string $sDir path of the new pages dir
* @return bool
*/
public
function
setPagedir
(
$sDir
){
if
(
is_dir
(
$sDir
)){
$this
->
_sPagesDir
=
$sDir
;
return
true
;
}
return
false
;
}
public
function
getPage
(){
$this
->
_sPageFile
=
$this
->
_detectPagefile
();
ob_start
();
// echo "$this->_sPagesDir.$this->_sPageFile<br>";
if
(
!@
include
(
$this
->
_sPagesDir
.
$this
->
_sPageFile
))
{
echo
"
$this->_sPagesDir
.
$this->_sPageFile
<br>"
;
@
include
(
$this
->
_sPagesDir
.
"error_404.php"
);
}
$sPhpOut
=
ob_get_contents
();
ob_end_clean
();
return
$sPhpOut
;
}
}
\ 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