[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/class/dao/ -> articlecommentstatus.class.php (source)

   1  <?php
   2  
   3      lt_include( PLOG_CLASS_PATH."class/dao/status/genericstatuslist.class.php" );
   4      
   5      define( "COMMENT_STATUS_ALL", -1, true ); 
   6      define( "COMMENT_STATUS_NONSPAM", 0, true );
   7      define( "COMMENT_STATUS_SPAM", 1, true );
   8  
   9      /**
  10       * This class keeps track of all the possible status that a blog can have. If plugins dynamically 
  11       * register new blog statuses, this class will still be able to handle them
  12       * 
  13       * \ingroup DAO
  14       */        
  15      class ArticleCommentStatus extends GenericStatusList
  16      {
  17      
  18          /**
  19           * returns a list with all the statuses that have been defined for comments. 
  20           * If you wish to define your own custom status, then simply in your plugin define
  21           * COMMENT_STATUS_XXX and give it a sensible value.
  22           *
  23           * @return Returns an array where every position is an array with two
  24           * keys: "constant" and "value", where "constant" is the name of the constant
  25           * that defines this status and "value" is the value assigned to it
  26           * @static
  27           */
  28          function getStatusList( $includeStatusAll = false )
  29          {
  30              return( GenericStatusList::getStatusList( "COMMENT_STATUS_", "COMMENT_STATUS_ALL", $includeStatusAll ));
  31          }
  32          
  33          /**
  34           * returns whether a status has previously been defined or not
  35           *
  36           * @param status
  37           * @return true if valid status or false otherwise
  38           */
  39  		function isValidStatus( $status )
  40          {
  41              // check if the status is valid
  42              if( $status == "" )
  43                  return false;
  44              
  45              $isValid = in_array( $status, ArticleCommentStatus::getStatusList());
  46              
  47              return $isValid;
  48          }
  49      }
  50  ?>


Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics