@@ 358-374 (lines=17) @@ | ||
355 | $this->forward('Pages:sorting'); |
|
356 | } |
|
357 | ||
358 | public function actionMoveUp($id, $step = 1) |
|
359 | { |
|
360 | $this->page = $this->em->find("WebCMS\Entity\Page", $id); |
|
361 | ||
362 | if ($this->page->getParent()) { |
|
363 | $repository = $this->em->getRepository('WebCMS\Entity\Page'); |
|
364 | $repository->moveUp($this->page, $step); |
|
365 | ||
366 | $this->flashMessage('Page has been moved up.', 'success'); |
|
367 | } else { |
|
368 | $this->flashMessage('Page has not been moved up, because it is root page.', 'warning'); |
|
369 | } |
|
370 | ||
371 | if (!$this->isAjax()) { |
|
372 | $this->forward('Pages:default'); |
|
373 | } |
|
374 | } |
|
375 | ||
376 | public function actionMoveDown($id, $step = 1) |
|
377 | { |
|
@@ 376-392 (lines=17) @@ | ||
373 | } |
|
374 | } |
|
375 | ||
376 | public function actionMoveDown($id, $step = 1) |
|
377 | { |
|
378 | $this->page = $this->em->find("WebCMS\Entity\Page", $id); |
|
379 | ||
380 | if ($this->page->getParent()) { |
|
381 | $repository = $this->em->getRepository('WebCMS\Entity\Page'); |
|
382 | $repository->moveDown($this->page, $step); |
|
383 | ||
384 | $this->flashMessage('Page has been moved down.', 'success'); |
|
385 | } else { |
|
386 | $this->flashMessage('Page has not been moved up, because it is root page.', 'warning'); |
|
387 | } |
|
388 | ||
389 | if (!$this->isAjax()) { |
|
390 | $this->forward('Pages:default'); |
|
391 | } |
|
392 | } |
|
393 | } |
|
394 |