Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[first commit]

  • Loading branch information...
commit 3d517e192e32ce1ebe0016a7615267c1c5306687 0 parents
@nibsirahsieu authored
Showing with 21,092 additions and 0 deletions.
  1. +30 −0 config/sample.app.yml
  2. +20 −0 config/sfNestedCommentPluginConfiguration.class.php
  3. +32 −0 config/sfNestedCommentPlugin_schema.xml
  4. +45 −0 lib/behavior/CommentableBehavior.php
  5. +45 −0 lib/behavior/templates/getComments.php
  6. +31 −0 lib/behavior/templates/nbComments.php
  7. +15 −0 lib/behavior/templates/objectAttributes.php
  8. +83 −0 lib/filter/base/BasesfNestedCommentFormFilter.class.php
  9. +19 −0 lib/filter/sfNestedCommentFormFilter.class.php
  10. +67 −0 lib/form/base/BasesfNestedCommentForm.class.php
  11. +28 −0 lib/form/sfNestedCommentAdminForm.class.php
  12. +51 −0 lib/form/sfNestedCommentForm.class.php
  13. +21 −0 lib/form/sfNestedCommentFrontForm.class.php
  14. +45 −0 lib/helper/sfNestedCommentPaginationHelper.php
  15. +88 −0 lib/model/map/sfNestedCommentTableMap.php
  16. +2,733 −0 lib/model/om/BasesfNestedComment.php
  17. +1,291 −0 lib/model/om/BasesfNestedCommentPeer.php
  18. +951 −0 lib/model/om/BasesfNestedCommentQuery.php
  19. +73 −0 lib/model/plugin/PluginsfNestedComment.php
  20. +5 −0 lib/model/plugin/PluginsfNestedCommentPeer.php
  21. +39 −0 lib/model/plugin/PluginsfNestedCommentQuery.php
  22. +48 −0 lib/model/sfNestedComment.php
  23. +22 −0 lib/model/sfNestedCommentPeer.php
  24. +22 −0 lib/model/sfNestedCommentQuery.php
  25. +31 −0 lib/sfNestedCommentConfig.class.php
  26. +92 −0 lib/sfNestedCommentTools.class.php
  27. +216 −0 lib/sfNestedCommentsRenderer.class.php
  28. +1 −0  lib/vendor/htmlpurifier/.gitattributes
  29. +22 −0 lib/vendor/htmlpurifier/.gitignore
  30. +9 −0 lib/vendor/htmlpurifier/CREDITS
  31. +504 −0 lib/vendor/htmlpurifier/LICENSE
  32. +24 −0 lib/vendor/htmlpurifier/README
  33. +1 −0  lib/vendor/htmlpurifier/VERSION
  34. +11 −0 lib/vendor/htmlpurifier/library/HTMLPurifier.auto.php
  35. +21 −0 lib/vendor/htmlpurifier/library/HTMLPurifier.autoload.php
  36. +23 −0 lib/vendor/htmlpurifier/library/HTMLPurifier.func.php
  37. +212 −0 lib/vendor/htmlpurifier/library/HTMLPurifier.includes.php
  38. +30 −0 lib/vendor/htmlpurifier/library/HTMLPurifier.kses.php
  39. +11 −0 lib/vendor/htmlpurifier/library/HTMLPurifier.path.php
  40. +237 −0 lib/vendor/htmlpurifier/library/HTMLPurifier.php
  41. +206 −0 lib/vendor/htmlpurifier/library/HTMLPurifier.safe-includes.php
  42. +128 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrCollections.php
  43. +123 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef.php
  44. +87 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/CSS.php
  45. +21 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/AlphaValue.php
  46. +87 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Background.php
  47. +133 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php
  48. +43 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Border.php
  49. +78 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Color.php
  50. +38 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Composite.php
  51. +28 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php
  52. +54 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Filter.php
  53. +149 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Font.php
  54. +72 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/FontFamily.php
  55. +40 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php
  56. +47 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Length.php
  57. +78 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ListStyle.php
  58. +58 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Multiple.php
  59. +69 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Number.php
  60. +40 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Percentage.php
  61. +38 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php
  62. +52 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/URI.php
  63. +65 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/Enum.php
  64. +28 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php
  65. +34 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Class.php
  66. +32 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Color.php
  67. +21 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php
  68. +70 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ID.php
  69. +41 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Length.php
  70. +53 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php
  71. +41 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/MultiLength.php
  72. +52 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Nmtokens.php
  73. +48 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Pixels.php
  74. +73 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/Integer.php
  75. +73 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/Lang.php
  76. +34 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/Switch.php
  77. +15 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/Text.php
  78. +77 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/URI.php
  79. +17 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email.php
  80. +21 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php
  81. +62 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Host.php
  82. +39 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv4.php
  83. +99 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv6.php
  84. +56 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrTransform.php
  85. +23 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrTransform/Background.php
  86. +19 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrTransform/BdoDir.php
  87. +23 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrTransform/BgColor.php
  88. +36 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrTransform/BoolToCSS.php
  89. +18 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrTransform/Border.php
  90. +58 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrTransform/EnumToCSS.php
  91. +43 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrTransform/ImgRequired.php
  92. +44 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrTransform/ImgSpace.php
  93. +40 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrTransform/Input.php
  94. +28 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrTransform/Lang.php
  95. +27 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrTransform/Length.php
  96. +21 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrTransform/Name.php
  97. +27 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrTransform/NameSync.php
  98. +15 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeEmbed.php
  99. +16 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeObject.php
  100. +63 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeParam.php
  101. +16 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrTransform/ScriptRequired.php
  102. +18 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrTransform/Textarea.php
  103. +77 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrTypes.php
  104. +162 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/AttrValidator.php
  105. +98 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/Bootstrap.php
  106. +301 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/CSSDefinition.php
  107. +48 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ChildDef.php
  108. +48 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ChildDef/Chameleon.php
  109. +90 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ChildDef/Custom.php
  110. +20 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ChildDef/Empty.php
  111. +26 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ChildDef/Optional.php
  112. +117 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ChildDef/Required.php
  113. +88 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ChildDef/StrictBlockquote.php
  114. +142 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ChildDef/Table.php
  115. +580 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/Config.php
  116. +158 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema.php
  117. +44 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php
  118. +106 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/Xml.php
  119. +11 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/Exception.php
  120. +42 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange.php
  121. +77 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Directive.php
  122. +37 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Id.php
  123. +180 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/InterchangeBuilder.php
  124. +206 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/Validator.php
  125. +66 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/ValidatorAtom.php
  126. BIN  lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema.ser
  127. +8 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedClasses.txt
  128. +12 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedFrameTargets.txt
  129. +9 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRel.txt
  130. +9 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRev.txt
  131. +19 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.ClassUseCDATA.txt
  132. +11 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultImageAlt.txt
  133. +9 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImage.txt
  134. +8 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImageAlt.txt
  135. +10 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultTextDir.txt
  136. +16 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.EnableID.txt
  137. +8 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.ForbiddenClasses.txt
  138. +5 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklist.txt
  139. +9 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklistRegexp.txt
  140. +12 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefix.txt
  141. +14 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefixLocal.txt
  142. +31 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.AutoParagraph.txt
  143. +12 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Custom.txt
  144. +11 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.DisplayLinkURI.txt
  145. +12 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Linkify.txt
  146. +12 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.DocURL.txt
  147. +12 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.txt
  148. +11 −0 ...ndor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions.txt
  149. +15 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.txt
  150. +46 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.txt
  151. +11 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveSpansWithoutAttributes.txt
  152. +8 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowImportant.txt
  153. +11 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowTricky.txt
  154. +18 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowedProperties.txt
  155. +11 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.DefinitionRev.txt
  156. +13 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.ForbiddenProperties.txt
  157. +16 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.MaxImgLength.txt
  158. +10 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.Proprietary.txt
  159. +14 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Cache.DefinitionImpl.txt
  160. +13 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPath.txt
  161. +18 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyFixLt.txt
  162. +12 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt
  163. +28 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt
  164. +14 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt
  165. +17 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.DirectLexLineNumberSyncInterval.txt
  166. +15 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt
  167. +10 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt
  168. +7 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt
  169. +13 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt
  170. +19 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt
  171. +10 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.Language.txt
  172. +34 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.LexerImpl.txt
  173. +16 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.MaintainLineNumbers.txt
  174. +11 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.NormalizeNewlines.txt
  175. +12 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveInvalidImg.txt
  176. +11 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveProcessingInstructions.txt
  177. +12 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveScriptContents.txt
  178. +11 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.Custom.txt
  179. +14 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Escaping.txt
  180. +29 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Scope.txt
  181. +16 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.TidyImpl.txt
  182. +74 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt
  183. +16 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt
  184. +25 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt
  185. +19 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt
  186. +23 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt
  187. +20 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt
  188. +11 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt
  189. +18 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt
  190. +23 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt
  191. +9 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt
  192. +33 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt
  193. +16 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt
  194. +11 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt
  195. +11 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt
  196. +21 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt
  197. +20 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt
  198. +14 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt
  199. +12 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt
  200. +12 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt
  201. +13 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt
  202. +13 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt
  203. +9 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt
  204. +8 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt
  205. +24 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt
  206. +8 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt
  207. +8 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt
  208. +11 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt
  209. +10 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt
  210. +11 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt
  211. +13 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt
  212. +14 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt
  213. +25 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt
  214. +7 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt
  215. +17 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt
  216. +17 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Base.txt
  217. +10 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt
  218. +11 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt
  219. +11 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt
  220. +14 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt
  221. +11 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt
  222. +13 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt
  223. +15 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt
  224. +19 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Host.txt
  225. +9 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt
  226. +13 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt
  227. +83 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt
  228. +17 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt
  229. +30 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt
  230. +9 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt
  231. +3 −0  lib/vendor/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/info.ini
  232. +155 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ContentSets.php
  233. +82 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/Context.php
  234. +39 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/Definition.php
  235. +108 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/DefinitionCache.php
  236. +62 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator.php
  237. +43 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php
  238. +46 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Memory.php
  239. +47 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in
  240. +39 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/DefinitionCache/Null.php
  241. +172 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer.php
  242. +3 −0  lib/vendor/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/README
  243. +91 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/DefinitionCacheFactory.php
  244. +60 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/Doctype.php
  245. +103 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/DoctypeRegistry.php
  246. +183 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ElementDef.php
  247. +426 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/Encoder.php
  248. +44 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/EntityLookup.php
  249. +1 −0  lib/vendor/htmlpurifier/library/HTMLPurifier/EntityLookup/entities.ser
  250. +144 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/EntityParser.php
  251. +209 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ErrorCollector.php
  252. +60 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/ErrorStruct.php
  253. +12 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/Exception.php
  254. +46 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/Filter.php
  255. +135 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/Filter/ExtractStyleBlocks.php
  256. +39 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/Filter/YouTube.php
  257. +229 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/Generator.php
  258. +425 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLDefinition.php
  259. +244 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule.php
  260. +31 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/Bdo.php
  261. +26 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/CommonAttributes.php
  262. +38 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/Edit.php
  263. +118 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/Forms.php
  264. +31 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/Hypertext.php
  265. +40 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/Image.php
  266. +143 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/Legacy.php
  267. +37 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/List.php
  268. +21 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/Name.php
  269. +14 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php
  270. +47 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/Object.php
  271. +36 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/Presentation.php
  272. +33 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/Proprietary.php
  273. +27 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/Ruby.php
  274. +34 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeEmbed.php
  275. +53 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeObject.php
  276. +54 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/Scripting.php
  277. +24 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/StyleAttribute.php
  278. +66 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/Tables.php
  279. +23 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/Target.php
  280. +71 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/Text.php
  281. +207 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy.php
  282. +24 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Name.php
  283. +24 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Proprietary.php
  284. +21 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Strict.php
  285. +9 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Transitional.php
  286. +17 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/XHTML.php
  287. +161 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php
  288. +14 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModule/XMLCommonAttributes.php
  289. +403 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/HTMLModuleManager.php
  290. +53 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/IDAccumulator.php
  291. +239 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/Injector.php
  292. +345 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/Injector/AutoParagraph.php
  293. +26 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/Injector/DisplayLinkURI.php
  294. +46 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/Injector/Linkify.php
  295. +45 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/Injector/PurifierLinkify.php
  296. +51 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/Injector/RemoveEmpty.php
  297. +60 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php
  298. +91 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/Injector/SafeObject.php
  299. +163 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/Language.php
  300. +12 −0 lib/vendor/htmlpurifier/library/HTMLPurifier/Language/classes/en-x-test.php
