Ticket #468: ticket468.diff
| File ticket468.diff, 87.1 kB (added by laurentj, 10 months ago) |
|---|
-
build/manifests/jelix-lib.mn
old new 87 87 cd lib/jelix/core-modules/jelix/install/sql 88 88 delete.mysql.sql 89 89 install_jacl.schema.mysql.sql 90 install_jacl.data s.mysql.sql90 install_jacl.data.mysql.sql 91 91 install_jsession.schema.mysql.sql 92 92 delete.pgsql.sql 93 93 install_jacl.schema.pgsql.sql 94 install_jacl.data s.pgsql.sql94 install_jacl.data.pgsql.sql 95 95 install_jsession.schema.pgsql.sql 96 96 97 97 cd lib/jelix/core-modules/jelix/locales/en_US … … 445 445 modifier.nl2br.php 446 446 meta.html.php 447 447 cfunction.formfull.php 448 function.formdata sfull.php448 function.formdatafull.php 449 449 function.formurl.php 450 450 function.formurlparam.php 451 451 function.diff.php 452 452 block.form.php 453 453 block.formcontrols.php 454 block.formdata s.php454 block.formdata.php 455 455 block.formsubmits.php 456 456 function.ctrl_control.php 457 457 function.ctrl_label.php -
testapp/modules/testapp/templates/forms_liste.tpl
old new 6 6 {foreach $liste as $id=>$form} 7 7 <tr> 8 8 <td>{$id}</td> 9 <td>{$form->data s['nom']}</td>10 <td>{$form->data s['prenom']}</td>9 <td>{$form->data['nom']}</td> 10 <td>{$form->data['prenom']}</td> 11 11 <td> 12 12 <a href="{jurl 'forms:view',array('id'=>$id)}">voir</a> 13 13 <a href="{jurl 'forms:showform',array('id'=>$id)}">éditer</a> -
testapp/modules/testapp/templates/forms_edit.tpl
old new 4 4 <form action="{jurl 'forms:save'}" method="POST"> 5 5 <fieldset> 6 6 <legend>Votre identité</legend> 7 <p><label for="nom">Nom :</label> <input type="text" name="nom" id="nom" value="{$form->data s['nom']}"/></p>8 <p><label for="prenom">Prenom :</label> <input type="text" name="prenom" id="prenom" value="{$form->data s['prenom']}" /></p>7 <p><label for="nom">Nom :</label> <input type="text" name="nom" id="nom" value="{$form->data['nom']}"/></p> 8 <p><label for="prenom">Prenom :</label> <input type="text" name="prenom" id="prenom" value="{$form->data['prenom']}" /></p> 9 9 10 10 </fieldset> 11 11 <p>id form : <input type="text" name="newid" value="{$id}" -
testapp/modules/jelix_tests/tests/core.selectors_action.html.php
old new 131 131 && $s->method == $res[2] 132 132 && $s->request == $res[3]; 133 133 if(!$ok) 134 $msg=' contains unexpected data s('.$s->module.', '.$s->controller.', '.$s->method.', '.$s->request.')';134 $msg=' contains unexpected data ('.$s->module.', '.$s->controller.', '.$s->method.', '.$s->request.')'; 135 135 } 136 136 137 137 $this->assertTrue($ok , ' test of '.$sel. ' (should be '.($res === false ? 'invalid':'valid').')'); … … 182 182 && $s->method == $res[2] 183 183 && $s->request == $res[3]; 184 184 if(!$valid) 185 $msg=' contains unexpected data s('.$s->module.', '.$s->controller.', '.$s->method.', '.$s->request.')';185 $msg=' contains unexpected data ('.$s->module.', '.$s->controller.', '.$s->method.', '.$s->request.')'; 186 186 } 187 187 188 188 $this->assertTrue($valid , ' test of '.$sel. ' (should be '.($res === false ? 'invalid':'valid').')'); -
testapp/modules/jelix_tests/tests/jforms.html_cli.php
old new 24 24 <object method="getContainer()" class="jFormsDataContainer"> 25 25 <integer property="formId" value="'.jForms::DEFAULT_ID.'" /> 26 26 <string property="formSelector" value="product" /> 27 <array property="data s">27 <array property="data"> 28 28 <string key="name" value="" /> 29 29 <string key="price" value="" /> 30 30 </array> 31 31 <array property="errors">array()</array> 32 32 </object> 33 <array method="get Datas()">33 <array method="getAllData()"> 34 34 <string key="name" value="" /> 35 35 <string key="price" value="" /> 36 36 </array> … … 59 59 <object method="getContainer()" class="jFormsDataContainer"> 60 60 <string property="formId" value="akey" /> 61 61 <string property="formSelector" value="product" /> 62 <array property="data s">62 <array property="data"> 63 63 <string key="name" value="" /> 64 64 <string key="price" value="" /> 65 65 </array> 66 66 <array property="errors">array()</array> 67 67 </object> 68 <array method="get Datas()">68 <array method="getAllData()"> 69 69 <string key="name" value="" /> 70 70 <string key="price" value="" /> 71 71 </array> … … 93 93 <object method="getContainer()" class="jFormsDataContainer"> 94 94 <array property="formId">array(1,\'fr\')</array> 95 95 <string property="formSelector" value="label" /> 96 <array property="data s">96 <array property="data"> 97 97 <string key="label" value="" /> 98 98 </array> 99 99 <array property="errors">array()</array> 100 100 </object> 101 <array method="get Datas()">101 <array method="getAllData()"> 102 102 <string key="label" value="" /> 103 103 </array> 104 104 <array method="id()">array(1,\'fr\')</array> … … 124 124 <object key="'.jForms::DEFAULT_ID.'" class="jFormsDataContainer"> 125 125 <integer property="formId" value="'.jForms::DEFAULT_ID.'" /> 126 126 <string property="formSelector" value="product" /> 127 <array property="data s">127 <array property="data"> 128 128 <string key="name" value="" /> 129 129 <string key="price" value="" /> 130 130 </array> … … 142 142 <object key="'.jForms::DEFAULT_ID.'" class="jFormsDataContainer"> 143 143 <integer property="formId" value="'.jForms::DEFAULT_ID.'" /> 144 144 <string property="formSelector" value="product" /> 145 <array property="data s">145 <array property="data"> 146 146 <string key="name" value="" /> 147 147 <string key="price" value="" /> 148 148 </array> … … 151 151 <object key="akey" class="jFormsDataContainer"> 152 152 <string property="formId" value="akey" /> 153 153 <string property="formSelector" value="product" /> 154 <array property="data s">154 <array property="data"> 155 155 <string key="name" value="" /> 156 156 <string key="price" value="" /> 157 157 </array> … … 170 170 <object key="'.jForms::DEFAULT_ID.'" class="jFormsDataContainer"> 171 171 <integer property="formId" value="'.jForms::DEFAULT_ID.'" /> 172 172 <string property="formSelector" value="product" /> 173 <array property="data s">173 <array property="data"> 174 174 <string key="name" value="" /> 175 175 <string key="price" value="" /> 176 176 </array> … … 179 179 <object key="akey" class="jFormsDataContainer"> 180 180 <string property="formId" value="akey" /> 181 181 <string property="formSelector" value="product" /> 182 <array property="data s">182 <array property="data"> 183 183 <string key="name" value="" /> 184 184 <string key="price" value="" /> 185 185 </array> … … 190 190 <object key="a:2:{i:0;i:1;i:1;s:2:"fr";}" class="jFormsDataContainer"> 191 191 <array property="formId">array(1,\'fr\')</array> 192 192 <string property="formSelector" value="label" /> 193 <array property="data s">193 <array property="data"> 194 194 <string key="label" value="" /> 195 195 </array> 196 196 <array property="errors">array()</array> … … 234 234 <object method="getContainer()" class="jFormsDataContainer"> 235 235 <integer property="formId" value="'.jForms::DEFAULT_ID.'" /> 236 236 <string property="formSelector" value="product" /> 237 <array property="data s">237 <array property="data"> 238 238 <string key="name" value="phone" /> 239 239 <string key="price" value="45" /> 240 240 </array> 241 241 <array property="errors">array()</array> 242 242 </object> 243 <array method="get Datas()">243 <array method="getAllData()"> 244 244 <string key="name" value="phone" /> 245 245 <string key="price" value="45" /> 246 246 </array> … … 274 274 <object method="getContainer()" class="jFormsDataContainer"> 275 275 <integer property="formId" value="akey" /> 276 276 <string property="formSelector" value="product" /> 277 <array property="data s">277 <array property="data"> 278 278 <string key="name" value="phone" /> 279 279 <string key="price" value="45" /> 280 280 </array> 281 281 <array property="errors">array()</array> 282 282 </object> 283 <array method="get Datas()">283 <array method="getAllData()"> 284 284 <string key="name" value="phone" /> 285 285 <string key="price" value="45" /> 286 286 </array> … … 316 316 <object key="akey" class="jFormsDataContainer"> 317 317 <string property="formId" value="akey" /> 318 318 <string property="formSelector" value="product" /> 319 <array property="data s">319 <array property="data"> 320 320 <string key="name" value="phone" /> 321 321 <string key="price" value="45" /> 322 322 </array> … … 327 327 <object key="a:2:{i:0;i:1;i:1;s:2:"fr";}" class="jFormsDataContainer"> 328 328 <array property="formId">array(1,\'fr\')</array> 329 329 <string property="formSelector" value="label" /> 330 <array property="data s">330 <array property="data"> 331 331 <string key="label" value="" /> 332 332 </array> 333 333 <array property="errors">array()</array> … … 344 344 <object key="a:2:{i:0;i:1;i:1;s:2:"fr";}" class="jFormsDataContainer"> 345 345 <array property="formId">array(1,\'fr\')</array> 346 346 <string property="formSelector" value="label" /> 347 <array property="data s">347 <array property="data"> 348 348 <string key="label" value="" /> 349 349 </array> 350 350 <array property="errors">array()</array> -
testapp/modules/jelix_tests/tests/jforms.compiler.html_cli.php
old new 397 397 28=>'$ctrl= new jFormsControlcheckboxes(\'nom\'); 398 398 $ctrl->label=\'Votre nom\'; 399 399 $ctrl->datasource= new jFormStaticDatasource(); 400 $ctrl->datasource->data s= array(400 $ctrl->datasource->data = array( 401 401 \'aaa\'=>\'1aa\', 402 402 \'bbb\'=>jLocale::get(\'locb\'), 403 403 \'ccc\'=>\'ccc\', … … 410 410 30=>'$ctrl= new jFormsControlradiobuttons(\'nom\'); 411 411 $ctrl->label=\'Votre nom\'; 412 412 $ctrl->datasource= new jFormStaticDatasource(); 413 $ctrl->datasource->data s= array(413 $ctrl->datasource->data = array( 414 414 \'aaa\'=>\'1aa\', 415 415 \'bbb\'=>jLocale::get(\'locb\'), 416 416 \'ccc\'=>\'ccc\', … … 424 424 $ctrl->label=\'Votre nom\'; 425 425 $ctrl->size=8; 426 426 $ctrl->datasource= new jFormStaticDatasource(); 427 $ctrl->datasource->data s= array(427 $ctrl->datasource->data = array( 428 428 \'aaa\'=>\'1aa\', 429 429 \'bbb\'=>jLocale::get(\'locb\'), 430 430 \'ccc\'=>\'ccc\', … … 437 437 34=>'$ctrl= new jFormsControlmenulist(\'nom\'); 438 438 $ctrl->label=\'Votre nom\'; 439 439 $ctrl->datasource= new jFormStaticDatasource(); 440 $ctrl->datasource->data s= array(440 $ctrl->datasource->data = array( 441 441 \'aaa\'=>\'1aa\', 442 442 \'bbb\'=>jLocale::get(\'locb\'), 443 443 \'ccc\'=>\'ccc\', … … 451 451 36=>'$ctrl= new jFormsControllistbox(\'nom\'); 452 452 $ctrl->label=\'Votre nom\'; 453 453 $ctrl->datasource= new jFormStaticDatasource(); 454 $ctrl->datasource->data s= array(454 $ctrl->datasource->data = array( 455 455 \'aaa\'=>\'1aa\', 456 456 \'bbb\'=>jLocale::get(\'locb\'), 457 457 \'ccc\'=>\'ccc\', … … 464 464 38=>'$ctrl= new jFormsControllistbox(\'nom\'); 465 465 $ctrl->label=\'Votre nom\'; 466 466 $ctrl->datasource= new jFormStaticDatasource(); 467 $ctrl->datasource->data s= array(467 $ctrl->datasource->data = array( 468 468 \'aaa\'=>\'1aa\', 469 469 \'bbb\'=>jLocale::get(\'locb\'), 470 470 \'ccc\'=>\'ccc\', … … 476 476 39=>'$ctrl= new jFormsControllistbox(\'nom\'); 477 477 $ctrl->label=\'Votre nom\'; 478 478 $ctrl->datasource= new jFormStaticDatasource(); 479 $ctrl->datasource->data s= array(479 $ctrl->datasource->data = array( 480 480 \'aaa\'=>\'1aa\', 481 481 \'bbb\'=>jLocale::get(\'locb\'), 482 482 \'ccc\'=>\'ccc\', … … 491 491 $ctrl->label=\'Votre nom\'; 492 492 $ctrl->defaultValue=array(\'aaa\'); 493 493 $ctrl->datasource= new jFormStaticDatasource(); 494 $ctrl->datasource->data s= array(494 $ctrl->datasource->data = array( 495 495 \'aaa\'=>\'1aa\', 496 496 \'bbb\'=>jLocale::get(\'locb\'), 497 497 \'ccc\'=>\'ccc\', … … 502 502 $ctrl->label=\'Votre nom\'; 503 503 $ctrl->defaultValue= array(\'bbb\',\'aaa\',); 504 504 $ctrl->datasource= new jFormStaticDatasource(); 505 $ctrl->datasource->data s= array(505 $ctrl->datasource->data = array( 506 506 \'aaa\'=>\'1aa\', 507 507 \'bbb\'=>jLocale::get(\'locb\'), 508 508 \'ccc\'=>\'ccc\', … … 571 571 $ctrl->label=\'Type de validation\'; 572 572 $ctrl->standalone=false; 573 573 $ctrl->datasource= new jFormStaticDatasource(); 574 $ctrl->datasource->data s= array(574 $ctrl->datasource->data = array( 575 575 \'aaa\'=>\'1aa\', 576 576 \'bbb\'=>jLocale::get(\'locb\'), 577 577 \'ccc\'=>\'ccc\', -
testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html_cli.php
old new 24 24 public $reset= null; 25 25 public $container; 26 26 27 protected $data s= array( 'chk'=>'1', 'chk2'=>'', 'choixsimple'=>'11', 'choixmultiple'=>array('10','23'));27 protected $data = array( 'chk'=>'1', 'chk2'=>'', 'choixsimple'=>'11', 'choixmultiple'=>array('10','23')); 28 28 function __construct(){ 29 29 $this->container = new jFormsDataContainer('',''); 30 30 } 31 31 32 32 function getData($name) { 33 if(isset($this->data s[$name]))34 return $this->data s[$name];33 if(isset($this->data[$name])) 34 return $this->data[$name]; 35 35 else 36 36 return null; 37 37 } 38 38 function setData($name,$value) { 39 $this->data s[$name]=$value;39 $this->data[$name]=$value; 40 40 } 41 41 function getControls() { 42 42 return $this->controls; … … 60 60 $this->reset = $control; 61 61 else if($control->type =='hidden') 62 62 $this->_hiddens [$control->ref] = $control; 63 $this->data s[$control->ref] = $control->defaultValue;63 $this->data[$control->ref] = $control->defaultValue; 64 64 } 65 65 } 66 66 … … 240 240 $ctrl->datatype= new jDatatypeString(); 241 241 $ctrl->label='Vos choix'; 242 242 $ctrl->datasource= new jFormStaticDatasource(); 243 $ctrl->datasource->data s= array(243 $ctrl->datasource->data = array( 244 244 '10'=>'foo', 245 245 '11'=>'bar', 246 246 '23'=>'baz', … … 283 283 $this->assertEqualOrDiff($result, $out); 284 284 285 285 $ctrl->datasource= new jFormStaticDatasource(); 286 $ctrl->datasource->data s= array(286 $ctrl->datasource->data = array( 287 287 '10'=>'foo', 288 288 '11'=>'bar', 289 289 '23'=>'baz', … … 325 325 $this->assertEqualOrDiff($result, $out); 326 326 327 327 $ctrl->datasource= new jFormStaticDatasource(); 328 $ctrl->datasource->data s= array(328 $ctrl->datasource->data = array( 329 329 '10'=>'foo', 330 330 '11'=>'bar', 331 331 '23'=>'baz', … … 389 389 $this->assertEqualOrDiff($result, $out); 390 390 391 391 $ctrl->datasource= new jFormStaticDatasource(); 392 $ctrl->datasource->data s= array(392 $ctrl->datasource->data = array( 393 393 '10'=>'foo', 394 394 '11'=>'bar', 395 395 '23'=>'baz', … … 626 626 627 627 $ctrl->standalone=false; 628 628 $ctrl->datasource= new jFormStaticDatasource(); 629 $ctrl->datasource->data s= array('svg'=>'Sauvegarde','prev'=>'Preview');629 $ctrl->datasource->data = array('svg'=>'Sauvegarde','prev'=>'Preview'); 630 630 631 631 ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean(); 632 632 $output = '<input type="submit" name="nom" id="'.$this->formname.'_nom_svg" title="ceci est un tooltip" class="jforms-submit" value="Sauvegarde"/> '; -
testapp/modules/jelix_tests/tests/jforms.check_datas.html_cli.php
old new 19 19 function addCtrl($control, $reset=true){ 20 20 if($reset){ 21 21 $this->_controls = array(); 22 $this->_container->data s= array();22 $this->_container->data = array(); 23 23 } 24 24 $this->addControl($control); 25 25 } -
testapp/modules/jelix_tests/tests/jforms.with_dao.html_cli.php
old new 33 33 $gJCoord->request->params['tag'] = array('professionnal','book'); 34 34 $form = jForms::fill('product'); 35 35 36 // save main data s36 // save main data 37 37 $this->id = $form->saveToDao('products'); 38 38 $records = array( 39 39 array('id'=>$this->id, 'name'=>'phone', 'price'=>45), 40 40 ); 41 41 $this->assertTableContainsRecords('product_test', $records); 42 42 43 // save data sof the tags control which is a container43 // save data of the tags control which is a container 44 44 $form->saveControlToDao('tag','product_tags',$this->id); 45 45 $records = array( 46 46 array('product_id'=>$this->id, 'tag'=>'professionnal'), … … 61 61 ); 62 62 $this->assertTableContainsRecords('product_test', $records); 63 63 64 // save data sof the tags control which is a container64 // save data of the tags control which is a container 65 65 $form->saveControlToDao('tag','product_tags',$this->id2); 66 66 $records = array( 67 67 array('product_id'=>$this->id, 'tag'=>'professionnal'), … … 78 78 $gJCoord->request->params['label'] = 'bonjour'; 79 79 $form = jForms::fill('label', array(1,'fr')); 80 80 81 // save main data s81 // save main data 82 82 $form->saveToDao('labels'); 83 83 $records = array( 84 84 array('key'=>1, 'lang'=>'fr', 'label'=>'bonjour'), … … 120 120 ); 121 121 $this->assertTableContainsRecords('product_test', $records); 122 122 123 // save data sof the tags control which is a container123 // save data of the tags control which is a container 124 124 $form->saveControlToDao('tag','product_tags',$this->id); 125 125 $records = array( 126 126 array('product_id'=>$this->id2, 'tag'=>'professionnal'), … … 149 149 <object key="'.$this->id.'" class="jFormsDataContainer"> 150 150 <integer property="formId" value="'.$this->id.'" /> 151 151 <string property="formSelector" value="product" /> 152 <array property="data s">152 <array property="data"> 153 153 <string key="name" value="" /> 154 154 <string key="price" value="" /> 155 155 <array key="tag">array()</array> … … 168 168 <object key="'.$this->id.'" class="jFormsDataContainer"> 169 169 <integer property="formId" value="'.$this->id.'" /> 170 170 <string property="formSelector" value="product" /> 171 <array property="data s">171 <array property="data"> 172 172 <string key="name" value="other phone" /> 173 173 <string key="price" value="68" /> 174 174 <array key="tag">array()</array> … … 189 189 <object key="'.$this->id.'" class="jFormsDataContainer"> 190 190 <integer property="formId" value="'.$this->id.'" /> 191 191 <string property="formSelector" value="product" /> 192 <array property="data s">192 <array property="data"> 193 193 <string key="name" value="other phone" /> 194 194 <string key="price" value="68" /> 195 195 <array key="tag">array(\'best seller\', \'high tech\')</array> -
lib/jelix-modules/jauth/install/var/config/auth.coord.ini.php
old new 64 64 ; key to use to crypt the password in the cookie. replace it by your own words ! 65 65 persistant_crypt_key= exampleOfCryptKey 66 66 67 ; the name of the cookie which is used to store data sfor the authentification67 ; the name of the cookie which is used to store data for the authentification 68 68 persistant_cookie_name=jelixAuthentificationCookie 69 69 70 70 ; duration of the validity of the cookie (in days). default is 1 day. … … 74 74 75 75 ;------- parameters for the "Db" driver 76 76 [Db] 77 ; name of the dao to get user data s77 ; name of the dao to get user data 78 78 dao = "" 79 79 80 80 ; profil to use for jDb -
lib/jelix/plugins/tpl/html/block.form.php
old new 9 9 */ 10 10 11 11 /** 12 * a block to display an html form, with data sfrom a jforms12 * a block to display an html form, with data from a jforms 13 13 * 14 14 * usage : {form $theformobject,'submit_action', $submit_action_params} here form content {/form} 15 15 * -
lib/jelix/plugins/tpl/html/function.formdatafull.php
old new 10 10 */ 11 11 12 12 /** 13 * Display all data sof a form without the use of other plugins.13 * Display all data of a form without the use of other plugins. 14 14 * 15 15 * @param jTpl $tpl template engine 16 16 * @param jFormsBase $form the form to display 17 17 */ 18 function jtpl_function_html_formdata sfull($tpl, $form)18 function jtpl_function_html_formdatafull($tpl, $form) 19 19 { 20 20 21 21 //$formBuilder = $form->getBuilder('html', $action, $params); -
lib/jelix/plugins/tpl/html/block.formdatas.php
old new 1 <?php2 /**3 * @package jelix4 * @subpackage jtpl_plugin5 * @author Jouanneau Laurent6 * @copyright 2006-2008 Jouanneau laurent7 * @link http://www.jelix.org8 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html9 */10 11 /**12 * a block to display only datas of a form13 *14 * usage : {formdatas $theformobject} here the form content {/formdatas}15 *16 * @param jTplCompiler $compiler the template compiler17 * @param boolean $begin true if it is the begin of block, else false18 * @param array $param 0=>form object19 * @return string the php code corresponding to the begin or end of the block20 * @see jForms21 * @since 1.0.122 */23 function jtpl_block_html_formdatas($compiler, $begin, $param=array())24 {25 26 if(!$begin){27 return '28 unset($t->_privateVars[\'__form\']);29 unset($t->_privateVars[\'__displayed_ctrl\']);';30 }31 32 if(count($param) != 1) {33 $compiler->doError2('errors.tplplugin.block.bad.argument.number','formdatas',1);34 return '';35 }36 37 $content = ' $t->_privateVars[\'__form\'] = '.$param[0].';38 $t->_privateVars[\'__displayed_ctrl\'] = array();39 ';40 return $content;41 }42 43 ?> -
lib/jelix/plugins/tpl/html/block.formdata.php
old new 9 9 */ 10 10 11 11 /** 12 * a block to display only data sof a form12 * a block to display only data of a form 13 13 * 14 * usage : {formdata s $theformobject} here the form content {/formdatas}14 * usage : {formdata $theformobject} here the form content {/formdata} 15 15 * 16 16 * @param jTplCompiler $compiler the template compiler 17 17 * @param boolean $begin true if it is the begin of block, else false … … 20 20 * @see jForms 21 21 * @since 1.0.1 22 22 */ 23 function jtpl_block_html_formdata s($compiler, $begin, $param=array())23 function jtpl_block_html_formdata($compiler, $begin, $param=array()) 24 24 { 25 25 26 26 if(!$begin){ … … 30 30 } 31 31 32 32 if(count($param) != 1) { 33 $compiler->doError2('errors.tplplugin.block.bad.argument.number','formdata s',1);33 $compiler->doError2('errors.tplplugin.block.bad.argument.number','formdata',1); 34 34 return ''; 35 35 } 36 36 -
lib/jelix/plugins/tpl/html/function.formdatasfull.php
old new 1 <?php2 /**3 * @package jelix4 * @subpackage jtpl_plugin5 * @author Laurent Jouanneau6 * @contributor Dominique Papin7 * @copyright 2007-2008 Laurent Jouanneau, 2007 Dominique Papin8 * @link http://www.jelix.org9 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html10 */11 12 /**13 * Display all datas of a form without the use of other plugins.14 *15 * @param jTpl $tpl template engine16 * @param jFormsBase $form the form to display17 */18 function jtpl_function_html_formdatasfull($tpl, $form)19 {20 21 //$formBuilder = $form->getBuilder('html', $action, $params);22 23 echo '<table class="jforms-table" border="0">';24 25 26 foreach( $form->getControls() as $ctrlref=>$ctrl){27 if($ctrl->type == 'submit' || $ctrl->type == 'reset' || $ctrl->type == 'hidden') continue;28 29 echo '<tr><th scope="row">';30 echo htmlspecialchars($ctrl->label);31 echo '</th><td>';32 $value = $ctrl->getDisplayValue($form->getData($ctrlref));33 if(is_array($value)){34 $s ='';35 foreach($value as $v){36 $s.=','.htmlspecialchars($v);37 }38 echo substr($s, 1);39 }else40 echo htmlspecialchars($value);41 42 echo '</td></tr>';43 44 }45 46 echo '</table>';47 }48 49 ?> -
lib/jelix/plugins/jforms/html/html.jformsbuilder.php
old new 121 121 $span ='<span class="jforms-chkbox jforms-ctl-'.$ctrl->ref.'"><input type="checkbox"'; 122 122 123 123 if(is_array($value)){ 124 foreach($ctrl->datasource->getData s() as $v=>$label){124 foreach($ctrl->datasource->getData() as $v=>$label){ 125 125 echo $span,$attrs,$i,'" value="',htmlspecialchars($v),'"'; 126 126 if(in_array($v,$value)) 127 127 echo ' checked="checked"'; … … 129 129 $i++; 130 130 } 131 131 }else{ 132 foreach($ctrl->datasource->getData s() as $v=>$label){132 foreach($ctrl->datasource->getData() as $v=>$label){ 133 133 echo $span,$attrs,$i,'" value="',htmlspecialchars($v),'"'; 134 134 if($v == $value) 135 135 echo ' checked="checked"'; … … 149 149 $value=''; 150 150 } 151 151 $span ='<span class="jforms-radio jforms-ctl-'.$ctrl->ref.'"><input type="radio"'; 152 foreach($ctrl->datasource->getData s() as $v=>$label){152 foreach($ctrl->datasource->getData() as $v=>$label){ 153 153 echo $span,$id,$i,'" value="',htmlspecialchars($v),'"',($v==$value?' checked="checked"':''),$readonly,$class,$this->_endt; 154 154 echo '<label for="',$this->_name,'_',$ctrl->ref,'_',$i,'">',htmlspecialchars($label),'</label></span>'; 155 155 $i++; … … 167 167 if (!$ctrl->required) { 168 168 echo '<option value=""',($value==''?' selected="selected"':''),'></option>'; 169 169 } 170 foreach($ctrl->datasource->getData s() as $v=>$label){170 foreach($ctrl->datasource->getData() as $v=>$label){ 171 171 echo '<option value="',htmlspecialchars($v),'"',($v==$value?' selected="selected"':''),'>',htmlspecialchars($label),'</option>'; 172 172 } 173 173 echo '</select>'; … … 181 181 $value = $value[0]; 182 182 183 183 if(is_array($value)){ 184 foreach($ctrl->datasource->getData s() as $v=>$label){184 foreach($ctrl->datasource->getData() as $v=>$label){ 185 185 echo '<option value="',htmlspecialchars($v),'"',(in_array($v,$value)?' selected="selected"':''),'>',htmlspecialchars($label),'</option>'; 186 186 } 187 187 }else{ 188 foreach($ctrl->datasource->getData s() as $v=>$label){188 foreach($ctrl->datasource->getData() as $v=>$label){ 189 189 echo '<option value="',htmlspecialchars($v),'"',($v==$value?' selected="selected"':''),'>',htmlspecialchars($label),'</option>'; 190 190 } 191 191 } … … 201 201 } 202 202 203 203 echo '<select',$id,$readonly,$hint,$class,' size="',$ctrl->size,'">'; 204 foreach($ctrl->datasource->getData s() as $v=>$label){204 foreach($ctrl->datasource->getData() as $v=>$label){ 205 205 echo '<option value="',htmlspecialchars($v),'"',($v==$value?' selected="selected"':''),'>',htmlspecialchars($label),'</option>'; 206 206 } 207 207 echo '</select>'; … … 232 232 if($ctrl->standalone){ 233 233 echo '<input type="submit"',$id,$hint,' class="jforms-submit" value="',htmlspecialchars($ctrl->label),'"/>'; 234 234 }else{ 235 foreach($ctrl->datasource->getData s() as $v=>$label){235 foreach($ctrl->datasource->getData() as $v=>$label){ 236 236 // because IE6 sucks with <button type=submit> (see ticket #431), we must use input :-( 237 237 echo '<input type="submit" name="',$ctrl->ref,'" id="',$this->_name,'_',$ctrl->ref,'_',htmlspecialchars($v),'"', 238 238 $hint,' class="jforms-submit" value="',htmlspecialchars($label),'"/> '; -
lib/jelix/plugins/db/pgsql/pgsql.daobuilder.php
old new 37 37 38 38 protected function _getAutoIncrementPKField ($using = null){ 39 39 if ($using === null){ 40 $using = $this->_data sParser->getProperties ();40 $using = $this->_dataParser->getProperties (); 41 41 } 42 42 43 $tb = $this->_data sParser->getTables();44 $tb = $tb[$this->_data sParser->getPrimaryTable()]['realname'];43 $tb = $this->_dataParser->getTables(); 44 $tb = $tb[$this->_dataParser->getPrimaryTable()]['realname']; 45 45 46 46 foreach ($using as $id=>$field) { 47 47 if(!$field->isPK) -
lib/jelix/plugins/db/oci/oci.daobuilder.php
old new 26 26 protected function genOuterJoins(&$tables, $primaryTableName){ 27 27 $sqlFrom = ''; 28 28 $sqlWhere =''; 29 foreach($this->_data sParser->getOuterJoins() as $tablejoin){29 foreach($this->_dataParser->getOuterJoins() as $tablejoin){ 30 30 $table= $tables[$tablejoin[0]]; 31 31 $tablename = $this->_encloseName($table['name']); 32 32 -
lib/jelix/plugins/urls/simple/simple.urls.php
old new 37 37 38 38 39 39 /** 40 * Create a jurl object with the given action data s40 * Create a jurl object with the given action data 41 41 * @param jUrlAction $url information about the action 42 42 * @return jUrl the url correspondant to the action 43 43 */ -
lib/jelix/plugins/urls/significant/significant.urls.php
old new 72 72 class significantUrlEngine implements jIUrlEngine { 73 73 74 74 /** 75 * data sto create significant url75 * data to create significant url 76 76 * @var array 77 77 */ 78 78 protected $dataCreateUrl = null; 79 79 80 80 /** 81 * data sto parse and anaylise significant url, and to determine action, module etc..81 * data to parse and anaylise significant url, and to determine action, module etc.. 82 82 * @var array 83 83 */ 84 84 protected $dataParseUrl = null; … … 273 273 274 274 275 275 /** 276 * Create a jurl object with the given action data s276 * Create a jurl object with the given action data 277 277 * @param jUrlAction $url information about the action 278 278 * @return jUrl the url correspondant to the action 279 279 * @author Laurent Jouanneau -
lib/jelix/plugins/coord/auth/auth.coord.ini.php.dist
old new 64 64 ; key to use to crypt the password in the cookie. replace it by your own words ! 65 65 persistant_crypt_key= exampleOfCryptKey 66 66 67 ; the name of the cookie which is used to store data sfor the authentification67 ; the name of the cookie which is used to store data for the authentification 68 68 persistant_cookie_name=jelixAuthentificationCookie 69 69 70 70 ; duration of the validity of the cookie (in days). default is 1 day. … … 77 77 78 78 ;------- parameters for the "Db" driver 79 79 [Db] 80 ; name of the dao to get user data s80 ; name of the dao to get user data 81 81 dao = "" 82 82 83 83 ; profil to use for jDb -
lib/jelix/forms/jFormsBase.class.php
old new 73 73 protected $_hiddens = array(); 74 74 75 75 /** 76 * the data scontainer76 * the data container 77 77 * @var jFormsDataContainer 78 78 */ 79 79 protected $_container=null; … … 98 98 99 99 /** 100 100 * @param string $sel the form selector 101 * @param jFormsDataContainer $container the data scontainer102 * @param boolean $reset says if the data sshould be reset101 * @param jFormsDataContainer $container the data container 102 * @param boolean $reset says if the data should be reset 103 103 */ 104 104 public function __construct($sel, &$container, $reset = false){ 105 105 $this->_container = & $container; … … 110 110 } 111 111 112 112 /** 113 * set form data sfrom request parameters113 * set form data from request parameters 114 114 */ 115 115 public function initFromRequest(){ 116 116 $req = $GLOBALS['gJCoord']->request; … … 134 134 // because IE send the <button> content as value instead of the content of the 135 135 // "value" attribute, we should verify it and get the real value 136 136 // or when using <input type="submit">, we have only the label as value (in all browsers... 137 $data s = $ctrl->datasource->getDatas();138 if(!isset($data s[$value])) {139 $data s=array_flip($datas);140 if(isset($data s[$value])) {141 $value = $data s[$value];137 $data = $ctrl->datasource->getData(); 138 if(!isset($data[$value])) { 139 $data=array_flip($data); 140 if(isset($data[$value])) { 141 $value = $data[$value]; 142 142 } 143 143 } 144 144 } 145 $this->_container->data s[$name] = $value;145 $this->_container->data[$name] = $value; 146 146 } 147 147 } 148 148 149 149 /** 150 * check validity of all data sform150 * check validity of all data form 151 151 * @return boolean true if all is ok 152 152 */ 153 153 public function check(){ … … 161 161 } 162 162 163 163 /** 164 * set form data sfrom a DAO164 * set form data from a DAO 165 165 * @param string $daoSelector the selector of a dao file 166 166 * @param string $key the primary key for the dao. if null, takes the form ID as primary key 167 167 * @param string $dbProfil the jDb profil to use with the dao … … 187 187 if($daorec->$name != '') { 188 188 $dt = new jDateTime(); 189 189 $dt->setFromString($daorec->$name, jDateTime::DB_DTFORMAT); 190 $this->_container->data s[$name] = $dt->toString(jDateTime::LANG_DTFORMAT);190 $this->_container->data[$name] = $dt->toString(jDateTime::LANG_DTFORMAT); 191 191 } else { 192 $this->_container->data s[$name] ='';192 $this->_container->data[$name] =''; 193 193 } 194 194 }elseif($ctrl->datatype instanceof jDatatypeLocaleDate 195 195 && $prop[$name]['datatype'] == 'date') { 196 196 if($daorec->$name != '') { 197 197 $dt = new jDateTime(); 198 198 $dt->setFromString($daorec->$name, jDateTime::DB_DFORMAT); 199
