PageRenderTime 40ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/Meta/Controller/MetaController.php

https://github.com/kareypowell/croogo
PHP | 74 lines | 33 code | 8 blank | 33 comment | 5 complexity | e219323a60469d674e7ad5f62890b2a2 MD5 | raw file
  1. <?php
  2. App::uses('MetaAppController', 'Meta.Controller');
  3. /**
  4. * Meta Controller
  5. *
  6. * @category Meta.Controller
  7. * @package Croogo.Meta
  8. * @license http://www.opensource.org/licenses/mit-license.php The MIT License
  9. * @link http://www.croogo.org
  10. */
  11. class MetaController extends MetaAppController {
  12. /**
  13. * Components
  14. *
  15. * @var array
  16. * @access public
  17. */
  18. public $components = array(
  19. 'Search.Prg' => array(
  20. 'presetForm' => array(
  21. 'paramType' => 'querystring',
  22. ),
  23. 'commonProcess' => array(
  24. 'paramType' => 'querystring',
  25. 'filterEmpty' => true,
  26. ),
  27. ),
  28. );
  29. /**
  30. * Preset Variable Search
  31. *
  32. * @var array
  33. * @access public
  34. */
  35. public $presetVars = true;
  36. /**
  37. * Admin delete meta
  38. *
  39. * @param integer $id
  40. * @return void
  41. * @access public
  42. */
  43. public function admin_delete_meta($id = null) {
  44. $Meta = ClassRegistry::init('Meta.Meta');
  45. $success = false;
  46. if ($id != null && $Meta->delete($id)) {
  47. $success = true;
  48. } else {
  49. if (!$Meta->exists($id)) {
  50. $success = true;
  51. }
  52. }
  53. $success = array('success' => $success);
  54. $this->set(compact('success'));
  55. $this->set('_serialize', 'success');
  56. }
  57. /**
  58. * Admin add meta
  59. *
  60. * @return void
  61. * @access public
  62. */
  63. public function admin_add_meta() {
  64. $this->layout = 'ajax';
  65. }
  66. }