Changeset 1173

Show
Ignore:
Timestamp:
11/19/08 16:20:20 (2 months ago)
Author:
bibo
Message:

ticket #710 : support external absolute url as jform action

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/jelix/plugins/jforms/html/html.jformsbuilder.php

    r1167 r1173  
    44* @subpackage  forms 
    55* @author      Laurent Jouanneau 
    6 * @contributor Julien Issler 
     6* @contributor Julien Issler, Dominique Papin 
    77* @copyright   2006-2008 Laurent Jouanneau 
    8 * @copyright   2008 Julien Issler 
     8* @copyright   2008 Julien Issler, 2008 Dominique Papin 
    99* @link        http://www.jelix.org 
    1010* @licence     http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file 
     
    9797                 'helpDecorator'=>'jFormsJQHelpDecoratorAlert', 'method'=>'post'), $params); 
    9898 
    99         $url = jUrl::get($this->_action, $this->_actionParams, 2); // retourne le jurl correspondant 
    100         echo '<form action="',$url->getPath(),'" method="'.$this->options['method'].'" id="', $this->_name,'"'; 
     99 
     100        if (preg_match('/^http:\/\//',$this->_action)) { 
     101            $urlParams = $this->_actionParams; 
     102            echo '<form action="',$this->_action,'" method="'.$this->options['method'].'" id="', $this->_name,'"'; 
     103        } else { 
     104            $url = jUrl::get($this->_action, $this->_actionParams, 2); // retourne le jurl correspondant 
     105            $urlParams = $url->params; 
     106            echo '<form action="',$url->getPath(),'" method="'.$this->options['method'].'" id="', $this->_name,'"'; 
     107        } 
    101108        if($this->_form->hasUpload()) 
    102109            echo ' enctype="multipart/form-data">'; 
     
    114121 
    115122        $hiddens = ''; 
    116         foreach ($url->params as $p_name => $p_value) { 
     123        foreach ($urlParams as $p_name => $p_value) { 
    117124            $hiddens .= '<input type="hidden" name="'. $p_name .'" value="'. htmlspecialchars($p_value). '"'.$this->_endt. "\n"; 
    118125        } 
     
    586593                $displayedControls = true; 
    587594                echo ' <span class="jforms-item-controls">'; 
    588                 // we remove readonly status so when a user change the choice and  
     595                // we remove readonly status so when a user change the choice and 
    589596                // javascript is deactivated, it can still change the value of the control 
    590597                $ro = $c->isReadOnly(); 
  • trunk/lib/jelix/plugins/jforms/htmllight/htmllight.jformsbuilder.php

    r1167 r1173  
    44* @subpackage  forms 
    55* @author      Laurent Jouanneau 
    6 * @contributor Julien Issler 
     6* @contributor Julien Issler, Dominique Papin 
    77* @copyright   2006-2008 Laurent Jouanneau 
    8 * @copyright   2008 Julien Issler 
     8* @copyright   2008 Julien Issler, 2008 Dominique Papin 
    99* @link        http://www.jelix.org 
    1010* @licence     http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file 
     
    9696                 'helpDecorator'=>'jFormsHelpDecoratorAlert', 'method'=>'post'), $params); 
    9797 
    98         $url = jUrl::get($this->_action, $this->_actionParams, 2); // retourne le jurl correspondant 
    99         echo '<form action="',$url->getPath(),'" method="'.$this->options['method'].'" id="', $this->_name,'"'; 
     98        if (preg_match('/^http:\/\//',$this->_action)) { 
     99            $urlParams = $this->_actionParams; 
     100            echo '<form action="',$this->_action,'" method="'.$this->options['method'].'" id="', $this->_name,'"'; 
     101        } else { 
     102            $url = jUrl::get($this->_action, $this->_actionParams, 2); // retourne le jurl correspondant 
     103            $urlParams = $url->params; 
     104            echo '<form action="',$url->getPath(),'" method="'.$this->options['method'].'" id="', $this->_name,'"'; 
     105        } 
    100106        if($this->_form->hasUpload()) 
    101107            echo ' enctype="multipart/form-data">'; 
     
    113119 
    114120        $hiddens = ''; 
    115         foreach ($url->params as $p_name => $p_value) { 
     121        foreach ($urlParams as $p_name => $p_value) { 
    116122            $hiddens .= '<input type="hidden" name="'. $p_name .'" value="'. htmlspecialchars($p_value). '"'.$this->_endt. "\n"; 
    117123        } 
     
    585591                $displayedControls = true; 
    586592                echo ' <span class="jforms-item-controls">'; 
    587                 // we remove readonly status so when a user change the choice and  
     593                // we remove readonly status so when a user change the choice and 
    588594                // javascript is deactivated, it can still change the value of the control 
    589595                $ro = $c->isReadOnly(); 
Download in other formats: Unified Diff Zip Archive