Location: PHPKode > projects > Simple Way to Usenet > swun/libs/swun/themes/tfeat_savedgrp.class.php
<?php
/**
 *  
 * @author  Benjamin Gillissen <hide@address.com>
 * 
 *	**************************************************************

	Copyright (C) 2009  Benjamin Gillissen
	
	This program is free software; you can redistribute it and/or
	modify it under the terms of the GNU General Public License
	as published by the Free Software Foundation; either version 2
	of the License, or (at your option) any later version.
	
	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details at:
	http://www.gnu.org/copyleft/gpl.html

 *	**************************************************************
 */
/* 
 * 
 */ 
class tfeat_savedgrp {
	
	private static $init=FALSE;
	
	public function __construct(){ }
	
	public static function implent(){
		return TRUE; 
	}
	
	public static function genform(){ 
		$prof = new profile('site_profile');
		$c=0;
		if ( $prof->isdefined('savedgrp') ){
			$grp = $prof->read('savedgrp');
			foreach($grp as $k => $data){
				if ( isset($_POST['savedgrp'][$k]) ){
					if ( isset($_POST['savedgrp'][$k]['drop']) ){
						unset($grp[$k]);
					} else {
						$out[$c]['name'] = htmlentities(stripslashes($_POST['savedgrp'][$k]['name']), ENT_QUOTES, CORE::getintcharset());
						$out[$c]['grp'] = htmlentities($_POST['savedgrp'][$k]['grp'], ENT_QUOTES, CORE::getintcharset());
						$c++;
					}
				} else {
					$out[$c] = $data;
					$c++;
				}
			}
		}
		if ( isset($_POST['savedgrp']['new']) ){
			if ( isset($_POST['savedgrp']['new']['insert']) ){
				$out[$c]['name'] = htmlentities(stripslashes($_POST['savedgrp']['new']['name']), ENT_QUOTES, CORE::getintcharset());
				$out[$c]['grp'] = htmlentities($_POST['savedgrp']['new']['grp'], ENT_QUOTES, CORE::getintcharset());
			}
		}
		if ( ! isset($out) ){$out = Array(); }
		$prof->set('savedgrp', $out);
		unset($prof);
		$o['savedgrp'] = $out;
		return $o;
	}

	public static function genpart($gname, $of=FALSE){
		if ( !$of ){ return; } 
		return TRUE;
	}
}
return TRUE;
Return current item: Simple Way to Usenet