LEPTON CMS
7.2.0
feel free to keep it strictly simple...
Loading...
Searching...
No Matches
function.get_parent_ids.php
Go to the documentation of this file.
1
<?php
2
18
declare(strict_types = 1);
19
20
// include secure.php to protect this file and the whole CMS!
21
if
(!defined(
"SEC_FILE"
)){define(
"SEC_FILE"
,
'/framework/secure.php'
);}
22
if
(defined(
'LEPTON_PATH'
)) {
23
include LEPTON_PATH.SEC_FILE;
24
}
else
{
25
$oneback =
"../"
;
26
$root
= $oneback;
27
$level
= 1;
28
while
((
$level
< 10) && (!file_exists(
$root
.SEC_FILE))) {
29
$root
.= $oneback;
30
$level
+= 1;
31
}
32
if
(file_exists(
$root
.SEC_FILE)) {
33
include
$root
.SEC_FILE;
34
}
else
{
35
trigger_error(sprintf(
"[ <b>%s</b> ] Can't include secure.php!"
, $_SERVER[
'SCRIPT_NAME'
]), E_USER_ERROR);
36
}
37
}
38
// end include secure file
39
48
// Function to get all parent page id's
49
function
get_parent_ids
(
int
$iParentId ): array
50
{
51
LEPTON_handle::register
(
"is_parent"
);
52
$ids[] = $iParentId;
53
$iTempParent =
is_parent
( $iParentId );
54
if
( $iTempParent !== 0 )
55
{
56
$parent_ids =
get_parent_ids
( $iTempParent );
57
$ids = array_merge( $ids, $parent_ids );
58
}
59
return
$ids;
60
}
LEPTON_handle\register
static register()
Definition
lepton_handle.php:729
get_parent_ids
get_parent_ids(int $iParentId)
Definition
function.get_parent_ids.php:49
$root
$root
Definition
function.get_parent_ids.php:26
$level
$level
Definition
function.get_parent_ids.php:27
is_parent
is_parent(int $iPageId)
Definition
function.is_parent.php:49
SVN
upload
framework
functions
function.get_parent_ids.php
Generated by
1.10.0