Sorry, we could not display the entire diff because too many files (400) changed.
30 config/sample.app.yml
@@ -0,0 +1,30 @@
+#all:
+# sfNestedComment:
+# use_ajax: true # enable posting of comments in Ajax
+# max_recent: 5 # number of comments to display in the recent sidebar widget
+# enable: true # enable comments by default on new commentable object
+# use_gravatar: true # use gravatar
+ # set to 0 for unlimited comments
+# automoderation: first_post # triggers the automoderation of comments. Possible values are:
+ # true: comments are not published until a moderator accepts them
+ # first_post: the first comment of a user must be accepted, subsequent posts are accepted automatically
+ # false: comments are automatically accepted and published
+
+# nested: true # enable nested comments
+# nested_depth: 3 # max depth of comments
+# paging: true # enable comments paging
+# max_per_page: 5 # number of comments to display
+# sort_type: desc #
+# mail_alert: true # send an email to the blog owner when a comment is posted.
+ # Possible values are:
+ # true: send an email for every posted comment
+ # moderated: send an email for every automoderated comment
+# from_email: johndoe@xmail.com
+# allowed_tags:
+# a: <a>
+# blockquote: <blockquote>
+# code: <code>
+# em: <em>
+# i: <i>
+# p: <p>
+# strong: <strong>
20 config/sfNestedCommentPluginConfiguration.class.php
@@ -0,0 +1,20 @@
+<?php
+class sfNestedCommentPluginConfiguration extends sfPluginConfiguration
+{
+ public function initialize()
+ {
+ if ($this->configuration instanceof sfApplicationConfiguration)
+ {
+ if (in_array('sfNestedComment', sfConfig::get('sf_enabled_modules', array())))
+ {
+ $this->dispatcher->connect('routing.load_configuration', array('sfNestedCommentConfig', 'listenToRoutingLoadConfigurationEvent'));
+ $this->dispatcher->connect('context.load_factories', array('sfNestedCommentConfig', 'listenToContextLoadFactoriesEvent'));
+ }
+ if (in_array('sfNestedCommentAdmin', sfConfig::get('sf_enabled_modules', array())))
+ {
+ $this->dispatcher->connect('routing.load_configuration', array('sfNestedCommentConfig', 'addRouteForNestedCommentAdmin'));
+ }
+ sfOutputEscaper::markClassAsSafe('sfNestedCommentsRenderer');
+ }
+ }
+}
32 config/sfNestedCommentPlugin_schema.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<database name="propel" package="plugins.sfNestedCommentPlugin.lib.model" defaultIdMethod="native">
+ <table name="sf_nested_comment" phpName="sfNestedComment">
+ <column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true" />
+ <column name="author_name" type="varchar" size="255" />
+ <column name="author_email" type="varchar" size="255" />
+ <column name="author_url" type="varchar" size="255" />
+ <column name="content" type="longvarchar" />
+ <column name="is_moderated" type="boolean" default="false" />
+ <column name="commentable_model" type="varchar" size="30" />
+ <column name="commentable_id" type="integer" />
+ <column name="user_id" type="integer" />
+ <column name="sf_comment_id" type="integer" />
+ <foreign-key foreignTable="sf_nested_comment" onDelete="cascade">
+ <reference local="sf_comment_id" foreign="id" />
+ </foreign-key>
+ <column name="extra" type="varchar" size="255" required="true" />
+ <column name="created_at" type="timestamp" />
+ <column name="updated_at" type="timestamp" />
+ <behavior name="nested_set">
+ <parameter name="use_scope" value="true" />
+ <parameter name="scope_column" value="extra" />
+ </behavior>
+ <index>
+ <index-column name="extra" />
+ </index>
+ <index>
+ <index-column name="commentable_model" />
+ <index-column name="commentable_id" />
+ </index>
+ </table>
+</database>
45 lib/behavior/CommentableBehavior.php
@@ -0,0 +1,45 @@
+<?php
+
+class CommentableBehavior extends Behavior
+{
+ protected $_foreign_table = 'sf_nested_comment';
+
+ public function objectAttributes($builder)
+ {
+ return $this->renderTemplate('objectAttributes');
+ }
+
+ public function objectMethods($builder)
+ {
+ $script = '';
+ $script .= $this->addGetNbComments($builder);
+ $script .= $this->AddGetComments($builder);
+ return $script;
+ }
+
+ public function addGetNbComments($builder)
+ {
+ $foreignModel = $this->getForeignTable()->getPhpName();
+ $model = $this->getTable()->getPhpName();
+ return $this->renderTemplate('nbComments', array(
+ 'model' => $model,
+ 'foreignModel' => $foreignModel,
+ ));
+ }
+
+ public function AddGetComments($builder)
+ {
+ $foreignModel = $this->getForeignTable()->getPhpName();
+ $model = $this->getTable()->getPhpName();
+ return $this->renderTemplate('getComments', array(
+ 'model' => $model,
+ 'foreignModel' => $foreignModel,
+ ));
+ }
+
+ protected function getForeignTable()
+ {
+ $database = $this->getTable()->getDatabase();
+ return $database->getTable($database->getTablePrefix() . $this->_foreign_table);
+ }
+}
45 lib/behavior/templates/getComments.php
@@ -0,0 +1,45 @@
+
+/**
+ * function to retrieve approved level 1 comments
+ * @param $page page number
+ * @return mixed
+ */
+public function getApprovedCommentsLevel1($page = null, $max_per_page = 5)
+{
+ $query = <?php echo $foreignModel.'Query' ?>::create()->
+ approved()->
+ level(1)->
+ recent()->
+ model($this);
+ if (null !== $page) return $query->paginate($page, $max_per_page);
+ return $query->find();
+}
+
+/**
+ * function to retrieve approved comments
+ * @param $page page number
+ * @return mixed
+ */
+public function getApprovedComments($page = null, $max_per_page = 5)
+{
+ $query = <?php echo $foreignModel.'Query' ?>::create()->
+ approved()->
+ recent()->
+ model($this);
+ if (null !== $page) return $query->paginate($page, $max_per_page);
+ return $query->find();
+}
+
+/**
+ * function to retrieve all comments
+ * @param $page page number
+ * @return mixed
+ */
+public function getComments($page = null, $max_per_page = 5)
+{
+ return <?php echo $foreignModel.'Query' ?>::create()->
+ recent()->
+ model($this);
+ if (null !== $page) return $query->paginate($page, $max_per_page);
+ return $query->find();
+}
31 lib/behavior/templates/nbComments.php
@@ -0,0 +1,31 @@
+
+/**
+ * function to get the number of comments related to this <?php echo $model ?> class
+ * @return int
+ */
+public function getNbComments()
+{
+ if (null === $this->_nb_comments)
+ {
+ $this->_nb_comments = <?php echo $foreignModel . 'Query'?>::create()->
+ model($this)->
+ count();
+ }
+ return $this->_nb_comments;
+}
+
+/**
+ * function to get the number of approved comments related to this <?php echo $model ?> class
+ * @return int
+ */
+public function getNbApprovedComments()
+{
+ if (null === $this->_nb_approved_comments)
+ {
+ $this->_nb_approved_comments = <?php echo $foreignModel . 'Query'?>::create()->
+ model($this)->
+ approved()->
+ count();
+ }
+ return $this->_nb_approved_comments;
+}
15 lib/behavior/templates/objectAttributes.php
@@ -0,0 +1,15 @@
+
+/**
+ * The value for the _nb_comments local field (note: it doesn't stored in the database).
+ * @var int
+ */
+ protected $_nb_comments = null;
+
+ /**
+ * The value for the _nb_approved_comments local field (note: it doesn't stored in the database).
+ * @var int
+ */
+ protected $_nb_approved_comments = null;
+
+ // end commentable behavior
+
83 lib/filter/base/BasesfNestedCommentFormFilter.class.php
@@ -0,0 +1,83 @@
+<?php
+
+/**
+ * sfNestedComment filter form base class.
+ *
+ * @package ##PROJECT_NAME##
+ * @subpackage filter
+ * @author ##AUTHOR_NAME##
+ */
+abstract class BasesfNestedCommentFormFilter extends BaseFormFilterPropel
+{
+ public function setup()
+ {
+ $this->setWidgets(array(
+ 'author_name' => new sfWidgetFormFilterInput(),
+ 'author_email' => new sfWidgetFormFilterInput(),
+ 'author_url' => new sfWidgetFormFilterInput(),
+ 'content' => new sfWidgetFormFilterInput(),
+ 'is_moderated' => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
+ 'commentable_model' => new sfWidgetFormFilterInput(),
+ 'commentable_id' => new sfWidgetFormFilterInput(),
+ 'user_id' => new sfWidgetFormFilterInput(),
+ 'sf_comment_id' => new sfWidgetFormPropelChoice(array('model' => 'sfNestedComment', 'add_empty' => true)),
+ 'extra' => new sfWidgetFormFilterInput(array('with_empty' => false)),
+ 'created_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
+ 'updated_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
+ 'tree_left' => new sfWidgetFormFilterInput(),
+ 'tree_right' => new sfWidgetFormFilterInput(),
+ 'tree_level' => new sfWidgetFormFilterInput(),
+ ));
+
+ $this->setValidators(array(
+ 'author_name' => new sfValidatorPass(array('required' => false)),
+ 'author_email' => new sfValidatorPass(array('required' => false)),
+ 'author_url' => new sfValidatorPass(array('required' => false)),
+ 'content' => new sfValidatorPass(array('required' => false)),
+ 'is_moderated' => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
+ 'commentable_model' => new sfValidatorPass(array('required' => false)),
+ 'commentable_id' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
+ 'user_id' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
+ 'sf_comment_id' => new sfValidatorPropelChoice(array('required' => false, 'model' => 'sfNestedComment', 'column' => 'id')),
+ 'extra' => new sfValidatorPass(array('required' => false)),
+ 'created_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
+ 'updated_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
+ 'tree_left' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
+ 'tree_right' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
+ 'tree_level' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
+ ));
+
+ $this->widgetSchema->setNameFormat('sf_nested_comment_filters[%s]');
+
+ $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
+
+ parent::setup();
+ }
+
+ public function getModelName()
+ {
+ return 'sfNestedComment';
+ }
+
+ public function getFields()
+ {
+ return array(
+ 'id' => 'Number',
+ 'author_name' => 'Text',
+ 'author_email' => 'Text',
+ 'author_url' => 'Text',
+ 'content' => 'Text',
+ 'is_moderated' => 'Boolean',
+ 'commentable_model' => 'Text',
+ 'commentable_id' => 'Number',
+ 'user_id' => 'Number',
+ 'sf_comment_id' => 'ForeignKey',
+ 'extra' => 'Text',
+ 'created_at' => 'Date',
+ 'updated_at' => 'Date',
+ 'tree_left' => 'Number',
+ 'tree_right' => 'Number',
+ 'tree_level' => 'Number',
+ );
+ }
+}
19 lib/filter/sfNestedCommentFormFilter.class.php
@@ -0,0 +1,19 @@
+<?php
+
+/**
+ * sfNestedComment filter form.
+ *
+ * @package ##PROJECT_NAME##
+ * @subpackage filter
+ * @author ##AUTHOR_NAME##
+ */
+class sfNestedCommentFormFilter extends BasesfNestedCommentFormFilter
+{
+ public function configure()
+ {
+ $this->useFields(array('content', 'is_moderated'));
+ $this->widgetSchema['is_moderated']->setLabel('Moderated');
+ $this->widgetSchema['content']->setLabel('Comment');
+ $this->getWidgetSchema()->setFormFormatterName('list');
+ }
+}
67 lib/form/base/BasesfNestedCommentForm.class.php
@@ -0,0 +1,67 @@
+<?php
+
+/**
+ * sfNestedComment form base class.
+ *
+ * @method sfNestedComment getObject() Returns the current form's model object
+ *
+ * @package ##PROJECT_NAME##
+ * @subpackage form
+ * @author ##AUTHOR_NAME##
+ */
+abstract class BasesfNestedCommentForm extends BaseFormPropel
+{
+ public function setup()
+ {
+ $this->setWidgets(array(
+ 'id' => new sfWidgetFormInputHidden(),
+ 'author_name' => new sfWidgetFormInputText(),
+ 'author_email' => new sfWidgetFormInputText(),
+ 'author_url' => new sfWidgetFormInputText(),
+ 'content' => new sfWidgetFormTextarea(),
+ 'is_moderated' => new sfWidgetFormInputCheckbox(),
+ 'commentable_model' => new sfWidgetFormInputText(),
+ 'commentable_id' => new sfWidgetFormInputText(),
+ 'user_id' => new sfWidgetFormInputText(),
+ 'sf_comment_id' => new sfWidgetFormPropelChoice(array('model' => 'sfNestedComment', 'add_empty' => true)),
+ 'extra' => new sfWidgetFormInputText(),
+ 'created_at' => new sfWidgetFormDateTime(),
+ 'updated_at' => new sfWidgetFormDateTime(),
+ 'tree_left' => new sfWidgetFormInputText(),
+ 'tree_right' => new sfWidgetFormInputText(),
+ 'tree_level' => new sfWidgetFormInputText(),
+ ));
+
+ $this->setValidators(array(
+ 'id' => new sfValidatorPropelChoice(array('model' => 'sfNestedComment', 'column' => 'id', 'required' => false)),
+ 'author_name' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
+ 'author_email' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
+ 'author_url' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
+ 'content' => new sfValidatorString(array('required' => false)),
+ 'is_moderated' => new sfValidatorBoolean(array('required' => false)),
+ 'commentable_model' => new sfValidatorString(array('max_length' => 30, 'required' => false)),
+ 'commentable_id' => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
+ 'user_id' => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
+ 'sf_comment_id' => new sfValidatorPropelChoice(array('model' => 'sfNestedComment', 'column' => 'id', 'required' => false)),
+ 'extra' => new sfValidatorString(array('max_length' => 255)),
+ 'created_at' => new sfValidatorDateTime(array('required' => false)),
+ 'updated_at' => new sfValidatorDateTime(array('required' => false)),
+ 'tree_left' => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
+ 'tree_right' => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
+ 'tree_level' => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
+ ));
+
+ $this->widgetSchema->setNameFormat('sf_nested_comment[%s]');
+
+ $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
+
+ parent::setup();
+ }
+
+ public function getModelName()
+ {
+ return 'sfNestedComment';
+ }
+
+
+}
28 lib/form/sfNestedCommentAdminForm.class.php
@@ -0,0 +1,28 @@
+<?php
+class sfNestedCommentAdminForm extends sfNestedCommentForm
+{
+ public function configure()
+ {
+ parent::configure();
+
+ $this->useFields(array('id', 'author_name', 'author_email', 'author_url', 'content', 'sf_comment_id', 'commentable_model', 'commentable_id', 'extra'));
+
+ $this->widgetSchema['author_name'] = new sfWidgetFormInputHidden();
+ $this->widgetSchema['author_email'] = new sfWidgetFormInputHidden();
+ $this->widgetSchema['author_url'] = new sfWidgetFormInputHidden();
+ $this->widgetSchema['user_id'] = new sfWidgetFormInputHidden();
+
+ $this->validatorSchema['content'] = new sfValidatorString(array('required' => true));
+
+ $this->widgetSchema['content']->setLabel('Comment (required)');
+
+ $this->getWidgetSchema()->setFormFormatterName('comment');
+ }
+
+ public function updateDefaultsFromObject()
+ {
+ parent::updateDefaultsFromObject();
+ $user = self::getValidUser()->getProfile();
+ $this->setDefault('author_name', $user);
+ }
+}
51 lib/form/sfNestedCommentForm.class.php
@@ -0,0 +1,51 @@
+<?php
+
+/**
+ * sfNestedComment form.
+ *
+ * @package ##PROJECT_NAME##
+ * @subpackage form
+ * @author ##AUTHOR_NAME##
+ */
+class sfNestedCommentForm extends BasesfNestedCommentForm
+{
+ public function configure()
+ {
+ $this->widgetSchema['extra'] = new sfWidgetFormInputHidden();
+ $this->widgetSchema['sf_comment_id'] = new sfWidgetFormInputHidden();
+ $this->widgetSchema['commentable_id'] = new sfWidgetFormInputHidden();
+ $this->widgetSchema['commentable_model'] = new sfWidgetFormInputHidden();
+ }
+
+ public function updateDefaultsFromObject()
+ {
+ parent::updateDefaultsFromObject();
+ if ($this->isNew())
+ {
+ $this->setDefault('extra', $this->getObject()->getCommentableModel().$this->getObject()->getCommentableId());
+ }
+ }
+
+ public function updateContentColumn($value)
+ {
+ $allowed_html_tags = sfConfig::get('app_sfNestedComment_allowed_tags', array());
+ spl_autoload_register(array('HTMLPurifier_Bootstrap', 'autoload'));
+ $config = HTMLPurifier_Config::createDefault();
+ $config->set('HTML', 'Doctype', 'XHTML 1.0 Strict');
+ $config->set('HTML', 'Allowed', implode(',', array_keys($allowed_html_tags)));
+
+ if (isset($allowed_html_tags['a']))
+ {
+ $config->set('HTML', 'AllowedAttributes', 'a.href');
+ $config->set('AutoFormat', 'Linkify', true);
+ }
+
+ if (isset($allowed_html_tags['p']))
+ {
+ $config->set('AutoFormat', 'AutoParagraph', true);
+ }
+
+ $purifier = new HTMLPurifier($config);
+ return str_replace('<a href', '<a rel="nofollow" href', $purifier->purify($value));
+ }
+}
21 lib/form/sfNestedCommentFrontForm.class.php
@@ -0,0 +1,21 @@
+<?php
+class sfNestedCommentFrontForm extends sfNestedCommentForm
+{
+ public function configure()
+ {
+ parent::configure();
+
+ $this->useFields(array('id', 'author_name', 'author_email', 'author_url', 'content', 'sf_comment_id', 'commentable_model', 'commentable_id', 'extra'));
+
+ $this->validatorSchema['author_name'] = new sfValidatorString(array('required' => true));
+ $this->validatorSchema['author_email'] = new sfValidatorEmail(array('required' => true));
+ $this->validatorSchema['author_url'] = new sfValidatorUrl(array('required' => false));
+ $this->validatorSchema['content'] = new sfValidatorString(array('required' => true));
+
+ $this->widgetSchema['author_name']->setLabel('Name (required)');
+ $this->widgetSchema['author_email']->setLabel('Mail (required) (will not be published)');
+ $this->widgetSchema['author_url']->setLabel('Website');
+ $this->widgetSchema['content']->setLabel('Comment (required)');
+ $this->getWidgetSchema()->setFormFormatterName('comment');
+ }
+}
45 lib/helper/sfNestedCommentPaginationHelper.php
@@ -0,0 +1,45 @@
+<?php
+function comment_pagination($pager, $uri, $sf_params, $prev_text = 'Previous', $next_text = 'Next', $sort = 'desc')
+{
+ $navigation = '';
+ if ($pager->haveToPaginate()) {
+ $prms = array();
+ if (null !== $sf_params && $sf_params instanceof sfParameterHolder) {
+ $prms = array_merge($sf_params->getAll(), $prms);
+ unset($prms['module'], $prms['action'], $prms['page']);
+ }
+ $uri .= '?comment-page=';
+
+ $navigation .= '<div class="navigation">';
+ if ($sort == 'asc')
+ {
+ if ($pager->getPage() != 1) {
+ $navigation .= '<div class="nav-prev"><span class="meta-nav">&larr;</span><a class="comment-link" href="'.formatUrlFromParameters($uri.$pager->getPreviousPage(), $prms).'">'.__($prev_text).'</a></div>';
+ }
+ if ($pager->getPage() != $pager->getLastPage()) {
+ $navigation .= '<div class="nav-next"><a class="comment-link" href="'.formatUrlFromParameters($uri.$pager->getNextPage(), $prms).'">'.__($next_text).'</a><span class="meta-nav">&rarr;</span></div>';
+ }
+ }
+ else
+ {
+ if ($pager->getPage() != 1) {
+ $navigation .= '<div class="nav-next"><a class="comment-link" href="'.formatUrlFromParameters($uri.$pager->getPreviousPage(), $prms).'">'.__($next_text).'</a><span class="meta-nav">&rarr;</span></div>';
+ }
+ if ($pager->getPage() != $pager->getLastPage()) {
+ $navigation .= '<div class="nav-prev"><span class="meta-nav">&larr;</span><a class="comment-link" href="'.formatUrlFromParameters($uri.$pager->getNextPage(), $prms).'">'.__($prev_text).'</a></div>';
+ }
+ }
+ $navigation .= '</div>';
+ }
+ return $navigation;
+}
+
+function formatUrlFromParameters($uri, $prms)
+{
+ $url = url_for($uri);
+ if (count($prms) > 0)
+ {
+ $url = url_for($url)."?".http_build_query($prms, '', '&');
+ }
+ return $url;
+}
88 lib/model/map/sfNestedCommentTableMap.php
@@ -0,0 +1,88 @@
+<?php
+
+
+
+/**
+ * This class defines the structure of the 'sf_nested_comment' table.
+ *
+ *
+ * This class was autogenerated by Propel 1.5.5 on:
+ *
+ * Wed 12 Jan 2011 09:38:09 PM WIT
+ *
+ *
+ * This map class is used by Propel to do runtime db structure discovery.
+ * For example, the createSelectSql() method checks the type of a given column used in an
+ * ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
+ * (i.e. if it's a text column type).
+ *
+ * @package propel.generator.plugins.sfNestedCommentPlugin.lib.model.map
+ */
+class sfNestedCommentTableMap extends TableMap {
+
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'plugins.sfNestedCommentPlugin.lib.model.map.sfNestedCommentTableMap';
+
+ /**
+ * Initialize the table attributes, columns and validators
+ * Relations are not initialized by this method since they are lazy loaded
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function initialize()
+ {
+ // attributes
+ $this->setName('sf_nested_comment');
+ $this->setPhpName('sfNestedComment');
+ $this->setClassname('sfNestedComment');
+ $this->setPackage('plugins.sfNestedCommentPlugin.lib.model');
+ $this->setUseIdGenerator(true);
+ // columns
+ $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
+ $this->addColumn('AUTHOR_NAME', 'AuthorName', 'VARCHAR', false, 255, null);
+ $this->addColumn('AUTHOR_EMAIL', 'AuthorEmail', 'VARCHAR', false, 255, null);
+ $this->addColumn('AUTHOR_URL', 'AuthorUrl', 'VARCHAR', false, 255, null);
+ $this->addColumn('CONTENT', 'Content', 'LONGVARCHAR', false, null, null);
+ $this->addColumn('IS_MODERATED', 'IsModerated', 'BOOLEAN', false, null, false);
+ $this->addColumn('COMMENTABLE_MODEL', 'CommentableModel', 'VARCHAR', false, 30, null);
+ $this->addColumn('COMMENTABLE_ID', 'CommentableId', 'INTEGER', false, null, null);
+ $this->addColumn('USER_ID', 'UserId', 'INTEGER', false, null, null);
+ $this->addForeignKey('SF_COMMENT_ID', 'SfCommentId', 'INTEGER', 'sf_nested_comment', 'ID', false, null, null);
+ $this->addColumn('EXTRA', 'Extra', 'VARCHAR', true, 255, null);
+ $this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
+ $this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
+ $this->addColumn('TREE_LEFT', 'TreeLeft', 'INTEGER', false, null, null);
+ $this->addColumn('TREE_RIGHT', 'TreeRight', 'INTEGER', false, null, null);
+ $this->addColumn('TREE_LEVEL', 'TreeLevel', 'INTEGER', false, null, null);
+ // validators
+ } // initialize()
+
+ /**
+ * Build the RelationMap objects for this table relationships
+ */
+ public function buildRelations()
+ {
+ $this->addRelation('sfNestedCommentRelatedBySfCommentId', 'sfNestedComment', RelationMap::MANY_TO_ONE, array('sf_comment_id' => 'id', ), 'CASCADE', null);
+ $this->addRelation('sfNestedCommentRelatedById', 'sfNestedComment', RelationMap::ONE_TO_MANY, array('id' => 'sf_comment_id', ), 'CASCADE', null);
+ } // buildRelations()
+
+ /**
+ *
+ * Gets the list of behaviors registered for this table
+ *
+ * @return array Associative array (name => parameters) of behaviors
+ */
+ public function getBehaviors()
+ {
+ return array(
+ 'nested_set' => array('left_column' => 'tree_left', 'right_column' => 'tree_right', 'level_column' => 'tree_level', 'use_scope' => 'true', 'scope_column' => 'extra', 'method_proxies' => 'false', ),
+ 'symfony' => array('form' => 'true', 'filter' => 'true', ),
+ 'symfony_behaviors' => array(),
+ 'symfony_timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
+ );
+ } // getBehaviors()
+
+} // sfNestedCommentTableMap
2,733 lib/model/om/BasesfNestedComment.php
@@ -0,0 +1,2733 @@
+<?php
+
+
+/**
+ * Base class that represents a row from the 'sf_nested_comment' table.
+ *
+ *
+ *
+ * This class was autogenerated by Propel 1.5.5 on:
+ *
+ * Wed 12 Jan 2011 09:38:09 PM WIT
+ *
+ * @package propel.generator.plugins.sfNestedCommentPlugin.lib.model.om
+ */
+abstract class BasesfNestedComment extends BaseObject implements Persistent
+{
+
+ /**
+ * Peer class name
+ */
+ const PEER = 'sfNestedCommentPeer';
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var sfNestedCommentPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the id field.
+ * @var int
+ */
+ protected $id;
+
+ /**
+ * The value for the author_name field.
+ * @var string
+ */
+ protected $author_name;
+
+ /**
+ * The value for the author_email field.
+ * @var string
+ */
+ protected $author_email;
+
+ /**
+ * The value for the author_url field.
+ * @var string
+ */
+ protected $author_url;
+
+ /**
+ * The value for the content field.
+ * @var string
+ */
+ protected $content;
+
+ /**
+ * The value for the is_moderated field.
+ * Note: this column has a database default value of: false
+ * @var boolean
+ */
+ protected $is_moderated;
+
+ /**
+ * The value for the commentable_model field.
+ * @var string
+ */
+ protected $commentable_model;
+
+ /**
+ * The value for the commentable_id field.
+ * @var int
+ */
+ protected $commentable_id;
+
+ /**
+ * The value for the user_id field.
+ * @var int
+ */
+ protected $user_id;
+
+ /**
+ * The value for the sf_comment_id field.
+ * @var int
+ */
+ protected $sf_comment_id;
+
+ /**
+ * The value for the extra field.
+ * @var string
+ */
+ protected $extra;
+
+ /**
+ * The value for the created_at field.
+ * @var string
+ */
+ protected $created_at;
+
+ /**
+ * The value for the updated_at field.
+ * @var string
+ */
+ protected $updated_at;
+
+ /**
+ * The value for the tree_left field.
+ * @var int
+ */
+ protected $tree_left;
+
+ /**
+ * The value for the tree_right field.
+ * @var int
+ */
+ protected $tree_right;
+
+ /**
+ * The value for the tree_level field.
+ * @var int
+ */
+ protected $tree_level;
+
+ /**
+ * @var sfNestedComment
+ */
+ protected $asfNestedCommentRelatedBySfCommentId;
+
+ /**
+ * @var array sfNestedComment[] Collection to store aggregation of sfNestedComment objects.
+ */
+ protected $collsfNestedCommentsRelatedById;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ // nested_set behavior
+
+ /**
+ * Queries to be executed in the save transaction
+ * @var array
+ */
+ protected $nestedSetQueries = array();
+
+ /**
+ * Internal cache for children nodes
+ * @var null|PropelObjectCollection
+ */
+ protected $collNestedSetChildren = null;
+
+ /**
+ * Internal cache for parent node
+ * @var null|sfNestedComment
+ */
+ protected $aNestedSetParent = null;
+
+
+ /**
+ * Applies default values to this object.
+ * This method should be called from the object's constructor (or
+ * equivalent initialization method).
+ * @see __construct()
+ */
+ public function applyDefaultValues()
+ {
+ $this->is_moderated = false;
+ }
+
+ /**
+ * Initializes internal state of BasesfNestedComment object.
+ * @see applyDefaults()
+ */
+ public function __construct()
+ {
+ parent::__construct();
+ $this->applyDefaultValues();
+ }
+
+ /**
+ * Get the [id] column value.
+ *
+ * @return int
+ */
+ public function getId()
+ {
+ return $this->id;
+ }
+
+ /**
+ * Get the [author_name] column value.
+ *
+ * @return string
+ */
+ public function getAuthorName()
+ {
+ return $this->author_name;
+ }
+
+ /**
+ * Get the [author_email] column value.
+ *
+ * @return string
+ */
+ public function getAuthorEmail()
+ {
+ return $this->author_email;
+ }
+
+ /**
+ * Get the [author_url] column value.
+ *
+ * @return string
+ */
+ public function getAuthorUrl()
+ {
+ return $this->author_url;
+ }
+
+ /**
+ * Get the [content] column value.
+ *
+ * @return string
+ */
+ public function getContent()
+ {
+ return $this->content;
+ }
+
+ /**
+ * Get the [is_moderated] column value.
+ *
+ * @return boolean
+ */
+ public function getIsModerated()
+ {
+ return $this->is_moderated;
+ }
+
+ /**
+ * Get the [commentable_model] column value.
+ *
+ * @return string
+ */
+ public function getCommentableModel()
+ {
+ return $this->commentable_model;
+ }
+
+ /**
+ * Get the [commentable_id] column value.
+ *
+ * @return int
+ */
+ public function getCommentableId()
+ {
+ return $this->commentable_id;
+ }
+
+ /**
+ * Get the [user_id] column value.
+ *
+ * @return int
+ */
+ public function getUserId()
+ {
+ return $this->user_id;
+ }
+
+ /**
+ * Get the [sf_comment_id] column value.
+ *
+ * @return int
+ */
+ public function getSfCommentId()
+ {
+ return $this->sf_comment_id;
+ }
+
+ /**
+ * Get the [extra] column value.
+ *
+ * @return string
+ */
+ public function getExtra()
+ {
+ return $this->extra;
+ }
+
+ /**
+ * Get the [optionally formatted] temporal [created_at] column value.
+ *
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the raw DateTime object will be returned.
+ * @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL, and 0 if column value is 0000-00-00 00:00:00
+ * @throws PropelException - if unable to parse/validate the date/time value.
+ */
+ public function getCreatedAt($format = 'Y-m-d H:i:s')
+ {
+ if ($this->created_at === null) {
+ return null;
+ }
+
+
+ if ($this->created_at === '0000-00-00 00:00:00') {
+ // while technically this is not a default value of NULL,
+ // this seems to be closest in meaning.
+ return null;
+ } else {
+ try {
+ $dt = new DateTime($this->created_at);
+ } catch (Exception $x) {
+ throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->created_at, true), $x);
+ }
+ }
+
+ if ($format === null) {
+ // Because propel.useDateTimeClass is TRUE, we return a DateTime object.
+ return $dt;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $dt->format('U'));
+ } else {
+ return $dt->format($format);
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] temporal [updated_at] column value.
+ *
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the raw DateTime object will be returned.
+ * @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL, and 0 if column value is 0000-00-00 00:00:00
+ * @throws PropelException - if unable to parse/validate the date/time value.
+ */
+ public function getUpdatedAt($format = 'Y-m-d H:i:s')
+ {
+ if ($this->updated_at === null) {
+ return null;
+ }
+
+
+ if ($this->updated_at === '0000-00-00 00:00:00') {
+ // while technically this is not a default value of NULL,
+ // this seems to be closest in meaning.
+ return null;
+ } else {
+ try {
+ $dt = new DateTime($this->updated_at);
+ } catch (Exception $x) {
+ throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->updated_at, true), $x);
+ }
+ }
+
+ if ($format === null) {
+ // Because propel.useDateTimeClass is TRUE, we return a DateTime object.
+ return $dt;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $dt->format('U'));
+ } else {
+ return $dt->format($format);
+ }
+ }
+
+ /**
+ * Get the [tree_left] column value.
+ *
+ * @return int
+ */
+ public function getTreeLeft()
+ {
+ return $this->tree_left;
+ }
+
+ /**
+ * Get the [tree_right] column value.
+ *
+ * @return int
+ */
+ public function getTreeRight()
+ {
+ return $this->tree_right;
+ }
+
+ /**
+ * Get the [tree_level] column value.
+ *
+ * @return int
+ */
+ public function getTreeLevel()
+ {
+ return $this->tree_level;
+ }
+
+ /**
+ * Set the value of [id] column.
+ *
+ * @param int $v new value
+ * @return sfNestedComment The current object (for fluent API support)
+ */
+ public function setId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->id !== $v) {
+ $this->id = $v;
+ $this->modifiedColumns[] = sfNestedCommentPeer::ID;
+ }
+
+ return $this;
+ } // setId()
+
+ /**
+ * Set the value of [author_name] column.
+ *
+ * @param string $v new value
+ * @return sfNestedComment The current object (for fluent API support)
+ */
+ public function setAuthorName($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->author_name !== $v) {
+ $this->author_name = $v;
+ $this->modifiedColumns[] = sfNestedCommentPeer::AUTHOR_NAME;
+ }
+
+ return $this;
+ } // setAuthorName()
+
+ /**
+ * Set the value of [author_email] column.
+ *
+ * @param string $v new value
+ * @return sfNestedComment The current object (for fluent API support)
+ */
+ public function setAuthorEmail($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->author_email !== $v) {
+ $this->author_email = $v;
+ $this->modifiedColumns[] = sfNestedCommentPeer::AUTHOR_EMAIL;
+ }
+
+ return $this;
+ } // setAuthorEmail()
+
+ /**
+ * Set the value of [author_url] column.
+ *
+ * @param string $v new value
+ * @return sfNestedComment The current object (for fluent API support)
+ */
+ public function setAuthorUrl($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->author_url !== $v) {
+ $this->author_url = $v;
+ $this->modifiedColumns[] = sfNestedCommentPeer::AUTHOR_URL;
+ }
+
+ return $this;
+ } // setAuthorUrl()
+
+ /**
+ * Set the value of [content] column.
+ *
+ * @param string $v new value
+ * @return sfNestedComment The current object (for fluent API support)
+ */
+ public function setContent($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->content !== $v) {
+ $this->content = $v;
+ $this->modifiedColumns[] = sfNestedCommentPeer::CONTENT;
+ }
+
+ return $this;
+ } // setContent()
+
+ /**
+ * Set the value of [is_moderated] column.
+ *
+ * @param boolean $v new value
+ * @return sfNestedComment The current object (for fluent API support)
+ */
+ public function setIsModerated($v)
+ {
+ if ($v !== null) {
+ $v = (boolean) $v;
+ }
+
+ if ($this->is_moderated !== $v || $this->isNew()) {
+ $this->is_moderated = $v;
+ $this->modifiedColumns[] = sfNestedCommentPeer::IS_MODERATED;
+ }
+
+ return $this;
+ } // setIsModerated()
+
+ /**
+ * Set the value of [commentable_model] column.
+ *
+ * @param string $v new value
+ * @return sfNestedComment The current object (for fluent API support)
+ */
+ public function setCommentableModel($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->commentable_model !== $v) {
+ $this->commentable_model = $v;
+ $this->modifiedColumns[] = sfNestedCommentPeer::COMMENTABLE_MODEL;
+ }
+
+ return $this;
+ } // setCommentableModel()
+
+ /**
+ * Set the value of [commentable_id] column.
+ *
+ * @param int $v new value
+ * @return sfNestedComment The current object (for fluent API support)
+ */
+ public function setCommentableId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->commentable_id !== $v) {
+ $this->commentable_id = $v;
+ $this->modifiedColumns[] = sfNestedCommentPeer::COMMENTABLE_ID;
+ }
+
+ return $this;
+ } // setCommentableId()
+
+ /**
+ * Set the value of [user_id] column.
+ *
+ * @param int $v new value
+ * @return sfNestedComment The current object (for fluent API support)
+ */
+ public function setUserId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->user_id !== $v) {
+ $this->user_id = $v;
+ $this->modifiedColumns[] = sfNestedCommentPeer::USER_ID;
+ }
+
+ return $this;
+ } // setUserId()
+
+ /**
+ * Set the value of [sf_comment_id] column.
+ *
+ * @param int $v new value
+ * @return sfNestedComment The current object (for fluent API support)
+ */
+ public function setSfCommentId($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->sf_comment_id !== $v) {
+ $this->sf_comment_id = $v;
+ $this->modifiedColumns[] = sfNestedCommentPeer::SF_COMMENT_ID;
+ }
+
+ if ($this->asfNestedCommentRelatedBySfCommentId !== null && $this->asfNestedCommentRelatedBySfCommentId->getId() !== $v) {
+ $this->asfNestedCommentRelatedBySfCommentId = null;
+ }
+
+ return $this;
+ } // setSfCommentId()
+
+ /**
+ * Set the value of [extra] column.
+ *
+ * @param string $v new value
+ * @return sfNestedComment The current object (for fluent API support)
+ */
+ public function setExtra($v)
+ {
+ if ($v !== null) {
+ $v = (string) $v;
+ }
+
+ if ($this->extra !== $v) {
+ $this->extra = $v;
+ $this->modifiedColumns[] = sfNestedCommentPeer::EXTRA;
+ }
+
+ return $this;
+ } // setExtra()
+
+ /**
+ * Sets the value of [created_at] column to a normalized version of the date/time value specified.
+ *
+ * @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
+ * be treated as NULL for temporal objects.
+ * @return sfNestedComment The current object (for fluent API support)
+ */
+ public function setCreatedAt($v)
+ {
+ // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
+ // -- which is unexpected, to say the least.
+ if ($v === null || $v === '') {
+ $dt = null;
+ } elseif ($v instanceof DateTime) {
+ $dt = $v;
+ } else {
+ // some string/numeric value passed; we normalize that so that we can
+ // validate it.
+ try {
+ if (is_numeric($v)) { // if it's a unix timestamp
+ $dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
+ // We have to explicitly specify and then change the time zone because of a
+ // DateTime bug: http://bugs.php.net/bug.php?id=43003
+ $dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
+ } else {
+ $dt = new DateTime($v);
+ }
+ } catch (Exception $x) {
+ throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
+ }
+ }
+
+ if ( $this->created_at !== null || $dt !== null ) {
+ // (nested ifs are a little easier to read in this case)
+
+ $currNorm = ($this->created_at !== null && $tmpDt = new DateTime($this->created_at)) ? $tmpDt->format('Y-m-d H:i:s') : null;
+ $newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;
+
+ if ( ($currNorm !== $newNorm) // normalized values don't match
+ )
+ {
+ $this->created_at = ($dt ? $dt->format('Y-m-d H:i:s') : null);
+ $this->modifiedColumns[] = sfNestedCommentPeer::CREATED_AT;
+ }
+ } // if either are not null
+
+ return $this;
+ } // setCreatedAt()
+
+ /**
+ * Sets the value of [updated_at] column to a normalized version of the date/time value specified.
+ *
+ * @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
+ * be treated as NULL for temporal objects.
+ * @return sfNestedComment The current object (for fluent API support)
+ */
+ public function setUpdatedAt($v)
+ {
+ // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
+ // -- which is unexpected, to say the least.
+ if ($v === null || $v === '') {
+ $dt = null;
+ } elseif ($v instanceof DateTime) {
+ $dt = $v;
+ } else {
+ // some string/numeric value passed; we normalize that so that we can
+ // validate it.
+ try {
+ if (is_numeric($v)) { // if it's a unix timestamp
+ $dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
+ // We have to explicitly specify and then change the time zone because of a
+ // DateTime bug: http://bugs.php.net/bug.php?id=43003
+ $dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
+ } else {
+ $dt = new DateTime($v);
+ }
+ } catch (Exception $x) {
+ throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
+ }
+ }
+
+ if ( $this->updated_at !== null || $dt !== null ) {
+ // (nested ifs are a little easier to read in this case)
+
+ $currNorm = ($this->updated_at !== null && $tmpDt = new DateTime($this->updated_at)) ? $tmpDt->format('Y-m-d H:i:s') : null;
+ $newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;
+
+ if ( ($currNorm !== $newNorm) // normalized values don't match
+ )
+ {
+ $this->updated_at = ($dt ? $dt->format('Y-m-d H:i:s') : null);
+ $this->modifiedColumns[] = sfNestedCommentPeer::UPDATED_AT;
+ }
+ } // if either are not null
+
+ return $this;
+ } // setUpdatedAt()
+
+ /**
+ * Set the value of [tree_left] column.
+ *
+ * @param int $v new value
+ * @return sfNestedComment The current object (for fluent API support)
+ */
+ public function setTreeLeft($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->tree_left !== $v) {
+ $this->tree_left = $v;
+ $this->modifiedColumns[] = sfNestedCommentPeer::TREE_LEFT;
+ }
+
+ return $this;
+ } // setTreeLeft()
+
+ /**
+ * Set the value of [tree_right] column.
+ *
+ * @param int $v new value
+ * @return sfNestedComment The current object (for fluent API support)
+ */
+ public function setTreeRight($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->tree_right !== $v) {
+ $this->tree_right = $v;
+ $this->modifiedColumns[] = sfNestedCommentPeer::TREE_RIGHT;
+ }
+
+ return $this;
+ } // setTreeRight()
+
+ /**
+ * Set the value of [tree_level] column.
+ *
+ * @param int $v new value
+ * @return sfNestedComment The current object (for fluent API support)
+ */
+ public function setTreeLevel($v)
+ {
+ if ($v !== null) {
+ $v = (int) $v;
+ }
+
+ if ($this->tree_level !== $v) {
+ $this->tree_level = $v;
+ $this->modifiedColumns[] = sfNestedCommentPeer::TREE_LEVEL;
+ }
+
+ return $this;
+ } // setTreeLevel()
+
+ /**
+ * Indicates whether the columns in this object are only set to default values.
+ *
+ * This method can be used in conjunction with isModified() to indicate whether an object is both
+ * modified _and_ has some values set which are non-default.
+ *
+ * @return boolean Whether the columns in this object are only been set with default values.
+ */
+ public function hasOnlyDefaultValues()
+ {
+ if ($this->is_moderated !== false) {
+ return false;
+ }
+
+ // otherwise, everything was equal, so return TRUE
+ return true;
+ } // hasOnlyDefaultValues()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (0-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM)
+ * @param int $startcol 0-based offset column which indicates which restultset column to start with.
+ * @param boolean $rehydrate Whether this object is being re-hydrated from the database.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate($row, $startcol = 0, $rehydrate = false)
+ {
+ try {
+
+ $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
+ $this->author_name = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
+ $this->author_email = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
+ $this->author_url = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
+ $this->content = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
+ $this->is_moderated = ($row[$startcol + 5] !== null) ? (boolean) $row[$startcol + 5] : null;
+ $this->commentable_model = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null;
+ $this->commentable_id = ($row[$startcol + 7] !== null) ? (int) $row[$startcol + 7] : null;
+ $this->user_id = ($row[$startcol + 8] !== null) ? (int) $row[$startcol + 8] : null;
+ $this->sf_comment_id = ($row[$startcol + 9] !== null) ? (int) $row[$startcol + 9] : null;
+ $this->extra = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null;
+ $this->created_at = ($row[$startcol + 11] !== null) ? (string) $row[$startcol + 11] : null;
+ $this->updated_at = ($row[$startcol + 12] !== null) ? (string) $row[$startcol + 12] : null;
+ $this->tree_left = ($row[$startcol + 13] !== null) ? (int) $row[$startcol + 13] : null;
+ $this->tree_right = ($row[$startcol + 14] !== null) ? (int) $row[$startcol + 14] : null;
+ $this->tree_level = ($row[$startcol + 15] !== null) ? (int) $row[$startcol + 15] : null;
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ if ($rehydrate) {
+ $this->ensureConsistency();
+ }
+
+ return $startcol + 16; // 16 = sfNestedCommentPeer::NUM_COLUMNS - sfNestedCommentPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating sfNestedComment object", $e);
+ }
+ }
+
+ /**
+ * Checks and repairs the internal consistency of the object.
+ *
+ * This method is executed after an already-instantiated object is re-hydrated
+ * from the database. It exists to check any foreign keys to make sure that
+ * the objects related to the current object are correct based on foreign key.
+ *
+ * You can override this method in the stub class, but you should always invoke
+ * the base method from the overridden method (i.e. parent::ensureConsistency()),
+ * in case your model changes.
+ *
+ * @throws PropelException
+ */
+ public function ensureConsistency()
+ {
+
+ if ($this->asfNestedCommentRelatedBySfCommentId !== null && $this->sf_comment_id !== $this->asfNestedCommentRelatedBySfCommentId->getId()) {
+ $this->asfNestedCommentRelatedBySfCommentId = null;
+ }
+ } // ensureConsistency
+
+ /**
+ * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
+ *
+ * This will only work if the object has been saved and has a valid primary key set.
+ *
+ * @param boolean $deep (optional) Whether to also de-associated any related objects.
+ * @param PropelPDO $con (optional) The PropelPDO connection to use.
+ * @return void
+ * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
+ */
+ public function reload($deep = false, PropelPDO $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("Cannot reload a deleted object.");
+ }
+
+ if ($this->isNew()) {
+ throw new PropelException("Cannot reload an unsaved object.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(sfNestedCommentPeer::DATABASE_NAME, Propel::CONNECTION_READ);
+ }
+
+ // We don't need to alter the object instance pool; we're just modifying this instance
+ // already in the pool.
+
+ $stmt = sfNestedCommentPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
+ $row = $stmt->fetch(PDO::FETCH_NUM);
+ $stmt->closeCursor();
+ if (!$row) {
+ throw new PropelException('Cannot find matching row in the database to reload object values.');
+ }
+ $this->hydrate($row, 0, true); // rehydrate
+
+ if ($deep) { // also de-associate any related objects?
+
+ $this->asfNestedCommentRelatedBySfCommentId = null;
+ $this->collsfNestedCommentsRelatedById = null;
+
+ } // if (deep)
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param PropelPDO $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete(PropelPDO $con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(sfNestedCommentPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
+ }
+
+ $con->beginTransaction();
+ try {
+ $ret = $this->preDelete($con);
+ // nested_set behavior
+ if ($this->isRoot()) {
+ throw new PropelException('Deletion of a root node is disabled for nested sets. Use sfNestedCommentPeer::deleteTree($scope) instead to delete an entire tree');
+ }
+ $this->deleteDescendants($con);
+
+ // symfony_behaviors behavior
+ foreach (sfMixer::getCallables('BasesfNestedComment:delete:pre') as $callable)
+ {
+ if (call_user_func($callable, $this, $con))
+ {
+ $con->commit();
+ return;
+ }
+ }
+
+ if ($ret) {
+ sfNestedCommentQuery::create()
+ ->filterByPrimaryKey($this->getPrimaryKey())
+ ->delete($con);
+ $this->postDelete($con);
+ // nested_set behavior