diff options
| author | polo <ordipolo@gmx.fr> | 2025-05-22 12:38:22 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2025-05-22 12:38:22 +0200 |
| commit | f724ce1c7432d5e67f01db25e6d1cdb9453b0882 (patch) | |
| tree | d7ebe3d7140cade0612b868cbeb79f22543b4ade /src | |
| parent | 5b85933ab78fa96600af095b5682f0341a0372b7 (diff) | |
| download | cms-f724ce1c7432d5e67f01db25e6d1cdb9453b0882.tar.gz cms-f724ce1c7432d5e67f01db25e6d1cdb9453b0882.tar.bz2 cms-f724ce1c7432d5e67f01db25e6d1cdb9453b0882.zip | |
conflit titre de page dans NodeData
Diffstat (limited to 'src')
| -rw-r--r-- | src/controller/ajax.php | 2 | ||||
| -rw-r--r-- | src/controller/post.php | 2 | ||||
| -rw-r--r-- | src/view/HeadBuilder.php | 5 |
3 files changed, 6 insertions, 3 deletions
diff --git a/src/controller/ajax.php b/src/controller/ajax.php index a820136..18f303b 100644 --- a/src/controller/ajax.php +++ b/src/controller/ajax.php | |||
| @@ -369,7 +369,7 @@ if($_SERVER['CONTENT_TYPE'] === 'application/json'){ | |||
| 369 | $data = file_get_contents('php://input'); | 369 | $data = file_get_contents('php://input'); |
| 370 | $json = json_decode($data, true); | 370 | $json = json_decode($data, true); |
| 371 | 371 | ||
| 372 | // tite de la page | 372 | // titre de la page |
| 373 | if($_GET['page_edit'] === 'page_title'){ | 373 | if($_GET['page_edit'] === 'page_title'){ |
| 374 | $page = $entityManager->find('App\Entity\Page', $json['page_id']); | 374 | $page = $entityManager->find('App\Entity\Page', $json['page_id']); |
| 375 | $page->setPageName(htmlspecialchars($json['title'])); | 375 | $page->setPageName(htmlspecialchars($json['title'])); |
diff --git a/src/controller/post.php b/src/controller/post.php index 2aa7780..deacafb 100644 --- a/src/controller/post.php +++ b/src/controller/post.php | |||
| @@ -55,7 +55,7 @@ if($_SERVER['REQUEST_METHOD'] === 'POST' && $_SESSION['admin'] === true) | |||
| 55 | $node->useDefaultAttributes(); // fichiers CSS et JS | 55 | $node->useDefaultAttributes(); // fichiers CSS et JS |
| 56 | 56 | ||
| 57 | $data = new NodeData([ | 57 | $data = new NodeData([ |
| 58 | 'title' => trim(htmlspecialchars($_POST["page_name"])), | 58 | // pas de titre, il est dans $page |
| 59 | 'description' => trim(htmlspecialchars($_POST["page_description"]))], | 59 | 'description' => trim(htmlspecialchars($_POST["page_description"]))], |
| 60 | $node); | 60 | $node); |
| 61 | 61 | ||
diff --git a/src/view/HeadBuilder.php b/src/view/HeadBuilder.php index 4b913b9..16fe3e5 100644 --- a/src/view/HeadBuilder.php +++ b/src/view/HeadBuilder.php | |||
| @@ -47,7 +47,10 @@ class HeadBuilder extends AbstractBuilder | |||
| 47 | $js .= '<script src="js/tinymce.js"></script>' . "\n"; | 47 | $js .= '<script src="js/tinymce.js"></script>' . "\n"; |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | // titre et description | 50 | // titre |
| 51 | $title = Director::$page_path->getLast()->getPageName(); | ||
| 52 | |||
| 53 | // description | ||
| 51 | if(!empty($node->getNodeData()->getData())) | 54 | if(!empty($node->getNodeData()->getData())) |
| 52 | { | 55 | { |
| 53 | extract($node->getNodeData()->getData()); | 56 | extract($node->getNodeData()->getData()); |
