Changeset 1055
- Timestamp:
- 08/22/08 11:28:54 (4 months ago)
- Files:
-
- trunk/testapp/modules/testapp/controllers/forms.classic.php (modified) (5 diffs)
- trunk/testapp/modules/testapp/controllers/sampleform.classic.php (modified) (5 diffs)
- trunk/testapp/modules/testapp/forms/sample.form.xml (modified) (3 diffs)
- trunk/testapp/modules/testapp/templates/forms_edit.tpl (modified) (2 diffs)
- trunk/testapp/modules/testapp/templates/forms_liste.tpl (modified) (2 diffs)
- trunk/testapp/modules/testapp/templates/forms_view.tpl (modified) (1 diff)
- trunk/testapp/modules/testapp/templates/hello.tpl (modified) (1 diff)
- trunk/testapp/modules/testapp/templates/hello2.tpl (modified) (1 diff)
- trunk/testapp/modules/testapp/templates/main.tpl (modified) (1 diff)
- trunk/testapp/modules/testapp/templates/sampleformresult.tpl (modified) (2 diffs)
- trunk/testapp/modules/testapp/templates/sommaire.tpl (modified) (2 diffs)
- trunk/testapp/modules/testapp/templates/testzone.tpl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/testapp/modules/testapp/controllers/forms.classic.php
r691 r1055 15 15 function listform(){ 16 16 $rep = $this->getResponse('html'); 17 $rep->title = ' Liste d\'instance de formulaire';18 $rep->body->assign('page_title',' formulaires instances multiples');17 $rep->title = 'Instances list of forms'; 18 $rep->body->assign('page_title','Instances list of forms'); 19 19 20 20 $tpl = new jTpl(); 21 21 // on triche ici, il n'y a pas d'api car inutile en temps normal 22 22 if(isset($_SESSION['JFORMS']['sample'])) 23 $tpl->assign('liste', $_SESSION['JFORMS']['sample']); 23 $tpl->assign('liste', $_SESSION['JFORMS']['sample']); 24 24 else 25 25 $tpl->assign('liste', array()); … … 75 75 function showform(){ 76 76 $rep = $this->getResponse('html'); 77 $rep->title = 'Edition d\'un formulaire'; 78 $rep->body->assign('page_title','formulaires'); 79 77 $rep->title = 'Form editing'; 78 $rep->body->assign('page_title','forms'); 80 79 81 80 // recupère les données du formulaire dont l'id est dans le paramètre id … … 87 86 $rep->body->assign('MAIN',$tpl->fetch('forms_edit')); 88 87 }else{ 89 $rep->body->assign('MAIN','<p> mauvaisid</p>' );88 $rep->body->assign('MAIN','<p>bad id</p>' ); 90 89 } 91 90 92 91 return $rep; 93 92 } … … 120 119 $form = jForms::get('sample',$this->param('id')); 121 120 $rep = $this->getResponse('html'); 122 $rep->title = 'Conten u d\'un formulaire';123 $rep->body->assign('page_title','form ulaires');121 $rep->title = 'Content of a form'; 122 $rep->body->assign('page_title','forms'); 124 123 125 124 if($form){ … … 130 129 $rep->body->assign('MAIN',$tpl->fetch('forms_view')); 131 130 }else{ 132 $rep->body->assign('MAIN','<p> le formulaire n\'existe pas</p>');131 $rep->body->assign('MAIN','<p>The form doesn\'t exist.</p>'); 133 132 } 134 133 return $rep; trunk/testapp/modules/testapp/controllers/sampleform.classic.php
r1030 r1055 29 29 } 30 30 $rep = $this->getResponse('html'); 31 $rep->title = ' Edition d\'un formulaire';31 $rep->title = 'Form editing'; 32 32 33 33 $tpl = new jTpl(); … … 38 38 else 39 39 $rep->body->assign('MAIN',$tpl->fetch('sampleform')); 40 $rep->body->assign('page_title','form ulaires');40 $rep->body->assign('page_title','forms'); 41 41 42 42 return $rep; … … 59 59 $form = jForms::get('sample'); 60 60 $rep = $this->getResponse('html'); 61 $rep->title = ' Edition d\'un formulaire';61 $rep->title = 'Form editing'; 62 62 63 63 if($form){ … … 66 66 $rep->body->assign('MAIN',$tpl->fetch('sampleformresult')); 67 67 }else{ 68 $rep->body->assign('MAIN','<p> le formulaire n\'existe pas</p>');68 $rep->body->assign('MAIN','<p>The form doesn\'t exist.</p>'); 69 69 } 70 70 $rep->body->assign('page_title','formulaires'); … … 85 85 $rep->body->assign('page_title','formulaires'); 86 86 87 $content='<h1> Données en session des formulaires</h1>';87 $content='<h1>Session data of forms</h1>'; 88 88 if(isset($_SESSION['JFORMS'])){ 89 89 $content.='<pre>'.htmlspecialchars(var_export($_SESSION['JFORMS'],true)).'</pre>'; 90 90 }else{ 91 $content.='<p> Il n\'y a pas de formulaires...</p>';91 $content.='<p>There isn\'t any forms...</p>'; 92 92 } 93 93 $rep->body->assign('MAIN',$content); trunk/testapp/modules/testapp/forms/sample.form.xml
r1033 r1055 15 15 16 16 <radiobuttons ref="sexe" required="true"> 17 <label>Vous êtes </label> 18 <item value="h">un homme</item> 19 <item value="f">une femme</item> 20 <item value="no">je ne sais pas</item> 21 <alert type="required">Vous devez indiquer le sexe, même si vous ne savez pas :-)</alert> 17 <label>Vous are </label> 18 <item value="h">a man</item> 19 <item value="f">a woman</item> 20 <item value="no">you don't know</item> 21 <alert type="required">You should indicate your sex, even if 22 you don't know :-)</alert> 22 23 </radiobuttons> 23 24 <input ref="mail" type="email"> 24 <label> Votremail</label>25 <label>Your email</label> 25 26 </input> 26 27 27 28 <checkbox ref="geek"> 28 <label> Êtes vous ungeek ?</label>29 <help> Un geek est un passionné d'informatique</help>30 <hint>C ochez la case si vous êtes ungeek</hint>29 <label>Are you a geek ?</label> 30 <help>A geek is a person which is extremely keen on computer science</help> 31 <hint>Check the box if you are a geek</hint> 31 32 </checkbox> 32 33 </group> … … 57 58 58 59 <checkboxes ref="objets" required="true"> 59 <label> Vous avez</label>60 <item value="maison"> Une maison</item>61 <item value="voiture"> Une voiture</item>62 <item value="bateau"> Un bateau</item>63 <item value="assiette"> Une assiette</item>60 <label>You have </label> 61 <item value="maison">a house</item> 62 <item value="voiture">a car</item> 63 <item value="bateau">a boat</item> 64 <item value="assiette">a plate</item> 64 65 </checkboxes> 65 66 66 67 <input ref="datenaissance" type="localedate"> 67 <label> Votre date de naissance</label>68 <help> Le format de la date est jj/mm/aaaa</help>68 <label>Your birthday</label> 69 <help>date format is dd/mm/yyyy</help> 69 70 </input> 70 71 71 72 <secret ref="pwd"> 72 <label> Un mot de passe</label>73 <confirm> Retapez le mot de passe pour confirmer</confirm>73 <label>A password</label> 74 <confirm>Type again the password to confirm</confirm> 74 75 </secret> 75 76 76 77 <upload ref="image" mimetype="image/gif;image/png;" maxsize="50000"> 77 <label> Votrephoto (gif/png < 50ko)</label>78 <alert> Le fichier doit être une image gif ou png de moins de50000 octets</alert>78 <label>Your photo (gif/png < 50ko)</label> 79 <alert>The file should be a gif or png image, under 50000 octets</alert> 79 80 </upload> 80 81 … … 105 106 </choice> 106 107 <captcha ref="cap"> 107 <label> Filtre antispam</label>108 <label>Antispam filter</label> 108 109 </captcha> 109 110 110 111 <reset ref="cancel"> 111 <label> Annuler</label>112 <label>Cancel</label> 112 113 </reset> 113 114 114 115 <submit ref="valid"> 115 <label>Valid er</label>116 <item value="svg">Sa uvegarde</item>116 <label>Validate</label> 117 <item value="svg">Save</item> 117 118 <item value="prev">Preview</item> 118 119 </submit> trunk/testapp/modules/testapp/templates/forms_edit.tpl
r877 r1055 1 <h1> Test de formulaire (instances multiples)</h1>2 <p> Remplissez le formulaire</p>1 <h1>jForms test (multiple instances)</h1> 2 <p>Fill the form.</p> 3 3 4 4 <form action="{formurl 'forms:save',array()}" method="POST"> 5 5 6 6 <fieldset> 7 <legend> Votre identité</legend>8 <p><label for="nom"> Nom:</label> <input type="text" name="nom" id="nom" value="{$form->data['nom']}"/></p>9 <p><label for="prenom"> Prenom:</label> <input type="text" name="prenom" id="prenom" value="{$form->data['prenom']}" /></p>7 <legend>Your identity</legend> 8 <p><label for="nom">Lastname:</label> <input type="text" name="nom" id="nom" value="{$form->data['nom']}"/></p> 9 <p><label for="prenom">Firstname:</label> <input type="text" name="prenom" id="prenom" value="{$form->data['prenom']}" /></p> 10 10 11 11 </fieldset> … … 17 17 </form> 18 18 19 <p><a href="{jurl 'forms:listform'}"> Annuler</a></p>19 <p><a href="{jurl 'forms:listform'}">Cancel</a></p> trunk/testapp/modules/testapp/templates/forms_liste.tpl
r839 r1055 1 <h1> Test de formulaire (instances multiples)</h1>2 <p> Voici la liste des instances du formulaire sample</p>1 <h1>jForms test (multiple instances)</h1> 2 <p>Here is the list of instances of the "sample" form</p> 3 3 4 4 {if count($liste)} … … 10 10 <td>{$form->data['prenom']}</td> 11 11 <td> 12 <a href="{jurl 'forms:view',array('id'=>$id)}"> voir</a>13 <a href="{jurl 'forms:showform',array('id'=>$id)}"> éditer</a>14 <a href="{jurl 'forms:destroy',array('id'=>$id)}">d étruire</a>12 <a href="{jurl 'forms:view',array('id'=>$id)}">see</a> 13 <a href="{jurl 'forms:showform',array('id'=>$id)}">edit</a> 14 <a href="{jurl 'forms:destroy',array('id'=>$id)}">destroy</a> 15 15 </tr> 16 16 {/foreach} 17 17 </table> 18 18 {else} 19 <p> pas de formulaire</o>19 <p>no form</o> 20 20 {/if} 21 21 22 22 23 23 <ul> 24 <li><a href="{jurl 'forms:edit',array('id'=>1)}">cr éer une instance pour l'enregistrement1</a></li>25 <li><a href="{jurl 'forms:edit',array('id'=>2)}">cr éer une instance pour l'enregistrement2</a></li>26 <li><a href="{jurl 'forms:newform'}">cr éer une instance pour un nouvel enregistrement</a></li>24 <li><a href="{jurl 'forms:edit',array('id'=>1)}">create a instance for the record 1</a></li> 25 <li><a href="{jurl 'forms:edit',array('id'=>2)}">create a instance for the record 2</a></li> 26 <li><a href="{jurl 'forms:newform'}">create an instance for a new record</a></li> 27 27 </ul> 28 28 trunk/testapp/modules/testapp/templates/forms_view.tpl
r691 r1055 1 <h1> Test de formulaire (instances multiples)</h1>2 <p>Conten u du formulaire de l'enregistrement {$id}:</p>1 <h1>jForms test (multiple instances)</h1> 2 <p>Content of the form for the record "{$id}":</p> 3 3 <dl> 4 <dt> Nom:</dt>4 <dt>Lastname:</dt> 5 5 <dd>{$nom}</dd> 6 <dt> Prenom:</dt>6 <dt>Firstname:</dt> 7 7 <dd>{$prenom}</dd> 8 8 </dl> 9 <p><a href="{jurl 'forms:listform'}"> Retour à la liste</a></p>9 <p><a href="{jurl 'forms:listform'}">Back to the list</a></p> trunk/testapp/modules/testapp/templates/hello.tpl
r691 r1055 1 1 <h1>Hello {$person|upper} !</h1> 2 <p>Ceci est une simple page générée par {@jelix~jelix.framework.$value@}</p>3 2 <p>This is a sample html page generated by {@jelix~jelix.framework.$value@}</p> 4 <p> Dîtes <a href="{jurl 'main:hello',array('person'=>'Bob')}">bonjour àBob</a>.</p>3 <p>Say <a href="{jurl 'main:hello',array('person'=>'Bob')}">Hello to Bob</a>.</p> 5 4 6 5 7 <p><a href="{jurl 'main:index'}"> Retour au sommaire</a></p>6 <p><a href="{jurl 'main:index'}">Back to main page</a></p> 8 7 9 8 <!-- trunk/testapp/modules/testapp/templates/hello2.tpl
r691 r1055 1 1 <h1>Hello world</h1> 2 <p> Ceci est une simple page générée par{@jelix~jelix.framework.$value@}</p>2 <p>This is a simple page generated by {@jelix~jelix.framework.$value@}</p> 3 3 4 4 5 <p><a href="{jurl 'main:index'}"> Retour au sommaire</a></p>5 <p><a href="{jurl 'main:index'}">Back to main page</a></p> trunk/testapp/modules/testapp/templates/main.tpl
r516 r1055 12 12 13 13 <div id="footer"> 14 page HTML générée le {$j_datenow} à {$j_timenow} par{@jelix~jelix.framework.name@}14 HTML page generated at {$j_datenow} - {$j_timenow} by {@jelix~jelix.framework.name@} 15 15 </div> trunk/testapp/modules/testapp/templates/sampleformresult.tpl
r473 r1055 1 <h1> Test de formulaire</h1>2 < p>Contenu du formulaire :</p>1 <h1>Form test</h1> 2 <h2>Content of the form (using formcontrols plugin)</h2> 3 3 <dl> 4 4 {formcontrols $form} … … 7 7 {/formcontrols} 8 8 </dl> 9 <h2>Content of the form (using formdatafull plugin)</h2> 10 {formdatafull $form} trunk/testapp/modules/testapp/templates/sommaire.tpl
r1030 r1055 1 <h2> Sommaire</h2>1 <h2>Contents</h2> 2 2 3 <h3> Tests simples</h3>3 <h3>Simple tests</h3> 4 4 <ul> 5 <li><a href="{jurl 'main:hello'}">Hello world en html</a></li>6 <li><a href="{jurl 'main:hello', array('output'=>'text')}">Hello world en texte</a></li>7 <li><a href="{jurl 'main:hello2'}"> Template Hello world surchargé</a></li>8 <li><a href="{jurl 'main:testdao'}"> test dao</a></li>5 <li><a href="{jurl 'main:hello'}">Hello world in html</a></li> 6 <li><a href="{jurl 'main:hello', array('output'=>'text')}">Hello world in text</a></li> 7 <li><a href="{jurl 'main:hello2'}">Overloaded "Hello world" template</a></li> 8 <li><a href="{jurl 'main:testdao'}">Dao test</a></li> 9 9 </ul> 10 10 11 <h3> Tests Unitaires</h3>11 <h3>Unit tests</h3> 12 12 <ul> 13 <li><a href="{jurl 'junittests~default:index'}"> Tests unitaires</a></li>13 <li><a href="{jurl 'junittests~default:index'}">Unit tests</a></li> 14 14 </ul> 15 15 16 <h3>Form ulaires</h3>16 <h3>Forms</h3> 17 17 <ul> 18 <li><a href="{jurl 'sampleform:status'}"> données session</a></li>19 <li><a href="{jurl 'samplecrud:index'}"> Formulaire crud</a></li>18 <li><a href="{jurl 'sampleform:status'}">Session data</a></li> 19 <li><a href="{jurl 'samplecrud:index'}">Crud form</a></li> 20 20 </ul> 21 <p> formulaire simple(singleton)</p>21 <p>Simple form (singleton)</p> 22 22 <ul> 23 <li><a href="{jurl 'sampleform:newform'}">N ouveau formulaire</a></li>24 <li><a href="{jurl 'sampleform:show'}"> voir le formulaire</a> (<a href="{jurl 'sampleform:show', array('full'=>1)}">full</a>)</li>25 <li><a href="{jurl 'sampleform:ok'}">Result ats</a></li>26 <li><a href="{jurl 'sampleform:destroy'}"> détruire le formulaire</a></li>23 <li><a href="{jurl 'sampleform:newform'}">New form</a></li> 24 <li><a href="{jurl 'sampleform:show'}">See the form</a> (<a href="{jurl 'sampleform:show', array('full'=>1)}">full</a>)</li> 25 <li><a href="{jurl 'sampleform:ok'}">Results</a></li> 26 <li><a href="{jurl 'sampleform:destroy'}">Destroy the form</a></li> 27 27 </ul> 28 28 29 <p> formulaire à instances multiples</p>29 <p>Multiple instance of a form</p> 30 30 <ul> 31 <li><a href="{jurl 'forms:newform'}">N ouveau formulaire</a></li>32 <li><a href="{jurl 'forms:listform'}"> liste des instances</a></li>31 <li><a href="{jurl 'forms:newform'}">New form</a></li> 32 <li><a href="{jurl 'forms:listform'}">Instance list</a></li> 33 33 </ul> 34 34 35 35 36 36 37 <h3> Tests syndication</h3>37 <h3>Syndication examples</h3> 38 38 <ul> 39 39 <li><a href="{jurl 'syndication:rss'}">Rss 2.0</a></li> … … 41 41 </ul> 42 42 43 <h3> Tests soap</h3>43 <h3>Soap tests</h3> 44 44 <ul> 45 45 <li><a href="{jurl 'clientSoap:soapExtension'}">client (soap extension)</a></li> trunk/testapp/modules/testapp/templates/testzone.tpl
r691 r1055 1 <h3>R ésultat d'unfindAll</h3>1 <h3>Results of findAll</h3> 2 2 <table> 3 3 <tr><th>key</th><th>value</th></tr> … … 6 6 {/foreach} 7 7 </table> 8 <p>CountAll donne: {$nombre}</p>9 <p>getCountValue donne : {$nombrevalue} (nombre de valeur contenant le mot"value")</p>8 <p>CountAll gives : {$nombre}</p> 9 <p>getCountValue gives : {$nombrevalue} (number of values which contain the word "value")</p> 10 10 11 <h3>U tilisation d'unfindBy</h3>12 <p> cherchant les clés foo ou bar</p>11 <h3>Using findBy</h3> 12 <p>It searches keys "foo" or "bar"</p> 13 13 <table> 14 14 <tr><th>key</th><th>value</th></tr> … … 17 17 {/foreach} 18 18 </table> 19 <h3>R ésultat d'unget('foo')</h3>19 <h3>Results of get('foo')</h3> 20 20 <p>key={$oneconf->ckey} value={$oneconf->cvalue}</p> 21 21 22 <h3> Test insertion</h3>22 <h3>Insert Test</h3> 23 23 <form action="{jurl 'testapp~main:testdao'}" method="POST"> 24 <fieldset><legend>A jouter une nouvelle clé</legend>24 <fieldset><legend>Add a new key</legend> 25 25 <p><label for="newid">id :</label><input type="text" name="newid" id="newid"/></p> 26 <p><label for="newvalue">Val eur:</label><input type="text" name="newvalue" id="newvalue" /></p>27 <p><input type="submit" value=" enregistrer" /></p>26 <p><label for="newvalue">Value :</label><input type="text" name="newvalue" id="newvalue" /></p> 27 <p><input type="submit" value="Save" /></p> 28 28 </form> 29 29 Note: it is not using jforms here.
