[ Index ]
 

Code source de CMS made simple 1.0.5

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/classes/ -> class.group.inc.php (source)

   1  <?php
   2  #CMS - CMS Made Simple
   3  #(c)2004 by Ted Kulp (tedkulp@users.sf.net)
   4  #This project's homepage is: http://cmsmadesimple.org
   5  #
   6  #This program is free software; you can redistribute it and/or modify
   7  #it under the terms of the GNU General Public License as published by
   8  #the Free Software Foundation; either version 2 of the License, or
   9  #(at your option) any later version.
  10  #
  11  #This program is distributed in the hope that it will be useful,
  12  #BUT withOUT ANY WARRANTY; without even the implied warranty of
  13  #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14  #GNU General Public License for more details.
  15  #You should have received a copy of the GNU General Public License
  16  #along with this program; if not, write to the Free Software
  17  #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  18  #
  19  #$Id: class.group.inc.php 3360 2006-08-22 01:39:33Z wishy $
  20  
  21  /**
  22   * Generic group class. This can be used for any logged in group or group related function.
  23   *
  24   * @since        0.9
  25   * @package        CMS
  26   */
  27  
  28  class Group
  29  {
  30      var $id;
  31      var $name;
  32      var $active;
  33  
  34  	function Group()
  35      {
  36          $this->SetInitialValues();
  37      }
  38  
  39  	function SetInitialValues()
  40      {
  41          $this->id = -1;
  42          $this->name = '';
  43          $this->active = false;
  44      }
  45  
  46  	function Save()
  47      {
  48          $result = false;
  49          
  50          global $gCms;
  51          $groupops =& $gCms->GetGroupOperations();
  52          
  53          if ($this->id > -1)
  54          {
  55              $result = $groupops->UpdateGroup($this);
  56          }
  57          else
  58          {
  59              $newid = $groupops->InsertGroup($this);
  60              if ($newid > -1)
  61              {
  62                  $this->id = $newid;
  63                  $result = true;
  64              }
  65  
  66          }
  67  
  68          return $result;
  69      }
  70  
  71  	function Delete()
  72      {
  73          $result = false;
  74  
  75          if ($this->id > -1)
  76          {
  77              global $gCms;
  78              $groupops =& $gCms->GetGroupOperations();
  79              $result = $groupops->DeleteGroupByID($this->id);
  80              if ($result)
  81              {
  82                  $this->SetInitialValues();
  83              }
  84          }
  85  
  86          return $result;
  87      }
  88  }
  89  
  90  # vim:ts=4 sw=4 noet
  91  ?>


Généré le : Tue Apr 3 18:50:37 2007 par Balluche grâce à PHPXref 0.7