mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-02 05:11:36 +01:00
374 lines
11 KiB
XML
374 lines
11 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 1.3 Maintainer: gerald Status: partial -->
|
|
<sect1 id="language.function.html.select.date">
|
|
<title>html_select_date</title>
|
|
<informaltable frame="all">
|
|
<tgroup cols="5">
|
|
<colspec colname="param" align="center" />
|
|
<colspec colname="type" align="center" />
|
|
<colspec colname="required" align="center" />
|
|
<colspec colname="default" align="center" />
|
|
<colspec colname="desc" />
|
|
<thead>
|
|
<row>
|
|
<entry>Nom attribut</entry>
|
|
<entry>Type</entry>
|
|
<entry>Requis</entry>
|
|
<entry>Defaut</entry>
|
|
<entry>Description</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>prefix</entry>
|
|
<entry>chaîne de caractères</entry>
|
|
<entry>Non</entry>
|
|
<entry>Date_</entry>
|
|
<entry>Avec quoi préfixer le nom de variable</entry>
|
|
</row>
|
|
<row>
|
|
<entry>time</entry>
|
|
<entry>timestamp/YYYY-MM-DD</entry>
|
|
<entry>Non</entry>
|
|
<entry>la date courante au format unix YYYY-MM-DD
|
|
format</entry>
|
|
<entry>la date / heure à utiliser</entry>
|
|
</row>
|
|
<row>
|
|
<entry>start_year</entry>
|
|
<entry>chaîne de caractères</entry>
|
|
<entry>Non</entry>
|
|
<entry>current year</entry>
|
|
<entry>La première année dans la liste déroulante, soit
|
|
le numéro de l'année, soit un nombre relatif à l'année
|
|
courante (+/- N).</entry>
|
|
</row>
|
|
<row>
|
|
<entry>end_year</entry>
|
|
<entry>chaîne de caractères</entry>
|
|
<entry>Non</entry>
|
|
<entry>même chose que start_year</entry>
|
|
<entry>La dernière année dans la liste déroulante, soit
|
|
le numéro de l'année, soit un nombre relatif à l'année
|
|
courante (+/- N).</entry>
|
|
</row>
|
|
<row>
|
|
<entry>display_days</entry>
|
|
<entry>boolean</entry>
|
|
<entry>Non</entry>
|
|
<entry>true</entry>
|
|
<entry>Si l'on souhaite afficher les jours ou pas.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>display_months</entry>
|
|
<entry>boolean</entry>
|
|
<entry>Non</entry>
|
|
<entry>true</entry>
|
|
<entry>Si l'on souhaite afficher les mois ou pas.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>display_years</entry>
|
|
<entry>boolean</entry>
|
|
<entry>Non</entry>
|
|
<entry>true</entry>
|
|
<entry>Si l'on souhaite afficher les années ou pas.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>month_format</entry>
|
|
<entry>chaîne de caractères</entry>
|
|
<entry>Non</entry>
|
|
<entry>%B</entry>
|
|
<entry>le format du mois (strftime)</entry>
|
|
</row>
|
|
<row>
|
|
<entry>day_format</entry>
|
|
<entry>chaîne de caractères</entry>
|
|
<entry>Non</entry>
|
|
<entry>%02d</entry>
|
|
<entry>Le format du jour (sprintf)</entry>
|
|
</row>
|
|
<row>
|
|
<entry>day_value_format</entry>
|
|
<entry>chaîne de caractères</entry>
|
|
<entry>Non</entry>
|
|
<entry>%d</entry>
|
|
<entry>le format de la valeur du jour (sprintf)</entry>
|
|
</row>
|
|
<row>
|
|
<entry>year_as_text</entry>
|
|
<entry>boolean</entry>
|
|
<entry>Non</entry>
|
|
<entry>false</entry>
|
|
<entry>S'il faut afficher l'année au format texte</entry>
|
|
</row>
|
|
<row>
|
|
<entry>reverse_years</entry>
|
|
<entry>boolean</entry>
|
|
<entry>Non</entry>
|
|
<entry>false</entry>
|
|
<entry>Affiche les années dans l'ordre inverse</entry>
|
|
</row>
|
|
<row>
|
|
<entry>field_array</entry>
|
|
<entry>chaîne de caractères</entry>
|
|
<entry>Non</entry>
|
|
<entry>null</entry>
|
|
<entry>
|
|
Si un nom est donné, la liste déroulante sera affichée
|
|
de telle façon que les résultats seront retournés à PHP
|
|
sous la forme nom[Day] (jour), nom[Year] (année),
|
|
nom[Month] (Mois).
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>day_size</entry>
|
|
<entry>chaîne de caractères</entry>
|
|
<entry>Non</entry>
|
|
<entry>null</entry>
|
|
<entry>Ajoute un attribut size à la liste
|
|
déroulante des jours.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>month_size</entry>
|
|
<entry>chaîne de caractères</entry>
|
|
<entry>Non</entry>
|
|
<entry>null</entry>
|
|
<entry>Ajoute un attribut size à la liste
|
|
déroulante des mois.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>year_size</entry>
|
|
<entry>chaîne de caractères</entry>
|
|
<entry>Non</entry>
|
|
<entry>null</entry>
|
|
<entry>Ajoute un attribut size à la liste
|
|
déroulante des années.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>all_extra</entry>
|
|
<entry>chaîne de caractères</entry>
|
|
<entry>Non</entry>
|
|
<entry>null</entry>
|
|
<entry>Ajoute des attributs supplémentaires à
|
|
toutes les balises select/input.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>day_extra</entry>
|
|
<entry>chaîne de caractères</entry>
|
|
<entry>Non</entry>
|
|
<entry>null</entry>
|
|
<entry>Ajoute des attributs supplémentaires aux balises
|
|
select/input du jour.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>month_extra</entry>
|
|
<entry>chaîne de caractères</entry>
|
|
<entry>Non</entry>
|
|
<entry>null</entry>
|
|
<entry>Ajoute des attributs supplémentaires aux balises
|
|
select/input du mois.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>year_extra</entry>
|
|
<entry>chaîne de caractères</entry>
|
|
<entry>Non</entry>
|
|
<entry>null</entry>
|
|
<entry>Ajoute des attributs supplémentaires aux balises
|
|
select/input de l'année.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>field_order</entry>
|
|
<entry>chaîne de caractères</entry>
|
|
<entry>Non</entry>
|
|
<entry>MDY</entry>
|
|
<entry>L'ordre dans lequel afficher les
|
|
listes déroulantes.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>field_separator</entry>
|
|
<entry>chaîne de caractères</entry>
|
|
<entry>Non</entry>
|
|
<entry>\n</entry>
|
|
<entry>la chaîne de caractères affichée entre les
|
|
différents champs.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>month_value_format</entry>
|
|
<entry>chaîne de caractères</entry>
|
|
<entry>Non</entry>
|
|
<entry>%m</entry>
|
|
<entry>Le format strftime de la valeur des mois, par défaut %m
|
|
pour les numéros.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>year_empty</entry>
|
|
<entry>chaîne de caractères</entry>
|
|
<entry>Non</entry>
|
|
<entry>null</entry>
|
|
<entry>S'il est renseigné, alors le premier élément de la boite de sélection
|
|
affiche le texte donné en tant que libellé et dispose de la valeur "".
|
|
Utile par exemple lorsque vous souhaitez que la boite de sélection affiche
|
|
"Sélectionnez une année".
|
|
|
|
A savoir que vous pouvez spécifier des valeurs de la forme "-MM-JJ" pour
|
|
l'attribut time afin d'indiquer une année non sélectionnée.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>month_empty</entry>
|
|
<entry>chaîne de caractères</entry>
|
|
<entry>Non</entry>
|
|
<entry>null</entry>
|
|
<entry>S'il est renseigné, le premier élément de la boite de sélection
|
|
affiche le texte donné en tant que libellé et dispose de la valeur "".
|
|
|
|
A savoir que vous pouvez spécifier des valeurs de la forme "AAAA--JJ" pour
|
|
l'attribut time afin d'indiquer qu'il manque le moi.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>day_empty</entry>
|
|
<entry>chaîne de caractères</entry>
|
|
<entry>Non</entry>
|
|
<entry>null</entry>
|
|
<entry>S'il est renseigné, le premier élément de la boite de sélection
|
|
affiche le texte donné en tant que libellé et dispose de la valeur "".
|
|
|
|
A savoir que vous pouvez spécifier des valeurs de la forme "AAAA-MM-" pour
|
|
l'attribut time afin d'indiquer qu'il manque le jour.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
<para>
|
|
html_select_date est une fonction utilisateur qui crée des listes
|
|
déroulantes pour saisir la date. Elle peut afficher n'importe quel
|
|
jour, mois et année.
|
|
</para>
|
|
<example>
|
|
<title>html_select_date</title>
|
|
<programlisting>
|
|
<![CDATA[
|
|
{html_select_date}
|
|
]]>
|
|
</programlisting>
|
|
<para>
|
|
Ce qui donne en sortie :
|
|
</para>
|
|
<screen>
|
|
<![CDATA[
|
|
<select name="Date_Month">
|
|
<option value="1">January</option>
|
|
<option value="2">February</option>
|
|
<option value="3">March</option>
|
|
<option value="4">April</option>
|
|
<option value="5">May</option>
|
|
<option value="6">June</option>
|
|
<option value="7">July</option>
|
|
<option value="8">August</option>
|
|
<option value="9">September</option>
|
|
<option value="10">October</option>
|
|
<option value="11">November</option>
|
|
<option value="12" selected="selected">December</option>
|
|
</select>
|
|
<select name="Date_Day">
|
|
<option value="1">01</option>
|
|
<option value="2">02</option>
|
|
<option value="3">03</option>
|
|
<option value="4">04</option>
|
|
<option value="5">05</option>
|
|
<option value="6">06</option>
|
|
<option value="7">07</option>
|
|
<option value="8">08</option>
|
|
<option value="9">09</option>
|
|
<option value="10">10</option>
|
|
<option value="11">11</option>
|
|
<option value="12">12</option>
|
|
<option value="13" selected>13</option>
|
|
<option value="14">14</option>
|
|
<option value="15">15</option>
|
|
<option value="16">16</option>
|
|
<option value="17">17</option>
|
|
<option value="18">18</option>
|
|
<option value="19">19</option>
|
|
<option value="20">20</option>
|
|
<option value="21">21</option>
|
|
<option value="22">22</option>
|
|
<option value="23">23</option>
|
|
<option value="24">24</option>
|
|
<option value="25">25</option>
|
|
<option value="26">26</option>
|
|
<option value="27">27</option>
|
|
<option value="28">28</option>
|
|
<option value="29">29</option>
|
|
<option value="30">30</option>
|
|
<option value="31">31</option>
|
|
</select>
|
|
<select name="Date_Year">
|
|
<option value="2001" selected="selected">2001</option>
|
|
</select>
|
|
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
<example>
|
|
<title>html_select_date</title>
|
|
<programlisting>
|
|
<![CDATA[
|
|
{* le démarage et la fin de l'année peuvent être relatif à l'année courante *}
|
|
{html_select_date prefix="StartDate" time=$time start_year="-5" end_year="+1" display_days=false}
|
|
]]>
|
|
</programlisting>
|
|
<para>
|
|
Ce qui donne en sortie: (L'année courante est 2000)
|
|
</para>
|
|
<screen>
|
|
<![CDATA[
|
|
<select name="StartDateMonth">
|
|
<option value="1">January</option>
|
|
<option value="2">February</option>
|
|
<option value="3">March</option>
|
|
<option value="4">April</option>
|
|
<option value="5">May</option>
|
|
<option value="6">June</option>
|
|
<option value="7">July</option>
|
|
<option value="8">August</option>
|
|
<option value="9">September</option>
|
|
<option value="10">October</option>
|
|
<option value="11">November</option>
|
|
<option value="12" selected="selected">December</option>
|
|
</select>
|
|
<select name="StartDateYear">
|
|
<option value="1999">1995</option>
|
|
<option value="1999">1996</option>
|
|
<option value="1999">1997</option>
|
|
<option value="1999">1998</option>
|
|
<option value="1999">1999</option>
|
|
<option value="2000" selected="selected">2000</option>
|
|
<option value="2001">2001</option>
|
|
</select>
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</sect1>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|