diff options
| author | polo <ordipolo@gmx.fr> | 2025-10-09 01:35:52 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2025-10-09 01:35:52 +0200 |
| commit | 15cbf5d56b4644151d59fee512f5f8fbe496caa3 (patch) | |
| tree | 0da411f4aff53a0249cf3d59ea13f3786897b740 /src/controller/PageManagementController.php | |
| parent | 9f88389d78755d7c69c29e9db8f114fd1dbef034 (diff) | |
| download | cms-15cbf5d56b4644151d59fee512f5f8fbe496caa3.tar.gz cms-15cbf5d56b4644151d59fee512f5f8fbe496caa3.tar.bz2 cms-15cbf5d56b4644151d59fee512f5f8fbe496caa3.zip | |
pagination partie 2, nouvelles fonctions + renommage dans Director, ArticleController::fetch, et en JS: fetchArticles, insertLocalDates, modifs dans changePaginationLimit, dans les vues
Diffstat (limited to 'src/controller/PageManagementController.php')
| -rw-r--r-- | src/controller/PageManagementController.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/controller/PageManagementController.php b/src/controller/PageManagementController.php index 2cc88a5..8efcb79 100644 --- a/src/controller/PageManagementController.php +++ b/src/controller/PageManagementController.php | |||
| @@ -334,4 +334,21 @@ class PageManagementController | |||
| 334 | } | 334 | } |
| 335 | die; | 335 | die; |
| 336 | } | 336 | } |
| 337 | static public function changePaginationLimit(EntityManager $entityManager, array $json): void | ||
| 338 | { | ||
| 339 | if(isset($json['id']) && isset($json['pagination_limit'])){ | ||
| 340 | $director = new Director($entityManager); | ||
| 341 | $director->findNodeById($json['id']); | ||
| 342 | $old_limit = $director->getNode()->getNodeData()->getPaginationLimit() ?? 12; | ||
| 343 | $director->getNode()->getNodeData()->setPaginationLimit((int)$json['pagination_limit']); // attention conversion? | ||
| 344 | |||
| 345 | $entityManager->flush(); | ||
| 346 | |||
| 347 | echo json_encode(['success' => true, 'old_limit' => $old_limit, 'new_limit' => $json['pagination_limit']]); | ||
| 348 | } | ||
| 349 | else{ | ||
| 350 | echo json_encode(['success' => false]); | ||
| 351 | } | ||
| 352 | die; | ||
| 353 | } | ||
| 337 | } \ No newline at end of file | 354 | } \ No newline at end of file |
