Changeset 3610

Show
Ignore:
Timestamp:
01/22/07 01:42:07 (6 years ago)
Author:
gregmac
Message:

Quickform Patch - better handling of empty headers

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/quickform/amp_conf/htdocs/admin/common/HTML/QuickForm/Renderer/Tableless.php

    r3578 r3610  
    136136        $name = $header->getName(); 
    137137        $id = empty($name) ? '' : ' id="' . $name . '"'; 
     138        $title = $header->toHtml(); 
    138139        if (!empty($name) && isset($this->_templates[$name])) { 
    139             $header_html = str_replace('{header}', $header->toHtml(), $this->_templates[$name]); 
    140         } else { 
    141             $header_html = str_replace('{header}', $header->toHtml(), $this->_headerTemplate); 
     140            $header_html = str_replace('{header}', $title, $this->_templates[$name]); 
     141        } else { 
     142            $header_html = str_replace('{header}', $title, $this->_headerTemplate); 
    142143        } 
    143144        if ($this->_fieldsetsOpen > 0) { 
     
    145146            $this->_fieldsetsOpen--; 
    146147        } 
    147         $openFieldsetTemplate = str_replace('{id}', $id, $this->_openFieldsetTemplate); 
    148         $this->_html .= $openFieldsetTemplate . $header_html; 
     148        if (empty($title)) { 
     149            $this->_html .= $this->_openHiddenFieldsetTemplate; 
     150        } else { 
     151            $openFieldsetTemplate = str_replace('{id}', $id, $this->_openFieldsetTemplate); 
     152            $this->_html .= $openFieldsetTemplate . $header_html; 
     153        } 
    149154        $this->_fieldsetsOpen++; 
    150155    } // end func renderHeader