summaryrefslogtreecommitdiff
path: root/src/controller
diff options
context:
space:
mode:
Diffstat (limited to 'src/controller')
-rw-r--r--src/controller/ajax.php9
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