diff options
author | polo <ordipolo@gmx.fr> | 2025-06-25 01:11:23 +0200 |
---|---|---|
committer | polo <ordipolo@gmx.fr> | 2025-06-25 01:11:23 +0200 |
commit | e30385768e2ff259e384973ec451cff8f3b9ddbb (patch) | |
tree | 24284b782b52fa1bea8f079991edecc7655fe657 | |
parent | 7a13d53e43c7db7fe39474208ffa54ba2906d308 (diff) | |
download | cms-e30385768e2ff259e384973ec451cff8f3b9ddbb.zip |
erreurs dans makeStartPage et dans des entités
-rw-r--r-- | src/controller/installation.php | 11 | ||||
-rw-r--r-- | src/model/entities/NodeData.php | 2 | ||||
-rw-r--r-- | src/model/entities/Page.php | 2 | ||||
-rw-r--r-- | src/view/templates/main.php | 2 |
4 files changed, 10 insertions, 7 deletions
diff --git a/src/controller/installation.php b/src/controller/installation.php index f87843c..5cfae45 100644 --- a/src/controller/installation.php +++ b/src/controller/installation.php | |||
@@ -83,8 +83,9 @@ HTACCESS; | |||
83 | } | 83 | } |
84 | } | 84 | } |
85 | 85 | ||
86 | // création de la page d'accueil à la toute 1ère visite du site | 86 | // création d'un site minimal avec une page d'accueil à la toute 1ère visite du site |
87 | // les informations ici ne sont pas demandées à l'utilisateur pour l'instant (on verra ça plus tard) | 87 | // fonctiona appelée après la première requête envoyée en BDD, |
88 | // en l'occurence dans Menu parce que count($bulk_data) === 0 | ||
88 | function makeStartPage(EntityManager $entityManager){ | 89 | function makeStartPage(EntityManager $entityManager){ |
89 | /* -- table page -- */ | 90 | /* -- table page -- */ |
90 | // paramètres: name_page, end_of_path, reachable, in_menu, hidden, position, parent | 91 | // paramètres: name_page, end_of_path, reachable, in_menu, hidden, position, parent |
@@ -114,7 +115,7 @@ function makeStartPage(EntityManager $entityManager){ | |||
114 | /* -- table image -- */ | 115 | /* -- table image -- */ |
115 | // paramètres: file_name, file_path, file_path_mini, mime_type, alt | 116 | // paramètres: file_name, file_path, file_path_mini, mime_type, alt |
116 | $favicon = new Image("favicon48x48.png", NULL, "assets/favicon48x48.png", "image/png", "favicon"); | 117 | $favicon = new Image("favicon48x48.png", NULL, "assets/favicon48x48.png", "image/png", "favicon"); |
117 | $logo = new Image("logo-120x75.jpg", NULL, "assets/logo-120x75.jpg", "image/png", "head_logo"); | 118 | $logo = new Image("logo-nb-et-ffn.png", NULL, "assets/logo-nb-et-ffn.png", "image/png", "head_logo"); |
118 | $facebook = new Image("facebook.svg", NULL, "assets/facebook.svg", "image/svg+xml", "facebook"); | 119 | $facebook = new Image("facebook.svg", NULL, "assets/facebook.svg", "image/svg+xml", "facebook"); |
119 | $instagram = new Image("instagram.svg", NULL, "assets/instagram.svg", "image/svg+xml", "instagram"); | 120 | $instagram = new Image("instagram.svg", NULL, "assets/instagram.svg", "image/svg+xml", "instagram"); |
120 | $linkedin = new Image("linkedin.svg", NULL, "assets/linkedin.svg", "image/svg+xml", "linkedin"); | 121 | $linkedin = new Image("linkedin.svg", NULL, "assets/linkedin.svg", "image/svg+xml", "linkedin"); |
@@ -128,7 +129,7 @@ function makeStartPage(EntityManager $entityManager){ | |||
128 | $head_article_data = new NodeData(["description" => ""], $head_article, new ArrayCollection([$favicon])); | 129 | $head_article_data = new NodeData(["description" => ""], $head_article, new ArrayCollection([$favicon])); |
129 | $head_edit_menu_data = new NodeData(["description" => "Menu et chemins"], $head_edit_menu, new ArrayCollection([$favicon])); | 130 | $head_edit_menu_data = new NodeData(["description" => "Menu et chemins"], $head_edit_menu, new ArrayCollection([$favicon])); |
130 | $head_new_page_data = new NodeData(["description" => "Nouvelle page"], $head_new_page, new ArrayCollection([$favicon])); | 131 | $head_new_page_data = new NodeData(["description" => "Nouvelle page"], $head_new_page, new ArrayCollection([$favicon])); |
131 | $header_data = new NodeData(["description" => "Club, École de natation et Perfectionnement", "social" => ["title" => "Les Nageurs Bigoudens", "facebook_link" => "https://www.facebook.com/nageursbigoudens29120", "instagram_link" => "https://www.instagram.com/nageursbigoudens/"]], $header, new ArrayCollection([$logo, $facebook, $instagram, $linkedin, $github, $fond_piscine])); | 132 | $header_data = new NodeData(["title" => "Les Nageurs Bigoudens", "description" => "Club, École de natation et Perfectionnement", "social" => ["facebook_link" => "https://www.facebook.com/nageursbigoudens29120", "instagram_link" => "https://www.instagram.com/nageursbigoudens/"]], $header, new ArrayCollection([$logo, $facebook, $instagram, $linkedin, $github, $fond_piscine])); |
132 | $footer_data = new NodeData(["adresse" => "17, rue Raymonde Folgoas Guillou, 29120 Pont-l’Abbé", "contact_nom" => "Les Nageurs Bigoudens", "e_mail" => "nb.secretariat@orange.fr", "logo_footer" => "assets/logo-nb-et-ffn.png"], $footer); | 133 | $footer_data = new NodeData(["adresse" => "17, rue Raymonde Folgoas Guillou, 29120 Pont-l’Abbé", "contact_nom" => "Les Nageurs Bigoudens", "e_mail" => "nb.secretariat@orange.fr", "logo_footer" => "assets/logo-nb-et-ffn.png"], $footer); |
133 | 134 | ||
134 | /* -- table page -- */ | 135 | /* -- table page -- */ |
@@ -159,6 +160,8 @@ function makeStartPage(EntityManager $entityManager){ | |||
159 | $entityManager->persist($logo); | 160 | $entityManager->persist($logo); |
160 | $entityManager->persist($facebook); | 161 | $entityManager->persist($facebook); |
161 | $entityManager->persist($instagram); | 162 | $entityManager->persist($instagram); |
163 | $entityManager->persist($linkedin); | ||
164 | $entityManager->persist($github); | ||
162 | $entityManager->persist($fond_piscine); | 165 | $entityManager->persist($fond_piscine); |
163 | 166 | ||
164 | /* -- table node_data -- */ | 167 | /* -- table node_data -- */ |
diff --git a/src/model/entities/NodeData.php b/src/model/entities/NodeData.php index d502fa4..9d23b8b 100644 --- a/src/model/entities/NodeData.php +++ b/src/model/entities/NodeData.php | |||
@@ -28,7 +28,7 @@ class NodeData | |||
28 | private array $data; | 28 | private array $data; |
29 | 29 | ||
30 | // liaison avec table intermédiaire | 30 | // liaison avec table intermédiaire |
31 | #[ORM\ManyToMany(targetEntity: Image::class, inversedBy: "id_image")] | 31 | #[ORM\ManyToMany(targetEntity: Image::class, inversedBy: "node_data")] |
32 | #[ORM\JoinTable( | 32 | #[ORM\JoinTable( |
33 | name: TABLE_PREFIX . "node_image", | 33 | name: TABLE_PREFIX . "node_image", |
34 | joinColumns: [new ORM\JoinColumn(name: "node_data_id", referencedColumnName: "id_node_data", onDelete: "CASCADE")], | 34 | joinColumns: [new ORM\JoinColumn(name: "node_data_id", referencedColumnName: "id_node_data", onDelete: "CASCADE")], |
diff --git a/src/model/entities/Page.php b/src/model/entities/Page.php index 7448e5d..bcf49db 100644 --- a/src/model/entities/Page.php +++ b/src/model/entities/Page.php | |||
@@ -40,7 +40,7 @@ class Page | |||
40 | #[ORM\Column(type: "integer", nullable: true)] // null si hors menu | 40 | #[ORM\Column(type: "integer", nullable: true)] // null si hors menu |
41 | private ?int $position; | 41 | private ?int $position; |
42 | 42 | ||
43 | #[ORM\ManyToOne(targetEntity: self::class)] | 43 | #[ORM\ManyToOne(targetEntity: self::class, inversedBy: "children")] |
44 | #[ORM\JoinColumn(name: "parent_id", referencedColumnName: "id_page", onDelete: "SET NULL", nullable: true)] | 44 | #[ORM\JoinColumn(name: "parent_id", referencedColumnName: "id_page", onDelete: "SET NULL", nullable: true)] |
45 | private ?self $parent = null; | 45 | private ?self $parent = null; |
46 | 46 | ||
diff --git a/src/view/templates/main.php b/src/view/templates/main.php index 9908be7..48ada5f 100644 --- a/src/view/templates/main.php +++ b/src/view/templates/main.php | |||
@@ -28,7 +28,7 @@ | |||
28 | <label>Supprimer cette page</label> | 28 | <label>Supprimer cette page</label> |
29 | <input type="hidden" name="page_id" value="<?= Director::$page_path->getLast()->getId() ?>"> | 29 | <input type="hidden" name="page_id" value="<?= Director::$page_path->getLast()->getId() ?>"> |
30 | <input type="hidden" name="submit_hidden"> | 30 | <input type="hidden" name="submit_hidden"> |
31 | <input type="submit" value="Valider" onclick="return confirm('Voulez-vous vraiment supprimer cette page?');"> | 31 | <input type="submit" value="Supprimer" onclick="return confirm('Voulez-vous vraiment supprimer cette page?');"> |
32 | </form> | 32 | </form> |
33 | </div> | 33 | </div> |
34 | <div class="edit_bloc_zone"> | 34 | <div class="edit_bloc_zone"> |