| @@ 16-29 (lines=14) @@ | ||
| 13 | private $_cmsContentParameter = null; |
|
| 14 | private $_blockDefaultClass = 'Alpixel\Bundle\CMSBundle\Entity\Block'; |
|
| 15 | ||
| 16 | public function editContentAction() |
|
| 17 | { |
|
| 18 | $object = $this->admin->getSubject(); |
|
| 19 | if (!$object) { |
|
| 20 | throw new NotFoundHttpException(sprintf('unable to find the object')); |
|
| 21 | } |
|
| 22 | ||
| 23 | $instanceAdmin = $this->admin->getConfigurationPool()->getAdminByClass(get_class($object)); |
|
| 24 | if ($instanceAdmin !== null) { |
|
| 25 | return $this->redirect($instanceAdmin->generateUrl('edit', ['id' => $object->getId()])); |
|
| 26 | } |
|
| 27 | ||
| 28 | throw new NotFoundHttpException(sprintf('unable to find a class admin for the %s class', get_class($content))); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function listAction(Request $request = null) |
|
| 32 | { |
|
| @@ 12-26 (lines=15) @@ | ||
| 9 | ||
| 10 | class AdminNodeController extends Controller |
|
| 11 | { |
|
| 12 | public function editContentAction() |
|
| 13 | { |
|
| 14 | $object = $this->admin->getSubject(); |
|
| 15 | ||
| 16 | if (!$object) { |
|
| 17 | throw new NotFoundHttpException(sprintf('unable to find the object')); |
|
| 18 | } |
|
| 19 | ||
| 20 | $instanceAdmin = $this->admin->getConfigurationPool()->getAdminByClass(get_class($object)); |
|
| 21 | if ($instanceAdmin !== null) { |
|
| 22 | return $this->redirect($instanceAdmin->generateUrl('edit', ['id' => $object->getId()])); |
|
| 23 | } |
|
| 24 | ||
| 25 | throw new NotFoundHttpException(sprintf('unable to find a class admin for the %s class', get_class($object))); |
|
| 26 | } |
|
| 27 | ||
| 28 | public function createTranslationAction(Request $request) |
|
| 29 | { |
|