
<?php

/**
* $Id: class.badwords2.settings.php,v 1.3 2005/09/05 15:35:47 walb Exp $
*
* Badwords2 Text Filtering Component!
* @ Copyright (C) 2005 - 2006 Wim Albers, Niels Vandekeybus, Robert Anthony Pitera
* @ Based on the initial work Badword by Pravin Hegde
* @ All rights reserved
* @ Badwords2 Text Filter component is Free Software
* @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
*
**/

/*
 * Settings Config Class
 */

class bwSettings extends mosDBTable {

	var $version		=	'1.0 BETA';
	var $perform_filter =  	null;
	var $perform_regexp = 	null;
	var $allow_admin	= 	null;

	var $_alias			=	null;

	function bwSettings() {
		$this->_alias = array(
			'version'			=> 'bw_version',
			'perform_filter'	=> 'bw_perform_filter',
			'perform_regexp'	=> 'bw_perform_regexp',
			'allow_admin'		=> 'bw_allow_admin'
		);
	}

	function getVarText() {
		$txt = '';
		foreach ($this->_alias as $k=>$v) {
			$txt .= "\$$v = '".addslashes( $this->$k )."';\n";
		}
		return $txt;
	}

	function bindGlobals() {
		foreach ($this->_alias as $k=>$v) {
			if(isset($GLOBALS[$v]))
			$this->$k = $GLOBALS[$v];
			else
			$this->$k = "";
		}
	}
}

?>