LEPTON CMS 7.2.0
feel free to keep it strictly simple...
Loading...
Searching...
No Matches
function.get_parent_titles.php
Go to the documentation of this file.
1<?php
2
18// include secure.php to protect this file and the whole CMS!
19if(!defined("SEC_FILE")){define("SEC_FILE",'/framework/secure.php' );}
20if (defined('LEPTON_PATH')) {
21 include LEPTON_PATH.SEC_FILE;
22} else {
23 $oneback = "../";
24 $root = $oneback;
25 $level = 1;
26 while (($level < 10) && (!file_exists($root.SEC_FILE))) {
27 $root .= $oneback;
28 $level += 1;
29 }
30 if (file_exists($root.SEC_FILE)) {
31 include $root.SEC_FILE;
32 } else {
33 trigger_error(sprintf("[ <b>%s</b> ] Can't include secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR);
34 }
35}
36// end include secure file
37
38
39// Function to get all parent page titles
40function get_parent_titles( $parent_id )
41{
42 LEPTON_handle::register("is_parent","get_menu_title");
43
44 $titles[] = get_menu_title( $parent_id );
45 $iTempParent = is_parent( $parent_id );
46 if ( $iTempParent !== 0 )
47 {
48 $parent_titles = get_parent_titles( $iTempParent );
49 $titles = array_merge( $titles, $parent_titles );
50 }
51 return $titles;
52}
get_menu_title(int $PageId=0)
get_parent_titles( $parent_id)
is_parent(int $iPageId)