[ Index ]
 

Code source de b2evolution 2.1.0-beta

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/blogs/inc/plugins/model/ -> _pluginsettings.class.php (source)

   1  <?php
   2  /**

   3   * This file implements the PluginSettings class, to handle plugin/name/value triplets.

   4   *

   5   * This file is part of the evoCore framework - {@link http://evocore.net/}

   6   * See also {@link http://sourceforge.net/projects/evocms/}.

   7   *

   8   * @copyright (c)2003-2007 by Francois PLANQUE - {@link http://fplanque.net/}

   9   * Parts of this file are copyright (c)2004-2006 by Daniel HAHLER - {@link http://thequod.de/contact}.

  10   *

  11   * {@internal License choice

  12   * - If you have received this file as part of a package, please find the license.txt file in

  13   *   the same folder or the closest folder above for complete license terms.

  14   * - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)

  15   *   then you must choose one of the following licenses before using the file:

  16   *   - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php

  17   *   - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php

  18   * }}

  19   *

  20   * {@internal Open Source relicensing agreement:

  21   * Daniel HAHLER grants Francois PLANQUE the right to license

  22   * Daniel HAHLER's contributions to this file and the b2evolution project

  23   * under any OSI approved OSS license (http://www.opensource.org/licenses/).

  24   * }}

  25   *

  26   * @package evocore

  27   *

  28   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}

  29   * @author blueyed: Daniel HAHLER.

  30   *

  31   * @version $Id: _pluginsettings.class.php,v 1.1 2007/06/25 11:00:52 fplanque Exp $

  32   *

  33   */
  34  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  35  
  36  load_class('settings/model/_abstractsettings.class.php');
  37  
  38  /**

  39   * Class to handle settings for plugins

  40   *

  41   * @package evocore

  42   */
  43  class PluginSettings extends AbstractSettings
  44  {
  45      /**

  46       * Constructor

  47       *

  48       * @param integer plugin ID where these settings are for

  49       */
  50  	function PluginSettings( $plugin_ID )
  51      { // constructor
  52          parent::AbstractSettings( 'T_pluginsettings', array( 'pset_plug_ID', 'pset_name' ), 'pset_value', 1 );
  53  
  54          $this->plugin_ID = $plugin_ID;
  55      }
  56  
  57  
  58      /**

  59       * Get a setting by name for the Plugin.

  60       *

  61       * @param string The settings name.

  62       * @return mixed|NULL|false False in case of error, NULL if not found, the value otherwise.

  63       */
  64  	function get( $setting )
  65      {
  66          return parent::get( $this->plugin_ID, $setting );
  67      }
  68  
  69  
  70      /**

  71       * Set a Plugin setting. Use {@link dbupdate()} to write it to the database.

  72       *

  73       * @param string The settings name.

  74       * @param string The settings value.

  75       * @return boolean true, if the value has been set, false if it has not changed.

  76       */
  77  	function set( $setting, $value )
  78      {
  79          return parent::set( $this->plugin_ID, $setting, $value );
  80      }
  81  
  82  
  83      /**

  84       * Delete a setting.

  85       *

  86       * Use {@link dbupdate()} to commit it to the database.

  87       *

  88       * @param string name of setting

  89       */
  90  	function delete( $setting )
  91      {
  92          return parent::delete( $this->plugin_ID, $setting );
  93      }
  94  
  95  }
  96  
  97  /*

  98   * $Log: _pluginsettings.class.php,v $

  99   * Revision 1.1  2007/06/25 11:00:52  fplanque

 100   * MODULES (refactored MVC)

 101   *

 102   * Revision 1.6  2007/04/26 00:11:02  fplanque

 103   * (c) 2007

 104   *

 105   * Revision 1.5  2006/11/24 18:27:25  blueyed

 106   * Fixed link to b2evo CVS browsing interface in file docblocks

 107   *

 108   * Revision 1.4  2006/04/19 20:13:50  fplanque

 109   * do not restrict to :// (does not catch subdomains, not even www.)

 110   *

 111   * Revision 1.3  2006/03/12 23:08:59  fplanque

 112   * doc cleanup

 113   *

 114   * Revision 1.2  2006/02/24 22:09:00  blueyed

 115   * Plugin enhancements

 116   *

 117   * Revision 1.1  2006/02/23 21:11:58  fplanque

 118   * File reorganization to MVC (Model View Controller) architecture.

 119   * See index.hml files in folders.

 120   * (Sorry for all the remaining bugs induced by the reorg... :/)

 121   *

 122   * Revision 1.3  2005/12/22 23:13:40  blueyed

 123   * Plugins' API changed and handling optimized

 124   *

 125   * Revision 1.2  2005/12/08 22:32:19  blueyed

 126   * Merged from post-phoenix; Added/fixed delete() (has to be derived to allow using it without plug_ID)

 127   *

 128   * Revision 1.1.2.2  2005/12/06 21:56:21  blueyed

 129   * Get PluginSettings straight (removing $default_keys).

 130   *

 131   * Revision 1.1.2.1  2005/11/16 22:45:32  blueyed

 132   * DNS Blacklist antispam plugin; T_pluginsettings; Backoffice editing for plugins settings; $Plugin->Settings; MERGE from HEAD;

 133   */
 134  ?>


Généré le : Thu Nov 29 23:58:50 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics