v1.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace zin;
  3. class commentDialog extends wg
  4. {
  5. /**
  6. * @var mixed[]
  7. */
  8. protected static $defineProps = array(
  9. 'id?: string="comment-dialog"',
  10. 'title?:string',
  11. 'url?:string',
  12. 'name?:string="comment"',
  13. 'method?:string="post"',
  14. 'load?: bool|string'
  15. );
  16. protected function build()
  17. {
  18. global $lang;
  19. $id = $this->prop('id');
  20. $title = $this->prop('title');
  21. $name = $this->prop('name');
  22. $url = $this->prop('url');
  23. $method = $this->prop('method');
  24. $load = $this->prop('load');
  25. if(empty($title)) $title = $lang->action->create;
  26. return modal
  27. (
  28. setID($id),
  29. set::modalProps(array('title' => $title)),
  30. commentForm
  31. (
  32. set::url($url),
  33. set::method($method),
  34. set::name($name),
  35. set::closeModal(true),
  36. set::load($load)
  37. )
  38. );
  39. }
  40. }