added italian docs. thanks to Gianluca Gillini

This commit is contained in:
messju
2004-12-01 18:55:26 +00:00
parent 6a6b789efd
commit 06adad9c19
178 changed files with 15590 additions and 0 deletions

View File

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<sect1 id="language.function.assign">
<title>assign</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>Nome Attributo</entry>
<entry>Tipo</entry>
<entry>Obbligatorio</entry>
<entry>Default</entry>
<entry>Descrizione</entry>
</row>
</thead>
<tbody>
<row>
<entry>var</entry>
<entry>stringa</entry>
<entry>s<EFBFBD></entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>Nome della variabile valorizzata</entry>
</row>
<row>
<entry>value</entry>
<entry>stringa</entry>
<entry>s<EFBFBD></entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>Valore assegnato alla variabile</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
assign <20> usato per assegnare valori alle variabili del template
durante l'esecuzione dello stesso.
</para>
<example>
<title>assign</title>
<programlisting>
{assign var="name" value="Bob"}
The value of $name is {$name}.
OUTPUT:
The value of $name is Bob.</programlisting>
</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
-->

View File

@@ -0,0 +1,122 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<sect1 id="language.function.counter">
<title>counter</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>Nome Attributo</entry>
<entry>Tipo</entry>
<entry>Obbligatorio</entry>
<entry>Default</entry>
<entry>Descrizione</entry>
</row>
</thead>
<tbody>
<row>
<entry>name</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>default</emphasis></entry>
<entry>Nome del contatore</entry>
</row>
<row>
<entry>start</entry>
<entry>numerico</entry>
<entry>no</entry>
<entry><emphasis>1</emphasis></entry>
<entry>Valore di partenza del contatore</entry>
</row>
<row>
<entry>skip</entry>
<entry>numerico</entry>
<entry>no</entry>
<entry><emphasis>1</emphasis></entry>
<entry>Passo del contatore</entry>
</row>
<row>
<entry>direction</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>up</emphasis></entry>
<entry>Direzione del conteggio (up/down)</entry>
</row>
<row>
<entry>print</entry>
<entry>booleano</entry>
<entry>no</entry>
<entry><emphasis>true</emphasis></entry>
<entry>Se stampare il valore oppure no</entry>
</row>
<row>
<entry>assign</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>la variabile del template a cui assegnare il valore</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
counter si usa per stampare un conteggio. counter terr<72> il conto
del valore ad ogni iterazione. Potete impostare il valore di partenza,
l'intervallo e la direzione del conteggio, cos<6F> come decidere se
stampare il valore oppure no. Potete utilizzare pi<70> contatori
contemporaneamente indicando un nome diverso per ciascuno. Se non indicate
un nome, verr<72> usato il nome 'default'.
</para>
<para>
Se fornite lo speciale attributo "assign", l'output della funzione contatore
verr<72> assegnato a questa variabile invece di essere stampata in output.
</para>
<example>
<title>counter</title>
<programlisting>
<![CDATA[
{* inizializzazione del contatore *}
{counter start=0 skip=2}<br />
{counter}<br />
{counter}<br />
{counter}<br />
]]>
</programlisting>
<para>
questo stamper<65>:
</para>
<screen>
<![CDATA[
0<br />
2<br />
4<br />
6<br />
]]>
</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
-->

View File

@@ -0,0 +1,135 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<sect1 id="language.function.cycle">
<title>cycle</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>Nome Attributo</entry>
<entry>Tipo</entry>
<entry>Obbligatorio</entry>
<entry>Default</entry>
<entry>Descrizione</entry>
</row>
</thead>
<tbody>
<row>
<entry>name</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>default</emphasis></entry>
<entry>Nome del ciclo</entry>
</row>
<row>
<entry>values</entry>
<entry>misto</entry>
<entry>s<EFBFBD></entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>Valori da usare nel ciclo: pu<70> essere
una lista delimitata da un separatore (vedere attributo
delimiter), oppure un array di valori.</entry>
</row>
<row>
<entry>print</entry>
<entry>booleano</entry>
<entry>no</entry>
<entry><emphasis>true</emphasis></entry>
<entry>Se stampare il valore oppure no.</entry>
</row>
<row>
<entry>advance</entry>
<entry>booleano</entry>
<entry>no</entry>
<entry><emphasis>true</emphasis></entry>
<entry>Se avanzare o no al prossimo valore.</entry>
</row>
<row>
<entry>delimiter</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>,</emphasis></entry>
<entry>Delimitatore per l'attributo values.</entry>
</row>
<row>
<entry>assign</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>Variabile del template cui assegnare l'output.</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
Cycle si usa per effettuare un ciclo alternato fra un insieme di valori.
Ci d<> la possibilit<69> di alternare facilmente due o pi<70> colori in una
tabella, o di effettuare un ciclo su un array di valori.
</para>
<para>
Potete effettuare il ciclo su pi<70> di un insieme di valori nel template
fornendo l'attributo name, se date ad ogni insieme un nome diverso.
</para>
<para>
Potete evitare che il valore corrente venga stampato impostando
l'attributo set a false. Pu<50> essere utile per saltare un valore.
</para>
<para>
L'attributo advance serve per ripetere un valore. Se lo impostate a
false, l'iterazione successiva del ciclo stamper<65> lo stesso valore.
</para>
<para>
Se fornite lo speciale attributo "assign", l'output della funzione cycle
verr<72> assegnato a questa variabile invece di essere stampato in output.
</para>
<example>
<title>cycle</title>
<programlisting>
<![CDATA[
{section name=rows loop=$data}
<tr bgcolor="{cycle values="#eeeeee,#d0d0d0"}">
<td>{$data[rows]}</td>
</tr>
{/section}
]]>
</programlisting>
<screen>
<![CDATA[
<tr bgcolor="#eeeeee">
<td>1</td>
</tr>
<tr bgcolor="#d0d0d0">
<td>2</td>
</tr>
<tr bgcolor="#eeeeee">
<td>3</td>
</tr>
]]>
</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
-->

View File

