Changeset 236

Show
Ignore:
Timestamp:
01/06/08 22:35:12 (1 year ago)
Author:
shupp
Message:

fix AliasDomain? class so that errors are displayed on server side validation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Framework/Module/Main/AliasDomain.php

    r232 r236  
    4747     * Display add form 
    4848     *  
     49     * @param object $form HTML_QuickForm object, default null 
     50     *  
    4951     * @access public 
    5052     * @return void 
    5153     */ 
    52     public function add(
     54    public function add($form = null
    5355    { 
    54         $this->setData('addForm', $this->_addForm()->toHtml());     
     56        if (is_null($form)) { 
     57            $form = $this->_addForm(); 
     58        } 
     59        $this->_renderForm($form); 
    5560        $this->tplFile = 'addAliasDomain.tpl'; 
    5661        return; 
     
    6873        $form = $this->_addForm(); 
    6974        if (!$form->validate()) { 
    70             return $this->add(); 
     75            return $this->add($form); 
    7176        } 
    7277        $domain = $form->getElementValue('domain'); 
     
    7984        } catch (Net_Vpopmaild_Exception $e) { 
    8085            $this->setData('message', _('Error:') . $e->getMessage()); 
    81             return $this->add(); 
     86            return $this->add($form); 
    8287        } 
    8388 
     
    111116        return $form; 
    112117    } 
     118 
     119    private function _renderForm($form) 
     120    { 
     121        $this->setData('addForm', $form->toHtml());     
     122    } 
    113123} 
    114124?>