v1.php 849 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace zin;
  3. require_once dirname(__DIR__) . DS . 'modaldialog' . DS . 'v1.php';
  4. class modal extends modalDialog
  5. {
  6. /**
  7. * @var mixed[]
  8. */
  9. protected static $defineProps = array(
  10. 'id?:string="$GID"',
  11. 'modalProps?:array'
  12. );
  13. /**
  14. * @var mixed[]
  15. */
  16. protected static $defaultProps = array(
  17. 'modalProps' => array(),
  18. 'rawContent' => false,
  19. 'hookContent' => false
  20. );
  21. protected function build()
  22. {
  23. list($id, $modalProps) = $this->prop(array('id', 'modalProps'));
  24. $this->setProp($modalProps);
  25. return div
  26. (
  27. setClass('modal'),
  28. setID($id),
  29. set($this->props->skip(array_merge(array_keys($modalProps), array_keys(static::definedPropsList())))),
  30. parent::build()
  31. );
  32. }
  33. }