Location: PHPKode > projects > cataBlog > cataBlog-0.1-pre_alpha/0.1-pre_alpha/Module/cataBlog/CommentForm.php
<?php
/**
 * @license PHP
 * @author  Jackson Miller <hide@address.com>
 * @version $Id: CommentForm.php,v 1.1 2004/08/06 19:00:34 jaxn Exp $
 * @package cataBlog
 */

require_once('CEP/Module/cataBlog.php');
require_once('CEP/Library/cataBlog.php');
require_once('HTML/QuickForm.php');

class CEP_Module_cataBlog_CommentForm extends CEP_Module_cataBlog {
    
    var $state = 'AddComment';
    var $form;
    
    function cepInit($cep_get_vars) {
        parent::cepInit($cep_get_vars);
        
        $this->form = new HTM_QuickForm(null,'POST');
        
        $this->form->addElement('header','add comment:');
        $this->form->addElement('text',$this->cep_module_instance_name.'[cataBlog_comment_name]','name:');
        $this->form->addElement('text',$this->cep_module_instance_name.'[cataBlog_comment_email]','email:');
        $this->form->addElement('text',$this->cep_module_instance_name.'[cataBlog_comment_url]','website:');
        $this->form->addElement('text',$this->cep_module_instance_name.'[cataBlog_comment_title]','title:');
        $this->form->addElement('text',$this->cep_module_instance_name.'[cataBlog_comment_text]','comment:');
        
        return;
    }
    
    function _preRenderAddComment() {
    }
    
    function _preRenderEditComment() {
    }
    
    function _renderAddComment() {
        $this->form->addElement('submit','submit','Preview');
        $this->form->addElement('submit','submit','Add Comment!');
        $this->cepAddData($this->form->toHtml());
        return;
    }
    
    function _renderEditComment() {
        $this->form->addElement('submit','submit','Edit Comment!');
        $this->cepAddData($this->form->toHtml());
        return;
    }
}
?>
Return current item: cataBlog