summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTekimaki <tekimaki_admin@users.sourceforge.net>2009-02-27 17:50:58 +0000
committerTekimaki <tekimaki_admin@users.sourceforge.net>2009-02-27 17:50:58 +0000
commit28235297bd4dadcbb599e31b522ae9b62edf690e (patch)
tree484cdda6542a1bed4d623a21c826f314e5480c98
parentb087314264d6531b1626cc9ba5864562a7d44a19 (diff)
downloadliberty-28235297bd4dadcbb599e31b522ae9b62edf690e.tar.gz
liberty-28235297bd4dadcbb599e31b522ae9b62edf690e.tar.bz2
liberty-28235297bd4dadcbb599e31b522ae9b62edf690e.zip
if new content then always return true for allow comments - this facilitates comment services and minimizes functional overrides in subclasses
-rw-r--r--LibertyContent.php22
1 files changed, 17 insertions, 5 deletions
diff --git a/LibertyContent.php b/LibertyContent.php
index b4db280..c055705 100644
--- a/LibertyContent.php
+++ b/LibertyContent.php
@@ -3,7 +3,7 @@
* Management of Liberty content
*
* @package liberty
-* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.394 2009/01/31 03:45:33 spiderr Exp $
+* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.395 2009/02/27 17:50:58 tekimaki_admin Exp $
* @author spider <spider@steelsun.com>
*/
@@ -3334,11 +3334,23 @@ class LibertyContent extends LibertyBase {
* @return TRUE on success, FALSE on failure
*/
function isCommentable() {
- if( $this->getPreference( 'allow_comments' ) == 'y' ) {
+ if( $this->isValid() ){
+ if( $this->getPreference( 'allow_comments' ) == 'y' ) {
+ return TRUE;
+ } else {
+ $setting = $this->getField( 'allow_comments' );
+ return( $setting == TRUE || $setting == 'y' );
+ }
+ }else{
+ /**
+ * although comments are opt in, return true for new content
+ * since all content can potentially support comments
+ * this simplifies comment services and minimizes overrides
+ * in subclasses which more typically allow comments then never
+ *
+ * override in subclass if never want to allow comments
+ **/
return TRUE;
- } else {
- $setting = $this->getField( 'allow_comments' );
- return( $setting == TRUE || $setting == 'y' );
}
}