Changeset 983

Show
Ignore:
Timestamp:
06/10/08 19:05:52 (6 months ago)
Author:
bibo
Message:

#610: added jResponseHtmlFragment addContent method

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/jelix/core/response/jResponseHtmlFragment.class.php

    r913 r983  
    44* @subpackage  core_response 
    55* @author      Tahina Ramaroson 
    6 * @contributor Sylvain de Vathaire 
     6* @contributor Sylvain de Vathaire, Dominique Papin 
    77* @copyright   2008 Tahina Ramaroson, Sylvain de Vathaire 
     8* @copyright   2008 Dominique Papin 
    89* @link        http://www.jelix.org 
    910* @licence     GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
     
    3637    public $tpl = null; 
    3738 
     39    /**#@+ 
     40     * content surrounding template content 
     41     * @var array 
     42     */ 
     43    protected $_contentTop = array(); 
     44    protected $_contentBottom = array(); 
     45    /**#@-*/ 
     46 
    3847    /** 
    3948    * constructor; 
     
    5968        if($this->hasErrors()) return false; 
    6069 
    61         $content = ''
     70        $content = implode("\n",$this->_contentTop)
    6271        if($this->tplname!=''){ 
    63             $content=$this->tpl->fetch($this->tplname,'html'); 
     72            $content.=$this->tpl->fetch($this->tplname,'html'); 
    6473            if($this->hasErrors()) return false; 
    6574        } 
     75        $content .= implode("\n",$this->_contentBottom); 
    6676 
    6777        $this->_httpHeaders['Content-Type']='text/plain;charset='.$gJConfig->charset; 
     
    7181        return true; 
    7282    } 
     83 
     84    /** 
     85     * add content to the response 
     86     * you can add additionnal content, before or after the content generated by the main template 
     87     * @param string $content additionnal html content 
     88     * @param boolean $beforeTpl true if you want to add it before the template content, else false for after 
     89     */ 
     90    function addContent($content, $beforeTpl = false){ 
     91      if($beforeTpl){ 
     92        $this->_contentTop[]=$content; 
     93      }else{ 
     94         $this->_contentBottom[]=$content; 
     95      } 
     96    } 
     97 
    7398 
    7499    /** 
  • trunk/lib/jelix/core/response/jResponseHtmlFragment.class.php

    r913 r983  
    44* @subpackage  core_response 
    55* @author      Tahina Ramaroson 
    6 * @contributor Sylvain de Vathaire 
     6* @contributor Sylvain de Vathaire, Dominique Papin 
    77* @copyright   2008 Tahina Ramaroson, Sylvain de Vathaire 
     8* @copyright   2008 Dominique Papin 
    89* @link        http://www.jelix.org 
    910* @licence     GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
     
    3637    public $tpl = null; 
    3738 
     39    /**#@+ 
     40     * content surrounding template content 
     41     * @var array 
     42     */ 
     43    protected $_contentTop = array(); 
     44    protected $_contentBottom = array(); 
     45    /**#@-*/ 
     46 
    3847    /** 
    3948    * constructor; 
     
    5968        if($this->hasErrors()) return false; 
    6069 
    61         $content = ''
     70        $content = implode("\n",$this->_contentTop)
    6271        if($this->tplname!=''){ 
    63             $content=$this->tpl->fetch($this->tplname,'html'); 
     72            $content.=$this->tpl->fetch($this->tplname,'html'); 
    6473            if($this->hasErrors()) return false; 
    6574        } 
     75        $content .= implode("\n",$this->_contentBottom); 
    6676 
    6777        $this->_httpHeaders['Content-Type']='text/plain;charset='.$gJConfig->charset; 
     
    7181        return true; 
    7282    } 
     83 
     84    /** 
     85     * add content to the response 
     86     * you can add additionnal content, before or after the content generated by the main template 
     87     * @param string $content additionnal html content 
     88     * @param boolean $beforeTpl true if you want to add it before the template content, else false for after 
     89     */ 
     90    function addContent($content, $beforeTpl = false){ 
     91      if($beforeTpl){ 
     92        $this->_contentTop[]=$content; 
     93      }else{ 
     94         $this->_contentBottom[]=$content; 
     95      } 
     96    } 
     97 
    7398 
    7499    /** 
  • trunk/lib/jelix/core/response/jResponseHtmlFragment.class.php

    r913 r983  
    44* @subpackage  core_response 
    55* @author      Tahina Ramaroson 
    6 * @contributor Sylvain de Vathaire 
     6* @contributor Sylvain de Vathaire, Dominique Papin 
    77* @copyright   2008 Tahina Ramaroson, Sylvain de Vathaire 
     8* @copyright   2008 Dominique Papin 
    89* @link        http://www.jelix.org 
    910* @licence     GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
     
    3637    public $tpl = null; 
    3738 
     39    /**#@+ 
     40     * content surrounding template content 
     41     * @var array 
     42     */ 
     43    protected $_contentTop = array(); 
     44    protected $_contentBottom = array(); 
     45    /**#@-*/ 
     46 
    3847    /** 
    3948    * constructor; 
     
    5968        if($this->hasErrors()) return false; 
    6069 
    61         $content = ''
     70        $content = implode("\n",$this->_contentTop)
    6271        if($this->tplname!=''){ 
    63             $content=$this->tpl->fetch($this->tplname,'html'); 
     72            $content.=$this->tpl->fetch($this->tplname,'html'); 
    6473            if($this->hasErrors()) return false; 
    6574        } 
     75        $content .= implode("\n",$this->_contentBottom); 
    6676 
    6777        $this->_httpHeaders['Content-Type']='text/plain;charset='.$gJConfig->charset; 
     
    7181        return true; 
    7282    } 
     83 
     84    /** 
     85     * add content to the response 
     86     * you can add additionnal content, before or after the content generated by the main template 
     87     * @param string $content additionnal html content 
     88     * @param boolean $beforeTpl true if you want to add it before the template content, else false for after 
     89     */ 
     90    function addContent($content, $beforeTpl = false){ 
     91      if($beforeTpl){ 
     92        $this->_contentTop[]=$content; 
     93      }else{ 
     94         $this->_contentBottom[]=$content; 
     95      } 
     96    } 
     97 
    7398 
    7499    /** 
  • trunk/lib/jelix/core/response/jResponseHtmlFragment.class.php

    r913 r983  
    44* @subpackage  core_response 
    55* @author      Tahina Ramaroson 
    6 * @contributor Sylvain de Vathaire 
     6* @contributor Sylvain de Vathaire, Dominique Papin 
    77* @copyright   2008 Tahina Ramaroson, Sylvain de Vathaire 
     8* @copyright   2008 Dominique Papin 
    89* @link        http://www.jelix.org 
    910* @licence     GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
     
    3637    public $tpl = null; 
    3738 
     39    /**#@+ 
     40     * content surrounding template content 
     41     * @var array 
     42     */ 
     43    protected $_contentTop = array(); 
     44    protected $_contentBottom = array(); 
     45    /**#@-*/ 
     46 
    3847    /** 
    3948    * constructor; 
     
    5968        if($this->hasErrors()) return false; 
    6069 
    61         $content = ''
     70        $content = implode("\n",$this->_contentTop)
    6271        if($this->tplname!=''){ 
    63             $content=$this->tpl->fetch($this->tplname,'html'); 
     72            $content.=$this->tpl->fetch($this->tplname,'html'); 
    6473            if($this->hasErrors()) return false; 
    6574        } 
     75        $content .= implode("\n",$this->_contentBottom); 
    6676 
    6777        $this->_httpHeaders['Content-Type']='text/plain;charset='.$gJConfig->charset; 
     
    7181        return true; 
    7282    } 
     83 
     84    /** 
     85     * add content to the response 
     86     * you can add additionnal content, before or after the content generated by the main template 
     87     * @param string $content additionnal html content 
     88     * @param boolean $beforeTpl true if you want to add it before the template content, else false for after 
     89     */ 
     90    function addContent($content, $beforeTpl = false){ 
     91      if($beforeTpl){ 
     92        $this->_contentTop[]=$content; 
     93      }else{ 
     94         $this->_contentBottom[]=$content; 
     95      } 
     96    } 
     97 
    7398 
    7499    /** 
  • trunk/lib/jelix/CREDITS

    r982 r983  
    6565 - improved addCssLink usability for IE (#348) 
    6666 - added support of 'else' keyword for block plugin in jtpl (#349) 
    67  - fixed bug in firebug support (#362) 
    6867 - added support of <reset> in jforms (#258) 
    69  - fixed bug in swf* plugin (#585) 
     68 - fixed some bugs (#362,#585) 
    7069 - jforms dao datasource : enhancements (#581,#582) 
    7170 - added ifctrl block plugin (#601) 
     71 - added addContent method to jResponseHtmlFragment (#610) 
    7272 
    7373Christophe Thiriot (aka Doubleface) 
  • trunk/lib/jelix/CREDITS

    r982 r983  
    6565 - improved addCssLink usability for IE (#348) 
    6666 - added support of 'else' keyword for block plugin in jtpl (#349) 
    67  - fixed bug in firebug support (#362) 
    6867 - added support of <reset> in jforms (#258) 
    69  - fixed bug in swf* plugin (#585) 
     68 - fixed some bugs (#362,#585) 
    7069 - jforms dao datasource : enhancements (#581,#582) 
    7170 - added ifctrl block plugin (#601) 
     71 - added addContent method to jResponseHtmlFragment (#610) 
    7272 
    7373Christophe Thiriot (aka Doubleface) 
  • trunk/lib/jelix/CREDITS

    r982 r983  
    6565 - improved addCssLink usability for IE (#348) 
    6666 - added support of 'else' keyword for block plugin in jtpl (#349) 
    67  - fixed bug in firebug support (#362) 
    6867 - added support of <reset> in jforms (#258) 
    69  - fixed bug in swf* plugin (#585) 
     68 - fixed some bugs (#362,#585) 
    7069 - jforms dao datasource : enhancements (#581,#582) 
    7170 - added ifctrl block plugin (#601) 
     71 - added addContent method to jResponseHtmlFragment (#610) 
    7272 
    7373Christophe Thiriot (aka Doubleface) 
  • trunk/lib/jelix/CREDITS

    r982 r983  
    6565 - improved addCssLink usability for IE (#348) 
    6666 - added support of 'else' keyword for block plugin in jtpl (#349) 
    67  - fixed bug in firebug support (#362) 
    6867 - added support of <reset> in jforms (#258) 
    69  - fixed bug in swf* plugin (#585) 
     68 - fixed some bugs (#362,#585) 
    7069 - jforms dao datasource : enhancements (#581,#582) 
    7170 - added ifctrl block plugin (#601) 
     71 - added addContent method to jResponseHtmlFragment (#610) 
    7272 
    7373Christophe Thiriot (aka Doubleface) 
Download in other formats: Unified Diff Zip Archive