Changeset 1196

Show
Ignore:
Timestamp:
12/02/08 16:05:45 (1 month ago)
Author:
julieni
Message:

backports of a bunch of patches from the trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0.x/lib/jelix/core-modules/jelix/templates/atom10.tpl

    r755 r1196  
    8686  </entry> 
    8787  {/foreach} 
    88 <!-- fin generee par le response --> 
     88{* endtag is generated by the response *} 
  • branches/1.0.x/lib/jelix/core-modules/jelix/templates/rss20.tpl

    r705 r1196  
    5858 
    5959 </channel> 
    60 <!-- fin generee par le response --> 
     60{* endtag is generated by the response *} 
  • branches/1.0.x/lib/jelix/core/jCoordinator.class.php

    r821 r1196  
    2323class jCoordinator { 
    2424 
    25    /** 
    26     * plugin list 
    27     * @var  array 
    28     */ 
     25    /** 
     26    * plugin list 
     27    * @var  array 
     28    */ 
    2929    public $plugins=array(); 
    3030 
     
    280280     * instancy a response object corresponding to the default response type 
    281281     * of the current resquest 
     282     * @param boolean $originalResponse TRUE to get the original, non overloaded response 
    282283     * @return mixed  error string or false 
    283284     */ 
    284     public function initDefaultResponseOfRequest(){ 
    285         global $gJConfig; 
     285    public function initDefaultResponseOfRequest($originalResponse = false){ 
     286        if($originalResponse) 
     287                $responses = &$GLOBALS['gJConfig']->_coreResponses; 
     288        else 
     289                $responses = &$GLOBALS['gJConfig']->responses; 
    286290 
    287291        $type= $this->request->defaultResponseType; 
    288292 
    289         if(!isset($gJConfig->responses[$type])){ 
     293        if(!isset($responses[$type])) 
    290294            return jLocale::get('jelix~errors.default.response.type.unknow',array($this->moduleName.'~'.$this->actionName,$type)); 
    291         } 
    292  
    293         $respclass = $gJConfig->responses[$type]; 
    294         if(file_exists($path=JELIX_LIB_RESPONSE_PATH.$respclass.'.class.php')){ 
    295             require_once ($path); 
    296         }elseif(file_exists($path=JELIX_APP_PATH.'responses/'.$respclass.'.class.php')){ 
    297             require_once ($path); 
    298         }else{ 
    299             return jLocale::get('jelix~errors.default.response.not.loaded',array($this->moduleName.'~'.$this->actionName,$type)); 
    300         } 
    301  
    302         $this->response = new $respclass(); 
    303  
    304         return false; 
     295 
     296        try{ 
     297            $respclass = $responses[$type]; 
     298            if($originalResponse) 
     299                $path = JELIX_LIB_RESPONSE_PATH.$respclass.'.class.php'; 
     300            else 
     301                $path = JELIX_APP_PATH.'responses/'.$respclass.'.class.php'; 
     302 
     303            if(!file_exists($path)) 
     304                throw new Exception(); 
     305 
     306            require_once($path); 
     307 
     308            $this->response = new $respclass(); 
     309            return false; 
     310        } 
     311        catch(Exception $e){ 
     312            if($originalResponse) 
     313                return jLocale::get('jelix~errors.default.response.not.loaded',array($this->moduleName.'~'.$this->actionName,$type)); 
     314            return $this->initDefaultResponseOfRequest(true); 
     315        } 
    305316    } 
    306317 
  • branches/1.0.x/lib/jelix/core/jSelector.class.php

    r887 r1196  
    1515* @contributor Thibault PIRONT < nuKs > 
    1616* @contributor Julien Issler 
     17* @contributor Baptiste Toinot 
    1718* @copyright   2005-2007 Laurent Jouanneau, 2007 Loic Mathaud, 2007 Rahal 
    1819* @copyright   2007 Thibault PIRONT 
    1920* @copyright   2008 Julien Issler 
     21* @copyright   2008 Baptiste Toinot 
    2022* @link        http://www.jelix.org 
    2123* @licence    GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
     
    520522            } 
    521523            // else check for the original locale file 
    522             $path = $gJConfig->_modulesPathList[$this->module].'/locales/'.$locale.'/'.$this->resource.$this->_suffix; 
     524            $path = $gJConfig->_modulesPathList[$this->module].'locales/'.$locale.'/'.$this->resource.$this->_suffix; 
    523525            if (is_readable ($path)){ 
    524526                $this->_where = 'modules/'; 
  • branches/1.0.x/lib/jelix/CREDITS

    r1177 r1196  
    8686 - jDao: autoremove of empty groups in jDaoConditions (#724) 
    8787 - jForms: server side check for <input type="url"> doesn't work (#743) 
     88 - jForms: some controls are selected by default if their values are "0" (#757) 
     89 - jCoordinator: exception loop when response's constructor fails (#749) 
    8890 
    8991Bastien Jaillot (aka bastnic) 
     
    153155 - fixed bugs in jDao (#576, #643) 
    154156 
     157Baptiste Toinot (aka Surfoo) 
     158 - double / in path for locale selector 
     159  
    155160Christian Tritten 
    156161 - improvements on pagelinks plugin (#340) 
  • branches/1.0.x/lib/jelix/forms/jFormsBuilderBase.class.php

    r946 r1196  
    205205 
    206206            if(is_array($value)){ 
     207                $value = array_map(create_function('$v', 'return (string) $v;'),$value); 
    207208                foreach($ctrl->datasource->getDatas() as $v=>$label){ 
    208209                    echo $span,$attrs,$i,'" value="',htmlspecialchars($v),'"'; 
    209                     if(in_array($v,$value)) 
     210                    if(in_array((string) $v,$value,true)) 
    210211                        echo ' checked="checked"'; 
    211212                    echo $readonly,$class,$this->_endt,'<label for="',$id,$i,'">',htmlspecialchars($label),'</label></span>'; 
     
    213214                } 
    214215            }else{ 
     216                $value = (string) $value; 
    215217                foreach($ctrl->datasource->getDatas() as $v=>$label){ 
    216218                    echo $span,$attrs,$i,'" value="',htmlspecialchars($v),'"'; 
    217                     if($v == $value) 
     219                    if((string) $v === $value) 
    218220                        echo ' checked="checked"'; 
    219221                    echo $readonly,$class,$this->_endt,'<label for="',$id,$i,'">',htmlspecialchars($label),'</label></span>'; 
     
    232234                    $value=''; 
    233235            } 
     236            $value = (string) $value; 
    234237            $span ='<span class="jforms-radio jforms-ctl-'.$ctrl->ref.'"><input type="radio"'; 
    235238            foreach($ctrl->datasource->getDatas() as $v=>$label){ 
    236                 echo $span,$id,$i,'" value="',htmlspecialchars($v),'"',($v==$value?' checked="checked"':''),$readonly,$class,$this->_endt; 
     239                echo $span,$id,$i,'" value="',htmlspecialchars($v),'"',((string) $v===$value?' checked="checked"':''),$readonly,$class,$this->_endt; 
    237240                echo '<label for="',$this->_name,'_',$ctrl->ref,'_',$i,'">',htmlspecialchars($label),'</label></span>'; 
    238241                $i++; 
     
    248251                    $value=''; 
    249252            } 
     253            $value = (string) $value; 
    250254            if (!$ctrl->required) { 
    251                 echo '<option value=""',($value==''?' selected="selected"':''),'></option>'; 
     255                echo '<option value=""',($value===''?' selected="selected"':''),'></option>'; 
    252256            } 
    253257            foreach($ctrl->datasource->getDatas() as $v=>$label){ 
    254                 echo '<option value="',htmlspecialchars($v),'"',($v==$value?' selected="selected"':''),'>',htmlspecialchars($label),'</option>'; 
     258                echo '<option value="',htmlspecialchars($v),'"',((string) $v===$value?' selected="selected"':''),'>',htmlspecialchars($label),'</option>'; 
    255259            } 
    256260            echo '</select>'; 
     
    265269 
    266270                if(is_array($value)){ 
     271                    $value = array_map(create_function('$v', 'return (string) $v;'),$value); 
    267272                    foreach($ctrl->datasource->getDatas() as $v=>$label){ 
    268                         echo '<option value="',htmlspecialchars($v),'"',(in_array($v,$value)?' selected="selected"':''),'>',htmlspecialchars($label),'</option>'; 
     273                        echo '<option value="',htmlspecialchars($v),'"',(in_array((string) $v,$value,true)?' selected="selected"':''),'>',htmlspecialchars($label),'</option>'; 
    269274                    } 
    270275                }else{ 
     276                    $value = (string) $value; 
    271277                    foreach($ctrl->datasource->getDatas() as $v=>$label){ 
    272                         echo '<option value="',htmlspecialchars($v),'"',($v==$value?' selected="selected"':''),'>',htmlspecialchars($label),'</option>'; 
     278                        echo '<option value="',htmlspecialchars($v),'"',((string) $v===$value?' selected="selected"':''),'>',htmlspecialchars($label),'</option>'; 
    273279                    } 
    274280                } 
     
    283289                        $value =''; 
    284290                } 
    285  
     291                $value = (string) $value; 
    286292                echo '<select',$id,$hint,$class,' size="',$ctrl->size,'">'; 
    287293                foreach($ctrl->datasource->getDatas() as $v=>$label){ 
    288                     echo '<option value="',htmlspecialchars($v),'"',($v==$value?' selected="selected"':''),'>',htmlspecialchars($label),'</option>'; 
     294                    echo '<option value="',htmlspecialchars($v),'"',((string) $v===$value?' selected="selected"':''),'>',htmlspecialchars($label),'</option>'; 
    289295                } 
    290296                echo '</select>'; 
Download in other formats: Unified Diff Zip Archive