InfoController.php 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. namespace Muzich\CoreBundle\Controller;
  3. use Muzich\CoreBundle\lib\Controller;
  4. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\HttpKernel\Exception\HttpException;
  7. class InfoController extends Controller
  8. {
  9. /**
  10. *
  11. * @Template()
  12. */
  13. public function aboutAction()
  14. {
  15. return array();
  16. }
  17. /**
  18. *
  19. * @Template()
  20. */
  21. public function developmentAction()
  22. {
  23. return array();
  24. }
  25. /**
  26. *
  27. * @Template()
  28. */
  29. public function sitesAction()
  30. {
  31. return array();
  32. }
  33. public function teapotAction()
  34. {
  35. throw new HttpException(418, "I'm a teapot !");
  36. }
  37. /**
  38. *
  39. * @Template()
  40. */
  41. public function cguAction()
  42. {
  43. return array();
  44. }
  45. public function helpboxAction($ressource_id)
  46. {
  47. if (!in_array($ressource_id, array(
  48. 'element_add_url',
  49. 'tags_prompt'
  50. )))
  51. {
  52. return $this->jsonNotFoundResponse();
  53. }
  54. return $this->jsonResponse(array(
  55. 'status' => 'success',
  56. 'data' => $this->render('MuzichCoreBundle:Helpbox:'.$ressource_id.'.html.twig')
  57. ->getContent()
  58. ));
  59. }
  60. }