summaryrefslogtreecommitdiff
path: root/src/controller/ajax.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/controller/ajax.php')
-rw-r--r--src/controller/ajax.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/controller/ajax.php b/src/controller/ajax.php
index 130c4c6..bcba3f2 100644
--- a/src/controller/ajax.php
+++ b/src/controller/ajax.php
@@ -58,6 +58,23 @@ if($_SERVER['CONTENT_TYPE'] === 'application/json' && isset($_GET['action']))
58 } 58 }
59 die; 59 die;
60 } 60 }
61 // inversion de la position de deux noeuds
62 elseif($_GET['action'] === 'switch_positions' && isset($json['id1']) && isset($json['id2']))
63 {
64 $director = new Director($entityManager);
65 $director->makeArticleNode($json['id1']);
66 $node1 = $director->getRootNode();
67 $director->makeArticleNode($json['id2']);
68 $node2 = $director->getRootNode();
69
70 $tmp = $node1->getPosition();
71 $node1->setPosition($node2->getPosition());
72 $node2->setPosition($tmp);
73 $entityManager->flush();
74
75 echo json_encode(['success' => true]);
76 die;
77 }
61} 78}
62 79
63// détection des requêtes d'upload d'image de tinymce 80// détection des requêtes d'upload d'image de tinymce