52function page_tree(
int $root_id = 0, array &$page_storage = [], array $fields = [
'page_id',
'page_title',
'menu_title',
'parent',
'position',
'visibility'] ): void
54 global $LEPTON_CORE_all_pages;
58 if (!in_array(
'page_id', $fields))
63 if (!in_array(
'parent', $fields))
68 if (!in_array(
'visibility', $fields))
70 $fields[] =
"visibility";
73 $select_fields =
"`".implode(
"`,`", $fields).
"`";
75 $LEPTON_CORE_all_pages = [];
77 "SELECT ".$select_fields.
" FROM `".TABLE_PREFIX.
"pages` ORDER BY `parent`,`position`",
79 $LEPTON_CORE_all_pages
94 global $LEPTON_CORE_all_pages, $TEXT;
96 foreach($LEPTON_CORE_all_pages as &$ref) {
98 if ($ref[
'parent'] > $aNum)
103 if ($ref[
'parent'] == $aNum) {
105 switch( $ref[
'visibility'] ) {
108 $ref[
'status_icon'] =
"visible_16.png";
109 $ref[
'status_text'] = $TEXT[
'PUBLIC'];
110 $ref[
'status_uiicon'] =
'unhide';
114 $ref[
'status_icon'] =
"private_16.png";
115 $ref[
'status_text'] = $TEXT[
'PRIVATE'];
116 $ref[
'status_uiicon'] =
'user';
120 $ref[
'status_icon'] =
"keys_16.png";
121 $ref[
'status_text'] = $TEXT[
'REGISTERED'];
122 $ref[
'status_uiicon'] =
'sign in';
126 $ref[
'status_icon'] =
"hidden_16.png";
127 $ref[
'status_text'] = $TEXT[
'HIDDEN'];
128 $ref[
'status_uiicon'] =
'hide';
132 $ref[
'status_icon'] =
"none_16.png";
133 $ref[
'status_text'] = $TEXT[
'NONE'];
134 $ref[
'status_uiicon'] =
'lock';
138 $ref[
'status_icon'] =
"deleted_16.png";
139 $ref[
'status_text'] = $TEXT[
'DELETED'];
140 $ref[
'status_uiicon'] =
'recycle red';
144 die(
LEPTON_tools::display(
"Error: [20012] ".$ref[
'visibility'].
" unknown!",
"pre",
"ui message red"));
149 $ref[
'subpages'] = [];
152 if (isset($ref[
'link'])) {
153 $ref[
'link'] = PAGES_DIRECTORY.$ref[
'link'].PAGE_EXTENSION;
156 $aRefArray[] = &$ref;
page_tree(int $root_id=0, array &$page_storage=[], array $fields=['page_id', 'page_title', 'menu_title', 'parent', 'position', 'visibility'])
LEPTON_CORE_make_list(int $aNum, array &$aRefArray)