@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<sect1 id="language.function.debug">
<title>debug</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>Nome Attributo</entry>
<entry>Tipo</entry>
<entry>Obbligatorio</entry>
<entry>Default</entry>
<entry>Descrizione</entry>
</row>
</thead>
<tbody>
<row>
<entry>output</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>html</emphasis></entry>
<entry>tipo di output: html o javascript</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
{debug} produce un dump sulla pagina della console di debug. Funziona
indipendentemente dall'impostazione <link linkend="chapter.debugging.console">debug</link>
di Smarty. Siccome viene eseguita a runtime, <20> in grado di
mostrare soltanto le variabili, non i template che state utilizzando.
Comunque vedrete tutte le variabili attualmente disponibili nello
scope di questo template.
</para>
</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
-->

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<sect1 id="language.function.eval">
<title>eval</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>Nome Attributo</entry>
<entry>Tipo</entry>
<entry>Obbligatorio</entry>
<entry>Default</entry>
<entry>Descrizione</entry>
</row>
</thead>
<tbody>
<row>
<entry>var</entry>
<entry>misto</entry>
<entry>s<EFBFBD></entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>variabile (o stringa) da valorizzare</entry>
</row>
<row>
<entry>assign</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>la variabile cui verr<72> assegnato l'output</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
eval si usa per valorizzare una variabile come se fosse un
template. Si pu<70> usare per incorporare tag o variabili di template
dentro altre variabili, oppure tag o variabili nelle variabili dei
file di configurazione.
</para>
<para>
Se fornite lo speciale attributo "assign" l'output della funzione
eval sar<61> assegnato a questa variabile invece di essere stampato
in output.
</para>
<note>
<title>Nota tecnica</title>
<para>
La variabili valorizzate con eval sono trattate allo stesso modo
dei template. Seguono le stesse regole di escape e di sicurezza,
come se fossero template
</para>
</note>
<note>
<title>Nota tecnica</title>
<para>
Le variabili valorizzate con eval vengono compilate ad ogni chiamata:
la versione compilata non viene salvata! Comunque, se avete il
caching abilitato, l'output verr<72> messo in cache con il resto del
template.
</para>
</note>
<example>
<title>eval</title>
<programlisting>
setup.conf
----------
emphstart = &lt;b&gt;
emphend = &lt;/b&gt;
title = Welcome to {$company}'s home page!
ErrorCity = You must supply a {#emphstart#}city{#emphend#}.
ErrorState = You must supply a {#emphstart#}state{#emphend#}.
index.tpl
---------
{config_load file="setup.conf"}
{eval var=$foo}
{eval var=#title#}
{eval var=#ErrorCity#}
{eval var=#ErrorState# assign="state_error"}
{$state_error}
OUTPUT:
This is the contents of foo.
Welcome to Foobar Pub &amp; Grill's home page!
You must supply a &lt;b&gt;city&lt;/b&gt;.
You must supply a &lt;b&gt;state&lt;/b&gt;.
</programlisting>
</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
-->

View File

@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<sect1 id="language.function.fetch">
<title>fetch</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>Nome Attributo</entry>
<entry>Tipo</entry>
<entry>Obbligatorio</entry>
<entry>Default</entry>
<entry>Descrizione</entry>
</row>
</thead>
<tbody>
<row>
<entry>file</entry>
<entry>stringa</entry>
<entry>s<EFBFBD></entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>il file o l'indirizzo http o ftp da caricare</entry>
</row>
<row>
<entry>assign</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>la variabile del template cui assegnare l'output</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
fetch si usa per recuperare file dal filesystem locale, oppure da
un indirizzo http o ftp, e visualizzarne il contenuto. Se il nome
del file inizia per "http://", la pagina web verr<72> letta e
visualizzata. Se il nome del file inizia per "ftp://", il file
verr<72> recuperato dal server ftp e visualizzato. Per i file locali
deve essere indicato l'intero percorso sul filesystem oppure un
percorso relativo all'indirizzo dello script php in esecuzione.
</para>
<para>
Se fornite lo speciale attributo "assign", l'output della funzione
fetch verr<72> assegnato a questa variabile invece di essere stampato
in output. (novit<69> di Smarty 1.5.0)
</para>
<note>
<title>Nota tecnica</title>
<para>
I redirect http non sono supportati, quindi assicuratevi di
mettere lo slash finale sull'indirizzo della pagina web quando
necessario.
</para>
</note>
<note>
<title>Nota tecnica</title>
<para>
Se <20> attivata la security del template e state cercando di
caricare un file dal filesystem locale, saranno consentiti
soltanto file compresi in una delle directory definite sicure
($secure_dir).
</para>
</note>
<example>
<title>fetch</title>
<programlisting>
<![CDATA[
{* inclusione di un javascript nel template *}
{fetch file="/export/httpd/www.example.com/docs/navbar.js"}
{* incorporazione nel template del testo relativo al tempo proveniente da un altro sito *}
{fetch file="http://www.myweather.com/68502/"}
{* lettura via ftp dei titoli delle ultime notizie *}
{fetch file="ftp://user:password@ftp.example.com/path/to/currentheadlines.txt"}
{* assegnazione del contenuto letto ad una variabile del template *}
{fetch file="http://www.myweather.com/68502/" assign="weather"}
{if $weather ne ""}
<b>{$weather}</b>
{/if}
]]>
</programlisting>
</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
-->

View File

@@ -0,0 +1,165 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<sect1 id="language.function.html.checkboxes">
<title>html_checkboxes</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>Nome Attributo</entry>
<entry>Tipo</entry>
<entry>Obbligatorio</entry>
<entry>Default</entry>
<entry>Descrizione</entry>
</row>
</thead>
<tbody>
<row>
<entry>name</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>checkbox</emphasis></entry>
<entry>nome della lista di checkbox</entry>
</row>
<row>
<entry>values</entry>
<entry>array</entry>
<entry>s<EFBFBD>, a meno che si usi l'attributo options</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>array di valori per le checkbox</entry>
</row>
<row>
<entry>output</entry>
<entry>array</entry>
<entry>s<EFBFBD>, a meno che si usi l'attributo options</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>array di output per le checkbox</entry>
</row>
<row>
<entry>selected</entry>
<entry>stringa/array</entry>
<entry>no</entry>
<entry><emphasis>vuoto</emphasis></entry>
<entry>la/le checkbox preselezionata/e</entry>
</row>
<row>
<entry>options</entry>
<entry>array associativo</entry>
<entry>s<EFBFBD>, a meno che si usino values e output</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>array associativo di valori e output</entry>
</row>
<row>
<entry>separator</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>vuoto</emphasis></entry>
<entry>stringa di testo da usare come separatore fra le checkbox</entry>
</row>
<row>
<entry>labels</entry>
<entry>booleano</entry>
<entry>no</entry>
<entry><emphasis>true</emphasis></entry>
<entry>aggiunge i tag &lt;label&gt; all'output</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
html_checkboxes <20> una funzione utente che usa i dati forniti per
creare un gruppo di checkbox html. Si occupa anche di impostare
la casella selezionata per default. Gli attributi obbligatori sono
values e output, a meno che non usiate invece options. Tutto
l'output generato <20> compatibile XHTML.
</para>
<para>
Tutti i parametri non compresi nella lista qui sopra vengono
stampati come coppie nome/valore all'interno di ogni tag &lt;input&gt;.
</para>
<example>
<title>html_checkboxes</title>
<programlisting role="php">
<![CDATA[
<?php
require('Smarty.class.php');
$smarty = new Smarty;
$smarty->assign('cust_ids', array(1000,1001,1002,1003));
$smarty->assign('cust_names', array('Joe Schmoe','Jack Smith','Jane Johnson','Charlie Brown'));
$smarty->assign('customer_id', 1001);
$smarty->display('index.tpl');
?>
]]>
</programlisting>
<para>
dove index.tpl <20>:
</para>
<programlisting>
<![CDATA[
{html_checkboxes name="id" values=$cust_ids selected=$customer_id output=$cust_names separator="<br />"}
]]>
</programlisting>
<programlisting role="php">
<![CDATA[
<?php
require('Smarty.class.php');
$smarty = new Smarty;
$smarty->assign('cust_checkboxes', array(
1000 => 'Joe Schmoe',
1001 => 'Jack Smith',
1002 => 'Jane Johnson',
1003 => 'Charlie Brown'));
$smarty->assign('customer_id', 1001);
$smarty->display('index.tpl');
?>
]]>
</programlisting>
<para>
dove index.tpl <20>:
</para>
<programlisting>
<![CDATA[
{html_checkboxes name="id" options=$cust_checkboxes selected=$customer_id separator="<br />"}
]]>
</programlisting>
<para>
entrambi gli esempi produrranno in output:
</para>
<screen>
<![CDATA[
<label><input type="checkbox" name="id[]" value="1000" />Joe Schmoe</label><br />
<label><input type="checkbox" name="id[]" value="1001" checked="checked" />Jack Smith</label><br />
<label><input type="checkbox" name="id[]" value="1002" />Jane Johnson</label><br />
<label><input type="checkbox" name="id[]" value="1003" />Charlie Brown</label><br />
]]>
</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
-->

View File

@@ -0,0 +1,160 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<sect1 id="language.function.html.image">
<title>html_image</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>Nome Attributo</entry>
<entry>Tipo</entry>
<entry>Obbligatorio</entry>
<entry>Default</entry>
<entry>Descrizione</entry>
</row>
</thead>
<tbody>
<row>
<entry>file</entry>
<entry>stringa</entry>
<entry>s<EFBFBD></entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>nome/percorso dell'immagine</entry>
</row>
<row>
<entry>border</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>0</emphasis></entry>
<entry>dimensione del bordo dell'immagine</entry>
</row>
<row>
<entry>height</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>altezza effettiva dell'immagine</emphasis></entry>
<entry>altezza con cui visualizzare l'immagine</entry>
</row>
<row>
<entry>width</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>larghezza effettiva dell'immagine</emphasis></entry>
<entry>larghezza con cui visualizzare l'immagine</entry>
</row>
<row>
<entry>basedir</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>doc root del web server</emphasis></entry>
<entry>directory di base per percorsi relativi</entry>
</row>
<row>
<entry>alt</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>""</emphasis></entry>
<entry>descrizione alternativa dell'immagine</entry>
</row>
<row>
<entry>href</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>valore di href per il link dell'immagine</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
html_image <20> una funzione utente che genera un tag HTML per una
immagine. L'altezza e la larghezza, quando non indicate, vengono
calcolate automaticamente dal file dell'immagine.
</para>
<para>
basedir <20> la directory di riferimento per percorsi relativi. Se non
viene indicata, viene usata come base la document root del web
server (variabile di ambiente DOCUMENT_ROOT). Se la security <20>
abilitata, il percorso dell'immagine deve trovarsi in una directory
considerata sicura.
</para>
<para>
<parameter>href</parameter> <20> l'indirizzo del link a cui collegare
l'immagine. Se viene fornito, verr<72> creato un tag
&lt;a href="LINKVALUE"&gt;&lt;a&gt; attorno al tag image.
</para>
<para>
Tutti i parametri non compresi nella lista qui sopra vengono
stampati come coppie nome/valore all'interno del tag &lt;img&gt;
generato.
</para>
<note>
<title>Nota tecnica</title>
<para>
html_image richiede un accesso al disco per leggere il
file dell'immagine e calcolarne altezza e larghezza. Se non
usate il caching dei template, <20> generalmente consigliabile
evitare html_image e lasciare i tag image statici per
ottenere prestazioni ottimali.
</para>
</note>
<example>
<title>esempio di html_image</title>
<programlisting role="php">
<![CDATA[
<?php
require('Smarty.class.php');
$smarty = new Smarty;
$smarty->display('index.tpl');
?>
]]>
</programlisting>
<para>
dove index.tpl <20>:
</para>
<programlisting>
<![CDATA[
{html_image file="pumpkin.jpg"}
{html_image file="/path/from/docroot/pumpkin.jpg"}
{html_image file="../path/relative/to/currdir/pumpkin.jpg"}
]]>
</programlisting>
<para>
un possibile output potrebbe essere:
</para>
<screen>
<![CDATA[
<img src="pumpkin.jpg" alt="" border="0" width="44" height="68" />
<img src="/path/from/docroot/pumpkin.jpg" alt="" border="0" width="44" height="68" />
<img src="../path/relative/to/currdir/pumpkin.jpg" alt="" border="0" width="44" height="68" />
]]>
</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
-->

View File

@@ -0,0 +1,153 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<sect1 id="language.function.html.options">
<title>html_options</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>Nome Attributo</entry>
<entry>Tipo</entry>
<entry>Obbligatorio</entry>
<entry>Default</entry>
<entry>Descrizione</entry>
</row>
</thead>
<tbody>
<row>
<entry>values</entry>
<entry>array</entry>
<entry>s<EFBFBD>, a meno che si usi l'attributo options</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>array di valori per il men<65> a discesa</entry>
</row>
<row>
<entry>output</entry>
<entry>array</entry>
<entry>s<EFBFBD>, a meno che si usi l'attributo options</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>array di output per il men<65> a discesa</entry>
</row>
<row>
<entry>selected</entry>
<entry>stringa/array</entry>
<entry>no</entry>
<entry><emphasis>vuoto</emphasis></entry>
<entry>l'elemento/gli elementi selezionato/i</entry>
</row>
<row>
<entry>options</entry>
<entry>array associativo</entry>
<entry>s<EFBFBD>, a meno che si usino values e output</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>array associativo di valori e output</entry>
</row>
<row>
<entry>name</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>vuoto</emphasis></entry>
<entry>nome del gruppo select</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
html_options <20> una funzione utente che usa i dati forniti per creare
un gruppo di opzioni, cio<69> di valori option per un men<65> a discesa
(casella select). Si occupa anche di quale o quali valori devono
essere preselezionati. Gli attributi obbligatori sono values e output,
a meno che non usiate invece options.
</para>
<para>
Se uno dei valori forniti <20> un array, verr<72> trattato come un gruppo
di opzioni (OPTGROUP), e visualizzato di conseguenza. E' possibile
creare gruppi ricorsivi (a pi<70> livelli). Tutto l'output generato <20>
compatibile XHTML.
</para>
<para>
Se viene fornito l'attributo opzionale <emphasis>name</emphasis>,
la lista di opzioni verr<72> racchiusa con il tag
&lt;select name="groupname"&gt;&lt;/select&gt;. In caso contrario
verr<72> generata solo la lista di opzioni.
</para>
<para>
Tutti i parametri non compresi nella lista qui sopra verranno
stampati come coppie nome/valore nel tag &lt;select&gt;.
Saranno ignorati se l'attributo <emphasis>name</emphasis> non <20>
presente.
</para>
<example>
<title>html_options</title>
<programlisting>
index.php:
require('Smarty.class.php');
$smarty = new Smarty;
$smarty-&gt;assign('cust_ids', array(1000,1001,1002,1003));
$smarty-&gt;assign('cust_names', array('Joe Schmoe','Jack Smith','Jane
Johnson','Carlie Brown'));
$smarty-&gt;assign('customer_id', 1001);
$smarty-&gt;display('index.tpl');
index.tpl:
&lt;select name=customer_id&gt;
{html_options values=$cust_ids selected=$customer_id output=$cust_names}
&lt;/select&gt;
index.php:
require('Smarty.class.php');
$smarty = new Smarty;
$smarty-&gt;assign('cust_options', array(
1001 =&gt; 'Joe Schmoe',
1002 =&gt; 'Jack Smith',
1003 =&gt; 'Jane Johnson',
1004 =&gt; 'Charlie Brown'));
$smarty-&gt;assign('customer_id', 1001);
$smarty-&gt;display('index.tpl');
index.tpl:
&lt;select name=customer_id&gt;
{html_options options=$cust_options selected=$customer_id}
&lt;/select&gt;
OUTPUT: (per entrambi gli esempi)
&lt;select name=customer_id&gt;
&lt;option value="1000"&gt;Joe Schmoe&lt;/option&gt;
&lt;option value="1001" selected="selected"&gt;Jack Smith&lt;/option&gt;
&lt;option value="1002"&gt;Jane Johnson&lt;/option&gt;
&lt;option value="1003"&gt;Charlie Brown&lt;/option&gt;
&lt;/select&gt;</programlisting>
</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
-->

View File

@@ -0,0 +1,144 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<sect1 id="language.function.html.radios">
<title>html_radios</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>Nome Attributo</entry>
<entry>Tipo</entry>
<entry>Obbligatorio</entry>
<entry>Default</entry>
<entry>Descrizione</entry>
</row>
</thead>
<tbody>
<row>
<entry>name</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>radio</emphasis></entry>
<entry>nome dell'insieme di pulsanti radio</entry>
</row>
<row>
<entry>values</entry>
<entry>array</entry>
<entry>s<EFBFBD>, a meno che si usi l'attributo options</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>array di valori per i pulsanti radio</entry>
</row>
<row>
<entry>output</entry>
<entry>array</entry>
<entry>s<EFBFBD>, a meno che si usi l'attributo options</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>array di output per i pulsanti radio</entry>
</row>
<row>
<entry>selected</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>vuoto</emphasis></entry>
<entry>l'elemento preselezionato</entry>
</row>
<row>
<entry>options</entry>
<entry>array associativo</entry>
<entry>s<EFBFBD>, a meno che si usino values e output</entry>
<entry><emphasis>n/a</emphasis></entry>
<entry>array associativo di valori e output</entry>
</row>
<row>
<entry>separator</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>vuoto</emphasis></entry>
<entry>stringa di testo da usare come separatore fra le diverse voci</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
html_radios <20> una funzione utente che usa i dati forniti per creare
un gruppo di pulsanti radio html. Si occupa anche di quale deve
essere selezionato per default. Gli attributi obbligatori sono values
e output, a meno che non usiate invece options. Tutto l'output
generato <20> compatibile XHTML.
</para>
<para>
Tutti i parametri non compresi nella lista qui sopra verranno
stampati come coppie nome/valore in ciascuno dei tag &lt;input&gt;
creati.
</para>
<example>
<title>html_radios</title>
<programlisting>
index.php:
require('Smarty.class.php');
$smarty = new Smarty;
$smarty-&gt;assign('cust_ids', array(1000,1001,1002,1003));
$smarty-&gt;assign('cust_names', array('Joe Schmoe','Jack Smith','Jane
Johnson','Charlie Brown'));
$smarty-&gt;assign('customer_id', 1001);
$smarty-&gt;display('index.tpl');
index.tpl:
{html_radios name="id" values=$cust_ids selected=$customer_id output=$cust_names separator="&lt;br /&gt;"}
index.php:
require('Smarty.class.php');
$smarty = new Smarty;
$smarty-&gt;assign('cust_radios', array(
1000 =&gt; 'Joe Schmoe',
1001 =&gt; 'Jack Smith',
1002 =&gt; 'Jane Johnson',
1003 =&gt; 'Charlie Brown'));
$smarty-&gt;assign('customer_id', 1001);
$smarty-&gt;display('index.tpl');
index.tpl:
{html_radios name="id" options=$cust_radios selected=$customer_id separator="&lt;br /&gt;"}
OUTPUT: (per entrambi gli esempi)
&lt;input type="radio" name="id" value="1000"&gt;Joe Schmoe&lt;br /&gt;
&lt;input type="radio" name="id" value="1001" checked="checked"&gt;Jack Smith&lt;br /&gt;
&lt;input type="radio" name="id" value="1002"&gt;Jane Johnson&lt;br /&gt;
&lt;input type="radio" name="id" value="1003"&gt;Charlie Brown&lt;br /&gt;</programlisting>
</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
-->

View File

@@ -0,0 +1,361 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<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>Nome Attributo</entry>
<entry>Tipo</entry>
<entry>Obbligatorio</entry>
<entry>Default</entry>
<entry>Descrizione</entry>
</row>
</thead>
<tbody>
<row>
<entry>prefix</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry>Date_</entry>
<entry>prefisso per i nomi delle variabili</entry>
</row>
<row>
<entry>time</entry>
<entry>timestamp/YYYY-MM-DD</entry>
<entry>no</entry>
<entry>data attuale in formato unix timestamp o YYYY-MM-DD</entry>
<entry>data preselezionata</entry>
</row>
<row>
<entry>start_year</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry>anno corrente</entry>
<entry>primo anno visualizzato: pu<70> essere in valore assoluto
o relativo all'anno corrente(+/- N)</entry>
</row>
<row>
<entry>end_year</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry>uguale a start_year</entry>
<entry>ultimo anno visualizzato: pu<70> essere in valore assoluto
o relativo all'anno corrente(+/- N)</entry>
</row>
<row>
<entry>display_days</entry>
<entry>booleano</entry>
<entry>no</entry>
<entry>true</entry>
<entry>se visualizzare i giorni oppure no</entry>
</row>
<row>
<entry>display_months</entry>
<entry>booleano</entry>
<entry>no</entry>
<entry>true</entry>
<entry>se visualizzare i mesi oppure no</entry>
</row>
<row>
<entry>display_years</entry>
<entry>booleano</entry>
<entry>no</entry>
<entry>true</entry>
<entry>se visualizzare gli anni oppure no</entry>
</row>
<row>
<entry>month_format</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry>%B</entry>
<entry>formato per i mesi in output (strftime)</entry>
</row>
<row>
<entry>day_format</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry>%02d</entry>
<entry>formato per i giorni in output (sprintf)</entry>
</row>
<row>
<entry>day_value_format</entry>
<entry>string</entry>
<entry>no</entry>
<entry>%d</entry>
<entry>formato per il valore dei giorni (sprintf)</entry>
</row>
<row>
<entry>year_as_text</entry>
<entry>booleano</entry>
<entry>no</entry>
<entry>false</entry>
<entry>se visualizzare gli anni in forma testuale oppure no</entry>
</row>
<row>
<entry>reverse_years</entry>
<entry>booleano</entry>
<entry>no</entry>
<entry>false</entry>
<entry>se visualizzare gli anni in ordine inverso</entry>
</row>
<row>
<entry>field_array</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry>null</entry>
<entry>se viene fornito un nome, le caselle select
verranno create in modo che il risultato
venga fornito a PHP nella forma nome[Day],
nome[Year], nome[Month].
</entry>
</row>
<row>
<entry>day_size</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry>null</entry>
<entry>se presente aggiunge l'attributo size al tag select</entry>
</row>
<row>
<entry>month_size</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry>null</entry>
<entry>se presente aggiunge l'attributo size al tag select</entry>
</row>
<row>
<entry>year_size</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry>null</entry>
<entry>se presente aggiunge l'attributo size al tag select</entry>
</row>
<row>
<entry>all_extra</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry>null</entry>
<entry>se presente aggiunge attributi extra a tutti i tag select</entry>
</row>
<row>
<entry>day_extra</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry>null</entry>
<entry>se presente aggiunge attributi extra ai tag select/input</entry>
</row>
<row>
<entry>month_extra</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry>null</entry>
<entry>se presente aggiunge attributi extra ai tag select/input</entry>
</row>
<row>
<entry>year_extra</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry>null</entry>
<entry>se presente aggiunge attributi extra ai tag select/input</entry>
</row>
<row>
<entry>field_order</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry>MDY</entry>
<entry>ordine di visualizzazione dei campi (mese, giorno, anno)</entry>
</row>
<row>
<entry>field_separator</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry>\n</entry>
<entry>stringa di separazione fra i campi</entry>
</row>
<row>
<entry>month_value_format</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry>%m</entry>
<entry>formato strftime per i valori dei mesi</entry>
</row>
<row>
<entry>year_empty</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry>null</entry>
<entry>Se presente, il primo elemento della casella select per gli anni
conterr<72> questo valore come output e "" come valore. E' utile per mostrare,
ad esempio, sul men<65> a discesa la frase "Selezionare l'anno".
Notate che potete utilizzare valori del tipo "-MM-DD" nell'attributo time
per indicare che l'anno non deve essere preselezionato.</entry>
</row>
<row>
<entry>month_empty</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry>null</entry>
<entry>Se presente, il primo elemento della casella select per i mesi
conterr<72> questo valore come output e "" come valore.
Notate che potete utilizzare valori del tipo "YYYY---DD" nell'attributo time
per indicare che il mese non deve essere preselezionato.</entry>
</row>
<row>
<entry>day_empty</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry>null</entry>
<entry>Se presente, il primo elemento della casella select per i giorni
conterr<72> questo valore come output e "" come valore.
Notate che potete utilizzare valori del tipo "YYYY-MM-" nell'attributo time
per indicare che il giorno non deve essere preselezionato.</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
html_select_date <20> una funzione utente che crea per voi men<65> a discesa
per le date. Pu<50> mostrare anno, mese e giorno o solo qualcuno di questi
valori.
</para>
<para>
L'attributo time pu<70> avere diversi formati: pu<70> essere un timestamp UNIX
o una stringa di tipo Y-M-D (anno-mese-giorno). Il formato pi<70> comune
sarebbe YYYY-MM-DD, ma vengono riconosciuti anche mesi e giorni con meno
di due cifre. Se uno dei tre valori (Y,M,D) <20> una stringa vuota, il campo
select corrispondente non avr<76> nessuna preselezione. Ci<43> <20> utile in
special modo con gli attributi year_empty, month_empty e day_empty.
</para>
<example>
<title>html_select_date</title>
<programlisting>
<![CDATA[
{html_select_date}
+]]>
</programlisting>
<para>
Questo stamper<65>:
</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="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[
{* l'anno iniziale e finale possono essere relativi a quello corrente *}
{html_select_date prefix="StartDate" time=$time start_year="-5" end_year="+1" display_days=false}
+]]>
</programlisting>
<para>
Questo stamper<65>: (l'anno corrente <20> il 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="1995">1995</option>
<option value="1996">1996</option>
<option value="1997">1997</option>
<option value="1998">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
-->

View File

@@ -0,0 +1,331 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<sect1 id="language.function.html.select.time">
<title>html_select_time</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>Nome Attributo</entry>
<entry>Tipo</entry>
<entry>Obbligatorio</entry>
<entry>Default</entry>
<entry>Descrizione</entry>
</row>
</thead>
<tbody>
<row>
<entry>prefix</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry>Time_</entry>
<entry>prefisso per i nomi delle variabili</entry>
</row>
<row>
<entry>time</entry>
<entry>timestamp</entry>
<entry>no</entry>
<entry>ora corrente</entry>
<entry>ora preselezionata</entry>
</row>
<row>
<entry>display_hours</entry>
<entry>booleano</entry>
<entry>no</entry>
<entry>true</entry>
<entry>se mostrare o no le ore</entry>
</row>
<row>
<entry>display_minutes</entry>
<entry>booleano</entry>
<entry>no</entry>
<entry>true</entry>
<entry>se mostrare o no i minuti</entry>
</row>
<row>
<entry>display_seconds</entry>
<entry>booleano</entry>
<entry>no</entry>
<entry>true</entry>
<entry>se mostrare o no i secondi</entry>
</row>
<row>
<entry>display_meridian</entry>
<entry>booleano</entry>
<entry>no</entry>
<entry>true</entry>
<entry>se mostrare o no il valore "am/pm" (antimeridiano / pomeridiano).
Questo valore non viene mai mostrato (e quindi il parametro
ignorato) se use_24_hours <20> true.</entry>
</row>
<row>
<entry>use_24_hours</entry>
<entry>booleano</entry>
<entry>no</entry>
<entry>true</entry>
<entry>se usare o no l'orologio di 24 ore</entry>
</row>
<row>
<entry>minute_interval</entry>
<entry>intero</entry>
<entry>no</entry>
<entry>1</entry>
<entry>intervallo dei minuti nel men<65> a discesa relativo</entry>
</row>
<row>
<entry>second_interval</entry>
<entry>intero</entry>
<entry>no</entry>
<entry>1</entry>
<entry>intervallo dei secondi nel men<65> a discesa relativo</entry>
</row>
<row>
<entry>field_array</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry>nessuno</entry>
<entry>imposta i valori in un array con questo nome</entry>
</row>
<row>
<entry>all_extra</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry>null</entry>
<entry>se presente aggiunge attributi extra a tutti i tag select/input</entry>
</row>
<row>
<entry>hour_extra</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry>null</entry>
<entry>se presente aggiunge attributi extra al tag select/input</entry>
</row>
<row>
<entry>minute_extra</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry>null</entry>
<entry>se presente aggiunge attributi extra al tag select/input</entry>
</row>
<row>
<entry>second_extra</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry>null</entry>
<entry>se presente aggiunge attributi extra al tag select/input</entry>
</row>
<row>
<entry>meridian_extra</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry>null</entry>
<entry>se presente aggiunge attributi extra al tag select/input</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
html_select_time <20> una funzione utente che crea per voi men<65> a discesa per
la selezione di un orario. Potete scegliere quali campi visualizzare fra
ore, minuti, secondi e antimeridiano/postmeridiano.
</para>
<para>
L'attributo time pu<70> avere vari formati. Pu<50> essere un timestamp o
una stringa nel formato YYYYMMDDHHMMSS o una stringa leggibile
dalla funzione php strtotime().
</para>
<example>
<title>html_select_time</title>
<programlisting>
<![CDATA[
{html_select_time use_24_hours=true}
]]>
</programlisting>
<para>
This will output:
</para>
<screen>
<![CDATA[
<select name="Time_Hour">
<option value="00">00</option>
<option value="01">01</option>
<option value="02">02</option>
<option value="03">03</option>
<option value="04">04</option>
<option value="05">05</option>
<option value="06">06</option>
<option value="07">07</option>
<option value="08">08</option>
<option value="09" selected="selected">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">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>
</select>
<select name="Time_Minute">
<option value="00">00</option>
<option value="01">01</option>
<option value="02">02</option>
<option value="03">03</option>
<option value="04">04</option>
<option value="05">05</option>
<option value="06">06</option>
<option value="07">07</option>
<option value="08">08</option>
<option value="09">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">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" selected="selected">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>
<option value="32">32</option>
<option value="33">33</option>
<option value="34">34</option>
<option value="35">35</option>
<option value="36">36</option>
<option value="37">37</option>
<option value="38">38</option>
<option value="39">39</option>
<option value="40">40</option>
<option value="41">41</option>
<option value="42">42</option>
<option value="43">43</option>
<option value="44">44</option>
<option value="45">45</option>
<option value="46">46</option>
<option value="47">47</option>
<option value="48">48</option>
<option value="49">49</option>
<option value="50">50</option>
<option value="51">51</option>
<option value="52">52</option>
<option value="53">53</option>
<option value="54">54</option>
<option value="55">55</option>
<option value="56">56</option>
<option value="57">57</option>
<option value="58">58</option>
<option value="59">59</option>
</select>
<select name="Time_Second">
<option value="00">00</option>
<option value="01">01</option>
<option value="02">02</option>
<option value="03">03</option>
<option value="04">04</option>
<option value="05">05</option>
<option value="06">06</option>
<option value="07">07</option>
<option value="08">08</option>
<option value="09">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">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" selected="selected">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>
<option value="32">32</option>
<option value="33">33</option>
<option value="34">34</option>
<option value="35">35</option>
<option value="36">36</option>
<option value="37">37</option>
<option value="38">38</option>
<option value="39">39</option>
<option value="40">40</option>
<option value="41">41</option>
<option value="42">42</option>
<option value="43">43</option>
<option value="44">44</option>
<option value="45">45</option>
<option value="46">46</option>
<option value="47">47</option>
<option value="48">48</option>
<option value="49">49</option>
<option value="50">50</option>
<option value="51">51</option>
<option value="52">52</option>
<option value="53">53</option>
<option value="54">54</option>
<option value="55">55</option>
<option value="56">56</option>
<option value="57">57</option>
<option value="58">58</option>
<option value="59">59</option>
</select>
<select name="Time_Meridian">
<option value="am" selected="selected">AM</option>
<option value="pm">PM</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
-->

View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<sect1 id="language.function.html.table">
<title>html_table</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>Nome Attributo</entry>
<entry>Tipo</entry>
<entry>Obbligatorio</entry>
<entry>Default</entry>
<entry>Descrizione</entry>
</row>
</thead>
<tbody>
<row>
<entry>loop</entry>
<entry>array</entry>
<entry>s<EFBFBD></entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>array di dati da visualizzare nella tabella</entry>
</row>
<row>
<entry>cols</entry>
<entry>intero</entry>
<entry>no</entry>
<entry><emphasis>3</emphasis></entry>
<entry>numero di colonne della tabella</entry>
</row>
<row>
<entry>table_attr</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>border="1"</emphasis></entry>
<entry>attributi per il tag table</entry>
</row>
<row>
<entry>tr_attr</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>vuoto</emphasis></entry>
<entry>attributi per i tag tr (gli array vengono alternati)</entry>
</row>
<row>
<entry>td_attr</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>vuoto</emphasis></entry>
<entry>attributi per i tag td (gli array vengono alternati)</entry>
</row>
<row>
<entry>trailpad</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>&amp;nbsp;</emphasis></entry>
<entry>valore per le celle aggiuntive dell'ultima riga,
se presenti</entry>
</row>
<row>
<entry>hdir</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>right</emphasis></entry>
<entry>direzione di riempimento delle righe. Valori possibili: <emphasis>left</emphasis>/<emphasis>right</emphasis></entry>
</row>
<row>
<entry>vdir</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>down</emphasis></entry>
<entry>direzione di riempimento delle colonne. Valori possibili: <emphasis>up</emphasis>/<emphasis>down</emphasis></entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
<emphasis>html_table</emphasis> <20> una funzione utente che formatta
un array di dati in una tabella HTML. L'attributo <emphasis>cols</emphasis>
determina il numero di colonne che formeranno la tabella. I valori
di <emphasis>table_attr</emphasis>, <emphasis>tr_attr</emphasis> e
<emphasis>td_attr</emphasis> determinano gli attributi dei tag table,
tr e td. Se <emphasis>tr_attr</emphasis> o <emphasis>td_attr</emphasis>
sono array, la funzione user<65> un ciclo per alternarne i valori.
<emphasis>trailpad</emphasis> <20> il valore da usare nelle ultime celle
da aggiungere all'ultima riga, nel caso in cui il numero di valori
nell'array loop non sia divisibile per il numero di colonne.
</para>
<example>
<title>html_table</title>
<programlisting>
<![CDATA[
index.php:
require('Smarty.class.php');
$smarty = new Smarty;
$smarty->assign('data',array(1,2,3,4,5,6,7,8,9));
$smarty->assign('tr',array('bgcolor="#eeeeee"','bgcolor="#dddddd"'));
$smarty->display('index.tpl');
index.tpl:
{html_table loop=$data}
{html_table loop=$data cols=4 table_attr='border="0"'}
{html_table loop=$data cols=4 tr_attr=$tr}
OUTPUT:
<table border="1">
<tr><td>1</td><td>2</td><td>3</td></tr>
<tr><td>4</td><td>5</td><td>6</td></tr>
<tr><td>7</td><td>8</td><td>9</td></tr>
</table>
<table border="0">
<tr><td>1</td><td>2</td><td>3</td><td>4</td></tr>
<tr><td>5</td><td>6</td><td>7</td><td>8</td></tr>
<tr><td>9</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
</table>
<table border="1">
<tr bgcolor="#eeeeee"><td>1</td><td>2</td><td>3</td><td>4</td></tr>
<tr bgcolor="#dddddd"><td>5</td><td>6</td><td>7</td><td>8</td></tr>
<tr bgcolor="#eeeeee"><td>9</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
</table>
]]></programlisting>
</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
-->

View File

@@ -0,0 +1,150 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<sect1 id="language.function.mailto">
<title>mailto</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>Nome Attributo</entry>
<entry>Tipo</entry>
<entry>Obbligatorio</entry>
<entry>Default</entry>
<entry>Descrizione</entry>
</row>
</thead>
<tbody>
<row>
<entry>address</entry>
<entry>stringa</entry>
<entry>s<EFBFBD></entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>l'indirizzo e-mail</entry>
</row>
<row>
<entry>text</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>il testo da visualizzare sul link; il default
<20> l'indirizzo e-mail</entry>
</row>
<row>
<entry>encode</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>none</emphasis></entry>
<entry>Come codificare l'indirizzo. Pu<50> essere
<literal>none</literal>, <literal>hex</literal> o
<literal>javascript</literal>.</entry>
</row>
<row>
<entry>cc</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>indirizzi e-mail da mettere 'per conoscenza'.
Separateli con una virgola.</entry>
</row>
<row>
<entry>bcc</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>indirizzi e-mail da mettere 'in copia nascosta'.
Separateli con una virgola.</entry>
</row>
<row>
<entry>subject</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>oggetto della e-mail.</entry>
</row>
<row>
<entry>newsgroups</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>newsgroups a cui scrivere. Separateli con una virgola.</entry>
</row>
<row>
<entry>followupto</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>n/a</emphasis></entry>
<entry>indirizzi per il follow up to. Separateli con una virgola.</entry>
</row>
<row>
<entry>extra</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>qualsiasi informazione ulteriore che vogliate passare
al link, ad esempio classi per i fogli di stile</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
La funzione mailto automatizza la creazione di link mailto e,
opzionalmente, li codifica. Codificare gli indirizzi e-mail
rende pi<70> difficile per i web spider raccoglierli dal vostro sito.
</para>
<note>
<title>Nota tecnica</title>
<para>
javascript <20> probabilmente il metodo pi<70> completo di
codifica, ma potete usare anche la codifica esadecimale.
</para>
</note>
<example>
<title>mailto</title>
<programlisting>
{mailto address="me@example.com"}
{mailto address="me@example.com" text="send me some mail"}
{mailto address="me@example.com" encode="javascript"}
{mailto address="me@example.com" encode="hex"}
{mailto address="me@example.com" subject="Hello to you!"}
{mailto address="me@example.com" cc="you@example.com,they@example.com"}
{mailto address="me@example.com" extra='class="email"'}
OUTPUT:
&lt;a href="mailto:me@example.com" &gt;me@domain.com&lt;/a&gt;
&lt;a href="mailto:me@example.com" &gt;send me some mail&lt;/a&gt;
&lt;script type="text/javascript" language="javascript"&gt;eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%6
9%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%6d%65%40%64%6f%6d%
61%69%6e%2e%63%6f%6d%22%20%3e%6d%65%40%64%6f%6d%61%69%6e%2e%63%6f%6d%3c%2f%61%3e
%27%29%3b'))&lt;/script&gt;
&lt;a href="mailto:%6d%65@%64%6f%6d%61%69%6e.%63%6f%6d" &gt;&#x6d;&#x65;&#x40;&#x64;&#x6f;&#x6d;&#x61;&#x69;&#x6e;&#x2e;&#x63;&#x6f;&#x6d;&lt;/a&gt;
&lt;a href="mailto:me@example.com?subject=Hello%20to%20you%21" &gt;me@domain.com&lt;/a&gt;
&lt;a href="mailto:me@example.com?cc=you@domain.com%2Cthey@domain.com" &gt;me@domain.com&lt;/a&gt;
&lt;a href="mailto:me@example.com" class="email"&gt;me@domain.com&lt;/a&gt;</programlisting>
</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
-->

View File

@@ -0,0 +1,148 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<sect1 id="language.function.math">
<title>math</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>Nome Attributo</entry>
<entry>Tipo</entry>
<entry>Obbligatorio</entry>
<entry>Default</entry>
<entry>Descrizione</entry>
</row>
</thead>
<tbody>
<row>
<entry>equation</entry>
<entry>stringa</entry>
<entry>s<EFBFBD></entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>l'equazione da eseguire</entry>
</row>
<row>
<entry>format</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>formato del risultato (sprintf)</entry>
</row>
<row>
<entry>var</entry>
<entry>numerico</entry>
<entry>s<EFBFBD></entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>valore di una variabile dell'equazione</entry>
</row>
<row>
<entry>assign</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>variabile del template cui verr<72> assegnato il risultato</entry>
</row>
<row>
<entry>[var ...]</entry>
<entry>numerico</entry>
<entry>s<EFBFBD></entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>valore di una variabile dell'equazione</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
La funzione math permette al progettista di effettuare equazioni
matematiche nel template. Qualsiasi variabile numerica del template
pu<70> essere utilizzata nell'equazione; il risultato verr<72> stampato
al posto del tag. Le variabili usate nell'equazione vengono passate
come parametri, che possono essere variabili del template o valori
statici. +, -, /, *, abs, ceil, cos, exp, floor, log, log10, max,
min, pi, pow, rand, round, sin, sqrt, srans e tan sono tutti operatori
validi. Controllate la documentazione di PHP per ulteriori informazioni
su queste funzioni matematiche.
</para>
<para>
Se fornite lo speciale attributo "assign", l'output della
funzione verr<72> assegnato a questa variabile del template,
invece di essere stampato in output.
</para>
<note>
<title>Nota tecnica</title>
<para>
math <20> una funzione costosa in termini di prestazioni, a
causa dell'uso che fa della funzione php eval(). Fare i
calcoli matematici in PHP <20> molto pi<70> efficiente, quindi,
quando possibile, fate i calcoli in PHP ed assegnate i
risultati al template. Evitate decisamente chiamate
ripetitive alla funzione math, ad esempio in cicli section.
</para>
</note>
<example>
<title>math</title>
<programlisting>
{* $height=4, $width=5 *}
{math equation="x + y" x=$height y=$width}
OUTPUT:
9
{* $row_height = 10, $row_width = 20, #col_div# = 2, assigned in template *}
{math equation="height * width / division"
height=$row_height
width=$row_width
division=#col_div#}
OUTPUT:
100
{* potete usare le parentesi *}
{math equation="(( x + y ) / z )" x=2 y=10 z=2}
OUTPUT:
6
{* potete indicare un parametro format in formato sprintf *}
{math equation="x + y" x=4.4444 y=5.0000 format="%.2f"}
OUTPUT:
9.44</programlisting>
</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
-->

View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<sect1 id="language.function.popup.init">
<title>popup_init</title>
<para>
popup <20> un'integrazione di overLib, una libreria usata per
le finestre popup. Tali finestre (si tratta di finestre interne
al documento, non finestre di programma come quelle che si aprono
con "javascript:window.open...") si usano per informazioni
relative al contesto, ad esempio aiuto o suggerimenti.
popup_init deve essere chiamata una volta all'inizio di ogni
pagina in cui pensate di utilizzare la funzione <link
linkend="language.function.popup">popup</link>. overLib <20> stata
scritta da Erik Bosrup, e la sua homepage si trova all'indirizzo
http://www.bosrup.com/web/overlib/.
</para>
<para>
A partire dalla versione di Smarty 2.1.2, overLib NON fa pi<70>
parte della release. Quindi scaricate overLib, piazzate il file
overlib.js sotto la vostra document root e indicate il percorso
relativo a questo file come parametro "src" di popup_init.
</para>
<example>
<title>popup_init</title>
<programlisting>
<![CDATA[
{* popup_init deve essere chiamata una volta in cima alla pagina *}
{popup_init src="/javascripts/overlib.js"}
]]>
</programlisting>
</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
-->

View File

@@ -0,0 +1,428 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<sect1 id="language.function.popup">
<title>popup</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>Nome Attributo</entry>
<entry>Tipo</entry>
<entry>Obbligatorio</entry>
<entry>Default</entry>
<entry>Descrizione</entry>
</row>
</thead>
<tbody>
<row>
<entry>text</entry>
<entry>stringa</entry>
<entry>s<EFBFBD></entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>testo o codice html da visualizzare nel popup</entry>
</row>
<row>
<entry>trigger</entry>
<entry>stringa</entry>
<entry>mo</entry>
<entry><emphasis>onMouseOver</emphasis></entry>
<entry>evento usato per attivare il popup. Pu<50> essere
onMouseOver oppure onClick</entry>
</row>
<row>
<entry>sticky</entry>
<entry>booleano</entry>
<entry>no</entry>
<entry><emphasis>false</emphasis></entry>
<entry>fa s<> che il popup rimanga visibile fino a quando non viene chiuso</entry>
</row>
<row>
<entry>caption</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>imposta il titolo del popup</entry>
</row>
<row>
<entry>fgcolor</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>colore dell'interno del popup</entry>
</row>
<row>
<entry>bgcolor</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>colore del bordo del popup</entry>
</row>
<row>
<entry>textcolor</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>colore del testo del popup</entry>
</row>
<row>
<entry>capcolor</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>colore del titolo del popup</entry>
</row>
<row>
<entry>closecolor</entry>
<entry>stringa</entry>
<entry>mo</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>colore del link di chiusura</entry>
</row>
<row>
<entry>textfont</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>carattere del testo</entry>
</row>
<row>
<entry>captionfont</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>carattere del titolo</entry>
</row>
<row>
<entry>closefont</entry>
<entry>stringa</entry>
<entry>mo</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>carattere del link di chiusura</entry>
</row>
<row>
<entry>textsize</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>dimensione del carattere del testo</entry>
</row>
<row>
<entry>captionsize</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>dimensione del carattere del titolo</entry>
</row>
<row>
<entry>closesize</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>dimensione del carattere del link di chiusura</entry>
</row>
<row>
<entry>width</entry>
<entry>intero</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>larghezza del box</entry>
</row>
<row>
<entry>height</entry>
<entry>intero</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>altezza del box</entry>
</row>
<row>
<entry>left</entry>
<entry>boolean</entry>
<entry>No</entry>
<entry><emphasis>false</emphasis></entry>
<entry>posiziona il popup a sinistra del mouse</entry>
</row>
<row>
<entry>right</entry>
<entry>booleanp</entry>
<entry>no</entry>
<entry><emphasis>false</emphasis></entry>
<entry>posiziona il popup a destra del mouse</entry>
</row>
<row>
<entry>center</entry>
<entry>booleano</entry>
<entry>no</entry>
<entry><emphasis>false</emphasis></entry>
<entry>posiziona il popup centrato rispetto al mouse</entry>
</row>
<row>
<entry>above</entry>
<entry>booleano</entry>
<entry>no</entry>
<entry><emphasis>false</emphasis></entry>
<entry>posiziona il popup al di sopra del mouse. NOTA: possibile
solo se <20> stata impostata l'altezza</entry>
</row>
<row>
<entry>below</entry>
<entry>booleano</entry>
<entry>no</entry>
<entry><emphasis>false</emphasis></entry>
<entry>posiziona il popup al di sotto del mouse</entry>
</row>
<row>
<entry>border</entry>
<entry>intero</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>rende il bordo del popup pi<70> grosso o pi<70> sottile</entry>
</row>
<row>
<entry>offsetx</entry>
<entry>intero</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>distanza orizzontale del popup rispetto al mouse</entry>
</row>
<row>
<entry>offsety</entry>
<entry>intero</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>distanza verticale del popup rispetto al mouse</entry>
</row>
<row>
<entry>fgbackground</entry>
<entry>url di un'immagine</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>definisce un'immagine da usare invece del colore di
sfondo nel popup.</entry>
</row>
<row>
<entry>bgbackground</entry>
<entry>url di un'immagine</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>definisce un'immagine da usare invece del colore per
il bordo del popup. NOTA: dovete impostare il bgcolor a "",
altrimenti il colore si vedr<64> comunque. NOTA: quando <20>
presente un link di chiusura, Netscape ridisegner<65> le
celle della tabella, rendendo la visualizzazione
non corretta</entry>
</row>
<row>
<entry>closetext</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>imposta un testo come link di chiusura invece di "Close"</entry>
</row>
<row>
<entry>noclose</entry>
<entry>booleano</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>non mostra il link di chiusura sui popup "sticky"
con un titolo</entry>
</row>
<row>
<entry>status</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>imposta il testo sulla barra di stato del browser</entry>
</row>
<row>
<entry>autostatus</entry>
<entry>booleano</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>imposta il testo della barra di stato uguale a quello del popup.
NOTA: prevale sull'impostazione di status</entry>
</row>
<row>
<entry>autostatuscap</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>imposta il testo della barra di stato uguale a quello del titolo.
NOTA: prevale sull'impostazione di status e autostatus</entry>
</row>
<row>
<entry>inarray</entry>
<entry>intero</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>comunica ad overLib di leggere il testo da questo indice
dell'array ol_text, che si trova in overlib.js. Questo parametro
pu<70> essere usato al posto di text</entry>
</row>
<row>
<entry>caparray</entry>
<entry>intero</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>comunica ad overLib di leggere il titolo da
questo indice nell'array ol_caps</entry>
</row>
<row>
<entry>capicon</entry>
<entry>url</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>mostra l'immagine indicata prima del titolo</entry>
</row>
<row>
<entry>snapx</entry>
<entry>intero</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>aggancia il popup ad una posizione in una griglia
orizzontale</entry>
</row>
<row>
<entry>snapy</entry>
<entry>intero</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>aggancia il popup ad una posizione in una griglia
verticale</entry>
</row>
<row>
<entry>fixx</entry>
<entry>intero</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>blocca la posizione orizzontale del popup. Nota:
prevale su qualsiasi altro posizionamento orizzontale</entry>
</row>
<row>
<entry>fixy</entry>
<entry>intero</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>blocca la posizione verticale del popup. Nota:
prevale su qualsiasi altro posizionamento verticale</entry>
</row>
<row>
<entry>background</entry>
<entry>url</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>imposta un'immagine da utilizzare al posto dello
sfondo della tabella</entry>
</row>
<row>
<entry>padx</entry>
<entry>intero,intero</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>imposta un padding orizzontale sull'immagine di sfondo
per il testo. Nota: l'attributo richiede due valori</entry>
</row>
<row>
<entry>pady</entry>
<entry>intero,intero</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>imposta un padding verticale sull'immagine di sfondo
per il testo. Nota: l'attributo richiede due valori</entry>
</row>
<row>
<entry>fullhtml</entry>
<entry>booleano</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>consente di utilizzare codice html per l'immagine di sfondo.
Il codice html dovr<76> trovarsi nell'attributo text</entry>
</row>
<row>
<entry>frame</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>controlla il popup in un altro frame. Vedere la documentazione
di overlib per maggiori informazioni su questa funzione</entry>
</row>
<row>
<entry>timeout</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>chiama la funzione javascript specificata e prende il
valore restituito come testo da mostrare nel popup</entry>
</row>
<row>
<entry>delay</entry>
<entry>intero</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>fa s<> che il popup si comporti come un tooltip. Verr<72>
visualizzato solo dopo questo ritardo in millisecondi.</entry>
</row>
<row>
<entry>hauto</entry>
<entry>booleano</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>determina automaticamente se il popup deve apparire a sinistra
o a destra del mouse.</entry>
</row>
<row>
<entry>vauto</entry>
<entry>booleano</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>determina automaticamente se il popup deve
apparire sopra o sotto il mouse.</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
popup si usa per creare finestre popup javascript.
</para>
<example>
<title>popup</title>
<programlisting>
<![CDATA[
{* popup_init deve essere chiamata una volta in cima alla pagina *}
{popup_init src="/javascripts/overlib.js"}
{* crea un link con un popup che appare al passaggio del mouse *}
<a href="mypage.html" {popup text="This link takes you to my page!"}>mypage</a>
{* potete usare html, links, etc nel testo del popup *}
<a href="mypage.html" {popup sticky=true caption="mypage contents"
text="<ul><li>links</li><li>pages</li><li>images</li></ul>" snapx=10
snapy=10}>mypage</a>
]]>
</programlisting>
</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
-->

View File

@@ -0,0 +1,254 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<sect1 id="language.function.textformat">
<title>textformat</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>Nome Attributo</entry>
<entry>Tipo</entry>
<entry>Obbligatorio</entry>
<entry>Default</entry>
<entry>Descrizione</entry>
</row>
</thead>
<tbody>
<row>
<entry>style</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>stile predefinito</entry>
</row>
<row>
<entry>indent</entry>
<entry>numero</entry>
<entry>no</entry>
<entry><emphasis>0</emphasis></entry>
<entry>numero di caratteri da rientrare ad ogni riga</entry>
</row>
<row>
<entry>indent_first</entry>
<entry>numero</entry>
<entry>no</entry>
<entry><emphasis>0</emphasis></entry>
<entry>numero di caratteri da rientrare alla prima riga</entry>
</row>
<row>
<entry>indent_char</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>(spazio singolo)</emphasis></entry>
<entry>carattere (o stringa di caratteri) da usare come rientro</entry>
</row>
<row>
<entry>wrap</entry>
<entry>numero</entry>
<entry>no</entry>
<entry><emphasis>80</emphasis></entry>
<entry>a quanti caratteri spezzare ogni riga</entry>
</row>
<row>
<entry>wrap_char</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>\n</emphasis></entry>
<entry>caratteri (o stringa di caratteri) da usare per
spezzare le righe</entry>
</row>
<row>
<entry>wrap_cut</entry>
<entry>booleano</entry>
<entry>no</entry>
<entry><emphasis>false</emphasis></entry>
<entry>se vero, le righe verranno spezzate al carattere esatto
invece che al termine di una parola</entry>
</row>
<row>
<entry>assign</entry>
<entry>stringa</entry>
<entry>no</entry>
<entry><emphasis>nessuno</emphasis></entry>
<entry>variabile del template cui assegnare l'output</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
textformat <20> una funzione di blocco usata per formattare il testo.
Fondamentalmente rimuove spazi e caratteri speciali, e formatta
i paragrafi spezzando le righe ad una certa lunghezza ed inserendo
dei rientri.
</para>
<para>
Potete impostare i parametri esplicitamente oppure usare uno
stile predefinito. Attualmente "email" <20> l'unico stile disponibile.
</para>
<example>
<title>textformat</title>
<programlisting>
{textformat wrap=40}
This is foo.
This is foo.
This is foo.
This is foo.
This is foo.
This is foo.
This is bar.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
{/textformat}
OUTPUT:
This is foo. This is foo. This is foo.
This is foo. This is foo. This is foo.
This is bar.
bar foo bar foo foo. bar foo bar foo
foo. bar foo bar foo foo. bar foo bar
foo foo. bar foo bar foo foo. bar foo
bar foo foo. bar foo bar foo foo.
{textformat wrap=40 indent=4}
This is foo.
This is foo.
This is foo.
This is foo.
This is foo.
This is foo.
This is bar.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
{/textformat}
OUTPUT:
This is foo. This is foo. This is
foo. This is foo. This is foo. This
is foo.
This is bar.
bar foo bar foo foo. bar foo bar foo
foo. bar foo bar foo foo. bar foo
bar foo foo. bar foo bar foo foo.
bar foo bar foo foo. bar foo bar
foo foo.
{textformat wrap=40 indent=4 indent_first=4}
This is foo.
This is foo.
This is foo.
This is foo.
This is foo.
This is foo.
This is bar.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
{/textformat}
OUTPUT:
This is foo. This is foo. This
is foo. This is foo. This is foo.
This is foo.
This is bar.
bar foo bar foo foo. bar foo bar
foo foo. bar foo bar foo foo. bar
foo bar foo foo. bar foo bar foo
foo. bar foo bar foo foo. bar foo
bar foo foo.
{textformat style="email"}
This is foo.
This is foo.
This is foo.
This is foo.
This is foo.
This is foo.
This is bar.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
{/textformat}
OUTPUT:
This is foo. This is foo. This is foo. This is foo. This is foo. This is
foo.
This is bar.
bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo
bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo
foo.
</programlisting>
</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
-->