diff options
| author | polo-pc-greta <ordipolo@gmx.fr> | 2025-04-07 21:38:12 +0200 |
|---|---|---|
| committer | polo-pc-greta <ordipolo@gmx.fr> | 2025-04-07 21:38:12 +0200 |
| commit | 1937a2f49ebe920b79604cb5df3649f9f1dff738 (patch) | |
| tree | fac9a39aae9690b0e5a860bdb2cc88565e83daac /src/controller | |
| parent | 09bea09c8157ff45279f0d06aa9d313448c0bec5 (diff) | |
| download | cms-1937a2f49ebe920b79604cb5df3649f9f1dff738.tar.gz cms-1937a2f49ebe920b79604cb5df3649f9f1dff738.tar.bz2 cms-1937a2f49ebe920b79604cb5df3649f9f1dff738.zip | |
bouton suppression après création d'une "news"
Diffstat (limited to 'src/controller')
| -rw-r--r-- | src/controller/ajax.php | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/src/controller/ajax.php b/src/controller/ajax.php index 4863681..a4b61e4 100644 --- a/src/controller/ajax.php +++ b/src/controller/ajax.php | |||
| @@ -29,10 +29,6 @@ if($_SERVER['CONTENT_TYPE'] === 'application/json' && isset($_GET['action'])) | |||
| 29 | } | 29 | } |
| 30 | else{ | 30 | else{ |
| 31 | $content = Security::secureString($json['content']); | 31 | $content = Security::secureString($json['content']); |
| 32 | if($content === ''){ | ||
| 33 | echo json_encode(['success' => false, 'message' => 'pas de données à sauvegarder']); | ||
| 34 | die; | ||
| 35 | } | ||
| 36 | } | 32 | } |
| 37 | 33 | ||
| 38 | // nouvel article | 34 | // nouvel article |
| @@ -43,12 +39,7 @@ if($_SERVER['CONTENT_TYPE'] === 'application/json' && isset($_GET['action'])) | |||
| 43 | $node = $director->getNode(); // = <section> | 39 | $node = $director->getNode(); // = <section> |
| 44 | 40 | ||
| 45 | if(is_array($content)){ | 41 | if(is_array($content)){ |
| 46 | // | ||
| 47 | //$timestamp = time(); // int | ||
| 48 | $date = new \DateTime($content['d']); | 42 | $date = new \DateTime($content['d']); |
| 49 | |||
| 50 | //echo substr($content['i'], 1) . ' '; | ||
| 51 | //echo $article_id;die; | ||
| 52 | $article = new Article($content['i'], $date, $content['t'], $content['p']); | 43 | $article = new Article($content['i'], $date, $content['t'], $content['p']); |
| 53 | $article_node = new Node('new', 'i' . (string)$date->getTimestamp(), [], count($node->getChildren()) + 1, $node, $node->getPage(), $article); | 44 | $article_node = new Node('new', 'i' . (string)$date->getTimestamp(), [], count($node->getChildren()) + 1, $node, $node->getPage(), $article); |
| 54 | 45 | ||
