diff options
| author | polo <ordipolo@gmx.fr> | 2025-03-31 22:50:11 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2025-03-31 22:50:11 +0200 |
| commit | 7f13ca69bb71a0eb477cbf4f4bfcd08b2843bf9b (patch) | |
| tree | 93cdc918764a09c1ebde1cea0c25f24324834850 /src/controller/ajax.php | |
| parent | 43c962f442165327d73756c62501ff823d43f9f3 (diff) | |
| download | cms-7f13ca69bb71a0eb477cbf4f4bfcd08b2843bf9b.tar.gz cms-7f13ca69bb71a0eb477cbf4f4bfcd08b2843bf9b.tar.bz2 cms-7f13ca69bb71a0eb477cbf4f4bfcd08b2843bf9b.zip | |
inversion de deux articles
Diffstat (limited to 'src/controller/ajax.php')
| -rw-r--r-- | src/controller/ajax.php | 17 |
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 |
