summaryrefslogtreecommitdiff
path: root/src/controller/post.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/controller/post.php')
-rw-r--r--src/controller/post.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/controller/post.php b/src/controller/post.php
index 7e6ed53..acad1ce 100644
--- a/src/controller/post.php
+++ b/src/controller/post.php
@@ -132,14 +132,14 @@ if($_SERVER['REQUEST_METHOD'] === 'POST' && $_SESSION['admin'] === true)
132 $main = $director->getNode(); 132 $main = $director->getNode();
133 $position = count($main->getChildren()) + 1; // position dans la fraterie 133 $position = count($main->getChildren()) + 1; // position dans la fraterie
134 134
135 $blocs_true_names = ['blog', 'grid', 'calendar', 'galery', 'form']; // même liste dans FormBuilder.php 135 $blocks = ['blog', 'grid', 'calendar', 'galery', 'form']; // même liste dans FormBuilder.php
136 if(!in_array($_POST["bloc_select"], $blocs_true_names, true)) // 3è param: contrôle du type 136 if(!in_array($_POST["bloc_select"], $blocks, true)) // 3è param: contrôle du type
137 { 137 {
138 header("Location: " . new URL(['page' => $_GET['page'], 'error' => 'bad_bloc_type'])); 138 header("Location: " . new URL(['page' => $_GET['page'], 'error' => 'bad_bloc_type']));
139 die; 139 die;
140 } 140 }
141 141
142 if($_POST["bloc_select"] === 'calendar'){ 142 if($_POST["bloc_select"] === 'calendar' || $_POST["bloc_select"] === 'form'){
143 $dql = 'SELECT n FROM App\Entity\Node n WHERE n.page = :page AND n.name_node = :name'; // noeud 'head' de la page 143 $dql = 'SELECT n FROM App\Entity\Node n WHERE n.page = :page AND n.name_node = :name'; // noeud 'head' de la page
144 $bulk_data = $entityManager 144 $bulk_data = $entityManager
145 ->createQuery($dql) 145 ->createQuery($dql)
@@ -152,7 +152,7 @@ if($_SERVER['REQUEST_METHOD'] === 'POST' && $_SESSION['admin'] === true)
152 die; 152 die;
153 } 153 }
154 154
155 $bulk_data[0]->addAttribute('css_array', 'calendar'); 155 $bulk_data[0]->addAttribute('css_array', $_POST["bloc_select"]);
156 $entityManager->persist($bulk_data[0]); 156 $entityManager->persist($bulk_data[0]);
157 } 157 }
158 158