summaryrefslogtreecommitdiff
path: root/src/controller/installation.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/controller/installation.php')
-rw-r--r--src/controller/installation.php39
1 files changed, 26 insertions, 13 deletions
diff --git a/src/controller/installation.php b/src/controller/installation.php
index 4aaa4e0..64ed94e 100644
--- a/src/controller/installation.php
+++ b/src/controller/installation.php
@@ -76,27 +76,29 @@ HTACCESS;
76// les informations ici ne sont pas demandées à l'utilisateur pour l'instant (on verra ça plus tard) 76// les informations ici ne sont pas demandées à l'utilisateur pour l'instant (on verra ça plus tard)
77function makeStartPage(EntityManager $entityManager){ 77function makeStartPage(EntityManager $entityManager){
78 /* -- table page -- */ 78 /* -- table page -- */
79 // paramètres: name_page, end_of_path, reachable, in_menu, position, parent 79 // paramètres: name_page, end_of_path, reachable, in_menu, hidden, position, parent
80 $accueil = new Page('Accueil', 'accueil', true, true, false, 1, NULL); 80 $accueil = new Page('Accueil', 'accueil', true, true, false, 1, NULL);
81 $connection = new Page('Connexion', 'connexion', true, false, false, NULL, NULL);
82 $article = new Page('Article', 'article', true, false, false, NULL, NULL); 81 $article = new Page('Article', 'article', true, false, false, NULL, NULL);
82 $connection = new Page('Connexion', 'connexion', true, false, false, NULL, NULL);
83 $menu_paths = new Page("Menu et chemins", 'menu_chemins', true, false, false, NULL, NULL); 83 $menu_paths = new Page("Menu et chemins", 'menu_chemins', true, false, false, NULL, NULL);
84 $edit_page = new Page("Modification d'une page", 'modif_page', true, false, false, NULL, NULL); 84 //$edit_page = new Page("Modification d'une page", 'modif_page', true, false, false, NULL, NULL); // pas de page "Modification de la page"
85 $new_page = new Page('Nouvelle page', 'nouvelle_page', true, false, false, NULL, NULL); 85 $new_page = new Page('Nouvelle page', 'nouvelle_page', true, false, false, NULL, NULL);
86 86
87 /* -- table node -- */ 87 /* -- table node -- */
88 // paramètres: name_node, article_timestamp, attributes, position, parent, page, article 88 // paramètres: name_node, article_timestamp, attributes, position, parent, page, article
89 $head_accueil = new Node('head', NULL, ['css_array' => ['body', 'head', 'nav', 'main', 'foot'], 'js_array' => ['main']], 1, NULL, $accueil, NULL); 89 $head_accueil = new Node('head', NULL, ['css_array' => ['body', 'head', 'nav', 'foot'], 'js_array' => ['main']], 1, NULL, $accueil, NULL);
90 $head_article = new Node('head', NULL, ['css_array' => ['body', 'head', 'nav', 'foot'], 'js_array' => ['main']], 1, NULL, $article, NULL);
90 $header = new Node('header', NULL, [], 2, NULL, NULL, NULL); 91 $header = new Node('header', NULL, [], 2, NULL, NULL, NULL);
91 $nav = new Node('nav', NULL, [], 1, $header, NULL, NULL); 92 $nav = new Node('nav', NULL, [], 1, $header, NULL, NULL);
92 $main = new Node('main', NULL, [], 3, NULL, NULL, NULL); 93 $main = new Node('main', NULL, [], 3, NULL, NULL, NULL);
93 $footer = new Node('footer', NULL, [], 4, NULL, NULL, NULL); 94 $footer = new Node('footer', NULL, [], 4, NULL, NULL, NULL);
94 $breadcrumb = new Node('breadcrumb', NULL, [], 2, $header, NULL, NULL); 95 $breadcrumb = new Node('breadcrumb', NULL, [], 2, $header, NULL, NULL);
95 $head_login = new Node('head', NULL, ["stop" => true, 'css_array' => ['body', 'head', 'nav', 'main'], 'js_array' => ['main']], 1, NULL, $connection, NULL); 96 $head_login = new Node('head', NULL, ["stop" => true, 'css_array' => ['body', 'head', 'nav'], 'js_array' => ['main']], 1, NULL, $connection, NULL);
96 $login = new Node('login', NULL, [], 1, $main, $connection, NULL); 97 $login = new Node('login', NULL, [], 1, $main, $connection, NULL);
97 $head_article = new Node('head', NULL, ['css_array' => ['body', 'head', 'nav', 'main', 'foot'], 'js_array' => ['main']], 1, NULL, $article, NULL); 98 $head_edit_menu = new Node('head', NULL, ['css_array' => ['body', 'head', 'nav', 'menu'], 'js_array' => ['main', 'menu']], 1, NULL, $menu_paths, NULL);
98 $head_edit_menu = new Node('head', NULL, ['css_array' => ['body', 'head', 'nav', 'main', 'menu'], 'js_array' => ['main', 'menu']], 1, NULL, $menu_paths, NULL); 99 $bloc_edit_menu = new Node('menu', NULL, [], 1, $main, $menu_paths, NULL);
99 $edit_menu = new Node('menu', NULL, [], 1, $main, $menu_paths, NULL); 100 $head_new_page = new Node('head', NULL, ['css_array' => ['body', 'head', 'nav', 'new_page'], 'js_array' => ['main', 'new_page']], 1, NULL, $new_page, NULL);
101 $bloc_new_page = new Node('new_page', NULL, [], 1, $main, $new_page, NULL);
100 102
101 /* -- table image -- */ 103 /* -- table image -- */
102 // paramètres: file_name, file_path, file_path_mini, mime_type, alt 104 // paramètres: file_name, file_path, file_path_mini, mime_type, alt
@@ -107,20 +109,24 @@ function makeStartPage(EntityManager $entityManager){
107 $fond_piscine = new Image("fond-piscine.jpg", "assets/fond-piscine.jpg", NULL, "images/jpg", "fond-piscine"); 109 $fond_piscine = new Image("fond-piscine.jpg", "assets/fond-piscine.jpg", NULL, "images/jpg", "fond-piscine");
108 110
109 /* -- table node_data -- */ 111 /* -- table node_data -- */
110 // paramètres: data, node 112 // paramètres: data, node, images
111 $head_accueil_data = new NodeData(["description" => "Club, École de natation et Perfectionnement", "title" => "Les Nageurs Bigoudens"], $head_accueil, new ArrayCollection([$favicon])); 113 $head_accueil_data = new NodeData(["description" => "Club, École de natation et Perfectionnement", "title" => "Les Nageurs Bigoudens"], $head_accueil, new ArrayCollection([$favicon]));
112 $header_data = new NodeData(["description" => "Club, École de natation et Perfectionnement", "title" => "Les Nageurs Bigoudens", "facebook_link" => "https://www.facebook.com/nageursbigoudens29120", "instagram_link" => "https://www.instagram.com/nageursbigoudens/"], $header, new ArrayCollection([$logo, $facebook, $instagram, $fond_piscine])); 114 $header_data = new NodeData(["description" => "Club, École de natation et Perfectionnement", "title" => "Les Nageurs Bigoudens", "facebook_link" => "https://www.facebook.com/nageursbigoudens29120", "instagram_link" => "https://www.instagram.com/nageursbigoudens/"], $header, new ArrayCollection([$logo, $facebook, $instagram, $fond_piscine]));
113 $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); 115 $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);
114 $head_login_data = new NodeData(["description" => "Connexion", "title" => "Connexion"], $head_login, new ArrayCollection([$favicon])); 116 $head_login_data = new NodeData(["description" => "Connexion", "title" => "Connexion"], $head_login, new ArrayCollection([$favicon]));
115 $head_article_data = new NodeData(["description" => "", "title" => ""], $head_article, new ArrayCollection([$favicon])); 117 $head_article_data = new NodeData(["description" => "", "title" => ""], $head_article, new ArrayCollection([$favicon]));
116 $head_edit_menu_data = new NodeData(["description" => "Menu et chemins", "title" => "Menu et chemins"], $head_edit_menu, new ArrayCollection([$favicon])); 118 $head_edit_menu_data = new NodeData(["description" => "Menu et chemins", "title" => "Menu et chemins"], $head_edit_menu, new ArrayCollection([$favicon]));
119 $head_new_page_data = new NodeData(["description" => "Nouvelle page", "title" => "Nouvelle page"], $head_new_page, new ArrayCollection([$favicon]));
117 120
121 /* -- table page -- */
118 $entityManager->persist($accueil); 122 $entityManager->persist($accueil);
119 $entityManager->persist($connection);
120 $entityManager->persist($article); 123 $entityManager->persist($article);
124 $entityManager->persist($connection);
121 $entityManager->persist($menu_paths); 125 $entityManager->persist($menu_paths);
122 $entityManager->persist($edit_page); 126 //$entityManager->persist($edit_page); // pas de page "Modification de la page"
123 $entityManager->persist($new_page); 127 $entityManager->persist($new_page);
128
129 /* -- table node -- */
124 $entityManager->persist($head_accueil); 130 $entityManager->persist($head_accueil);
125 $entityManager->persist($header); 131 $entityManager->persist($header);
126 $entityManager->persist($nav); 132 $entityManager->persist($nav);
@@ -131,20 +137,27 @@ function makeStartPage(EntityManager $entityManager){
131 $entityManager->persist($login); 137 $entityManager->persist($login);
132 $entityManager->persist($head_article); 138 $entityManager->persist($head_article);
133 $entityManager->persist($head_edit_menu); 139 $entityManager->persist($head_edit_menu);
134 $entityManager->persist($edit_menu); 140 $entityManager->persist($bloc_edit_menu);
141 $entityManager->persist($head_new_page);
142 $entityManager->persist($bloc_new_page);
143
144 /* -- table image -- */
135 $entityManager->persist($favicon); 145 $entityManager->persist($favicon);
136 $entityManager->persist($logo); 146 $entityManager->persist($logo);
137 $entityManager->persist($facebook); 147 $entityManager->persist($facebook);
138 $entityManager->persist($instagram); 148 $entityManager->persist($instagram);
139 $entityManager->persist($fond_piscine); 149 $entityManager->persist($fond_piscine);
150
151 /* -- table node_data -- */
140 $entityManager->persist($head_accueil_data); 152 $entityManager->persist($head_accueil_data);
141 $entityManager->persist($header_data); 153 $entityManager->persist($header_data);
142 $entityManager->persist($footer_data); 154 $entityManager->persist($footer_data);
143 $entityManager->persist($head_login_data); 155 $entityManager->persist($head_login_data);
144 $entityManager->persist($head_article_data); 156 $entityManager->persist($head_article_data);
145 $entityManager->persist($head_edit_menu_data); 157 $entityManager->persist($head_edit_menu_data);
146 $entityManager->flush(); 158 $entityManager->persist($head_new_page_data);
147 159
160 $entityManager->flush();
148 header('Location: ' . new URL); 161 header('Location: ' . new URL);
149 die; 162 die;
150} \ No newline at end of file 163} \ No newline at end of file