<?php
/***************************************************************************
*
* Text.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 Text extends Control
{
function Text ()
{}
function get_edit_panel ()
{
$tmpl = new TPLInterface();
$textvalue = $this->utf8_LDAPdecode($this->value);
$tmpl->assign(array("DESCRIPTION" => $this->description,
"ATTRIBLABEL" => $this->label,
"ATTRIBNAME" => $this->attribute,
"ATTRIBVALUE" => $textvalue[0], // 0 - because it is a single text field
"WIDTH" => $this->attributeoptions['width'],
"MAXLENGTH" => $this->attributeoptions["maxlength"],
"ERRORPIC" => $exclamationpic,
"ERRORMESSAGE" => $this->get_error_message(),
'control' => $this
));
return $tmpl->fetch($this->get_template('edit'));
}
function get_view_panel ()
{
$tmpl = new TPLInterface();
$textvalue = $this->utf8_LDAPdecode($this->value);
$tmpl->assign(array("DESCRIPTION" => $this->description,
"ATTRIBLABEL" => $this->label,
"ATTRIBNAME" => $this->attribute,
"ATTRIBVALUE" => $textvalue[0], // 0 - because it is a single text field
"WIDTH" => $this->attributeoptions['width']
));
return $tmpl->fetch($this->get_template('view'));
}
}
?>