<?php

Goweb::loadClass('Goweb_Form');

/**
 * Goweb Sitemanager 5 Framework
 * @version    5.0.0
 * @category   Backoffice
 * @package    Newsletter
 * @subpackage Form
 * @author     I&D <dev@goweb.pt>, Pedro Pinto <ppinto@goweb.pt>
 * @copyright  2009 (c) Goweb (http://www.goweb.pt)
*/
class Form_Mysql extends Goweb_Form {
    
    
    /**
     * Metodo obrigatorio as classes herdeiras do Goweb_Form
    */
    public function setup() {
        $config = goweb::registry('config');
        // titulo
        $this->username = $this->Text(array('maxlength' => 128, 'label' => translateAdmin('Username')));
        $this->username->help = translateAdmin('Nome do utilizador come&ccedil;a com "{{username}}_"', $config->siteworx->username);
        $this->username->setValue('user');
        $this->username->size = 50;
        $this->username->validators->Required(translateAdmin('O campo <b>{{campo}}</b> &eacute; de preenchimento obrigat&oacute;rio.', $this->username->label));

        // titulo
        $this->password = $this->Text(array('maxlength' => 128, 'label' => translateAdmin('Password')));
        $this->password->size = 50;
        $this->password->validators->Required(translateAdmin('O campo <b>{{campo}}</b> &eacute; de preenchimento obrigat&oacute;rio.', $this->password->label));
        
        // titulo
        $this->dbname = $this->Text(array('maxlength' => 128, 'label' => translateAdmin('Nome da BD')));
        $this->dbname->setValue('db');
        $this->dbname->size = 50;
        $this->dbname->help = translateAdmin('Base de dados come&ccedil;a com "{{username}}_"', $config->siteworx->username);
        $this->dbname->validators->Required(translateAdmin('O campo <b>{{campo}}</b> &eacute; de preenchimento obrigat&oacute;rio.', $this->dbname->label));

        
        // submit
        $this->submit = $this->Submit();
        $this->submit->value = translateAdmin('Gravar');
        $this->submit->class = 'form_submit';

    }
}