Location: PHPKode > projects > LDAPted > ldapted/includes/controls/Liste.php
<?php
/***************************************************************************
 *
 *                                  Liste.php
 *                              -------------------
 *
 *   begin                : Friday, Jul 5, 2002
 *   copyright            : (C) 2002 The Kabramps Team
 *   email                : hide@address.com,
 *                          hide@address.com
 *
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   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.
 *   (http://www.gnu.org/licenses/gpl.html)
 *
 ***************************************************************************/

class Liste extends Control
{

	function Liste ()
	{}
  
	function get_view_panel ()
	{
		global $options;
		
		$tmpl = new TPLInterface();
		
		$size = $this->attributeoptions["size"];
		if ( ( $size == "" ) || ( $size < 2 ) ) $size = 2;

		$textvalue = $this->utf8_LDAPdecode($this->value);

		$tmpl->assign(array("ATTRIBLABEL" => $this->label,
		                    "ATTRIBNAME"  => $this->attribute,
		                    "WIDTH"       => $this->attributeoptions["width"],
		                    "SIZE"        => $size,
		                    'OPTIONS'     => $textvalue
		             ));

		return $tmpl->fetch($this->get_template('view'));
	}
  
	function set_value( $ldap_result )
	{
		$this->value = array(); //reset
		
		if( is_array( $ldap_result ) )
		{
			foreach($ldap_result as $key => $value)
			{
				if( is_int($key) && $value )
				{
					$this->value[] = $value;
				}
			}
		}
	}

	function html2LDAPvalue ( $htmlValue )
	{
		return $htmlValue;
	}
}
?>
Return current item: LDAPted