PageRenderTime 48ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/plugins/vjCommentPlugin/lib/tools/htmlpurifier/library/HTMLPurifier/ChildDef.php

https://bitbucket.org/Kudlaty/360kdw
PHP | 48 lines | 11 code | 6 blank | 31 comment | 0 complexity | 281eaa00a5e3ff98b611b5ebca97bcb0 MD5 | raw file
Possible License(s): LGPL-2.1
  1. <?php
  2. /**
  3. * Defines allowed child nodes and validates tokens against it.
  4. */
  5. abstract class HTMLPurifier_ChildDef
  6. {
  7. /**
  8. * Type of child definition, usually right-most part of class name lowercase.
  9. * Used occasionally in terms of context.
  10. */
  11. public $type;
  12. /**
  13. * Bool that indicates whether or not an empty array of children is okay
  14. *
  15. * This is necessary for redundant checking when changes affecting
  16. * a child node may cause a parent node to now be disallowed.
  17. */
  18. public $allow_empty;
  19. /**
  20. * Lookup array of all elements that this definition could possibly allow
  21. */
  22. public $elements = array();
  23. /**
  24. * Get lookup of tag names that should not close this element automatically.
  25. * All other elements will do so.
  26. */
  27. public function getAllowedElements($config) {
  28. return $this->elements;
  29. }
  30. /**
  31. * Validates nodes according to definition and returns modification.
  32. *
  33. * @param $tokens_of_children Array of HTMLPurifier_Token
  34. * @param $config HTMLPurifier_Config object
  35. * @param $context HTMLPurifier_Context object
  36. * @return bool true to leave nodes as is
  37. * @return bool false to remove parent node
  38. * @return array of replacement child tokens
  39. */
  40. abstract public function validateChildren($tokens_of_children, $config, $context);
  41. }
  42. // vim: et sw=4 sts=4