Ticket #646: 646-jForms-jTpl-html-plugins-textarea-should-render-linebreaks.diff

File 646-jForms-jTpl-html-plugins-textarea-should-render-linebreaks.diff, 2.2 kB (added by Julien, 6 months ago)

for the trunk

  • lib/jelix/plugins/tpl/html/function.formdatafull.php

    old new  
    33* @package      jelix 
    44* @subpackage   jtpl_plugin 
    55* @author       Laurent Jouanneau 
    6 * @contributor  Dominique Papin 
     6* @contributor  Dominique Papin, Julien Issler 
    77* @copyright    2007-2008 Laurent Jouanneau, 2007 Dominique Papin 
     8* @copyright    2008 Julien Issler 
    89* @link         http://www.jelix.org 
    910* @licence      GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
    1011*/ 
     
    3334                $s.=','.htmlspecialchars($v); 
    3435            } 
    3536            echo substr($s, 1); 
    36         }elseif($ctrl->datatype instanceof jDatatypeHtml) { 
     37        }elseif($ctrl->datatype instanceof jDatatypeHtml) 
    3738            echo $value; 
    38         }else 
     39        else if($ctrl->type == 'textarea') 
     40            echo nl2br(htmlspecialchars($value)); 
     41        else 
    3942            echo htmlspecialchars($value); 
    4043 
    4144        echo '</td></tr>'; 
  • lib/jelix/plugins/tpl/html/function.ctrl_value.php

    old new  
    33* @package      jelix 
    44* @subpackage   jtpl_plugin 
    55* @author       Laurent Jouanneau 
    6 * @contributor  Dominique Papin 
     6* @contributor  Dominique Papin, Julien Issler 
    77* @copyright    2007-2008 Laurent Jouanneau, 2007 Dominique Papin 
     8* @copyright    2008 Julien Issler 
    89* @link         http://www.jelix.org 
    910* @licence      GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
    1011*/ 
     
    5354            $s.=$sep.htmlspecialchars($v); 
    5455        } 
    5556        echo substr($s, strlen($sep)); 
    56     }elseif($ctrl->datatype instanceof jDatatypeHtml) { 
     57    }elseif($ctrl->datatype instanceof jDatatypeHtml) 
    5758        echo $value; 
    58     }else 
     59    else if($ctrl->type == 'textarea') 
     60        echo nl2br(htmlspecialchars($value)); 
     61    else 
    5962        echo htmlspecialchars($value); 
    6063} 
Download in other formats: Original Format