summaryrefslogtreecommitdiff
path: root/src/controller
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2025-03-31 22:50:11 +0200
committerpolo <ordipolo@gmx.fr>2025-03-31 22:50:11 +0200
commit7f13ca69bb71a0eb477cbf4f4bfcd08b2843bf9b (patch)
tree93cdc918764a09c1ebde1cea0c25f24324834850 /src/controller
parent43c962f442165327d73756c62501ff823d43f9f3 (diff)
downloadcms-7f13ca69bb71a0eb477cbf4f4bfcd08b2843bf9b.zip
inversion de deux articles
Diffstat (limited to 'src/controller')
-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