<?php
/**
 * Preference search form
 *
 * @author Moises Heberle [moises@solis.coop.br]
 *
 * @version $Id$
 *
 * \b Maintainers \n
 * Eduardo Bonfandini [eduardo@solis.coop.br]
 * Jamiel Spezia [jamiel@solis.coop.br]
 * Luiz Gregory Filho [luiz@solis.coop.br]
 * Moises Heberle [moises@solis.coop.br]
 *
 * @since
 * Class created on 28/07/2008
 *
 * \b Organization: \n
 * SOLIS - Cooperativa de Solucoes Livres \n
 * The Gnuteca3 Development Team
 *
 * \b CopyLeft: \n
 * CopyLeft (L) 2008 SOLIS - Cooperativa de Solucoes Livres \n
 *
 * \b License: \n
 * Licensed under GPL (for further details read the COPYING file or http://www.gnu.org/copyleft/gpl.html )
 *
 * \b History: \n
 * See history in SVN repository: http://gnuteca.solis.coop.br
 */
class FrmPreferenceSearch extends GnutecaForm
{
    public function __construct()
    {
        $this->setAllFunctions('Preference', array('moduleConfigS','parameterS, configValueS'));
        parent::__construct();
        if ( $this->primeiroAcessoAoForm() && strlen(MIOLO::_REQUEST('event')) == 0 )
        {
            $this->setFocus('parameterS');
        }
    }


    public function createFields()
    {
        $moduleConfigS = new MTextField('moduleConfigS', strtoupper($this->module), _M('Module',$this->module), 20);
        $moduleConfigS->setReadOnly(true);
        $fields[] = $moduleConfigS;

        $parameterS = new MTextField('parameterS', $this->parameterS->value, _M('Parameter',$this->module), 20);
        $fields[] = $parameterS;

        $configValueS = new MTextField('configValueS', $this->configValueS->value, _M('Value',$this->module), 20);
        $fields[] = $configValueS;

        $descriptionS = new MTextField('descriptionS', $this->descriptionS->value, _M('Description',$this->module), FIELD_DESCRIPTION_SIZE);
        $fields[] = $descriptionS;

        $typeS = new GnutecaSelection('typeS', $this->typeS->value, _M('Field type',$this->module), GnutecaUtils::listTypes());
        $fields[] = $typeS;
        $this->setFields($fields);
    }
}
?>
