diff options
author | polo <ordipolo@gmx.fr> | 2025-04-13 13:30:31 +0200 |
---|---|---|
committer | polo <ordipolo@gmx.fr> | 2025-04-13 13:30:31 +0200 |
commit | 75f2c543e7fe45c1a3dcea842650a5d13a0235f0 (patch) | |
tree | 82461287eac3ae23728a74a2b90d6f574f3ddb37 /src/model | |
parent | 27bd4f380f76d5494fd9be81d3d0edac9a0aa2cc (diff) | |
download | cms-75f2c543e7fe45c1a3dcea842650a5d13a0235f0.zip |
menu et fil d'ariane gèrent le champ reachable dans page
Diffstat (limited to 'src/model')
-rw-r--r-- | src/model/Menu.php | 6 | ||||
-rw-r--r-- | src/model/entities/Page.php | 7 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/model/Menu.php b/src/model/Menu.php index 624a0fc..403accf 100644 --- a/src/model/Menu.php +++ b/src/model/Menu.php | |||
@@ -20,12 +20,12 @@ class Menu extends Page | |||
20 | ->getResult(); // :array de Page | 20 | ->getResult(); // :array de Page |
21 | 21 | ||
22 | if(count($bulk_data) === 0){ | 22 | if(count($bulk_data) === 0){ |
23 | makeStartPage($entityManager); | 23 | makeStartPage($entityManager); // => installation.php |
24 | } | 24 | } |
25 | 25 | ||
26 | foreach($bulk_data as $first_level_entries){ | 26 | foreach($bulk_data as $first_level_entries){ |
27 | // génération du menu | 27 | // dans le menu |
28 | if($first_level_entries->getInMenu()){ | 28 | if($first_level_entries->isInMenu()){ |
29 | $this->addChild($first_level_entries); | 29 | $this->addChild($first_level_entries); |
30 | } | 30 | } |
31 | // autres pages | 31 | // autres pages |
diff --git a/src/model/entities/Page.php b/src/model/entities/Page.php index fbf0f27..c40a297 100644 --- a/src/model/entities/Page.php +++ b/src/model/entities/Page.php | |||
@@ -73,7 +73,11 @@ class Page | |||
73 | { | 73 | { |
74 | return $this->end_of_path; | 74 | return $this->end_of_path; |
75 | } | 75 | } |
76 | public function getInMenu(): bool | 76 | public function isReachable(): bool |
77 | { | ||
78 | return $this->reachable; | ||
79 | } | ||
80 | public function isInMenu(): bool | ||
77 | { | 81 | { |
78 | return $this->in_menu; | 82 | return $this->in_menu; |
79 | } | 83 | } |
@@ -112,7 +116,6 @@ class Page | |||
112 | { | 116 | { |
113 | for($i = 0; $i < $iteration - 1; $i++) | 117 | for($i = 0; $i < $iteration - 1; $i++) |
114 | { | 118 | { |
115 | //echo '<br>' . $this->children[$i]->getPosition() . ' - ' . $this->children[$i + 1]->getPosition(); | ||
116 | if($this->children[$i]->getPosition() > $this->children[$i + 1]->getPosition()) | 119 | if($this->children[$i]->getPosition() > $this->children[$i + 1]->getPosition()) |
117 | { | 120 | { |
118 | $tmp = $this->children[$i]; | 121 | $tmp = $this->children[$i]; |