don't use tabs

This commit is contained in:
didou
2004-05-29 21:56:21 +00:00
parent a68d952494
commit 3aaf9215f2
7 changed files with 796 additions and 757 deletions

View File

@@ -1,99 +1,106 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="language.function.counter"> <sect1 id="language.function.counter">
<title>counter</title> <title>counter</title>
<informaltable frame="all"> <informaltable frame="all">
<tgroup cols="5"> <tgroup cols="5">
<colspec colname="param" align="center" /> <colspec colname="param" align="center" />
<colspec colname="type" align="center" /> <colspec colname="type" align="center" />
<colspec colname="required" align="center" /> <colspec colname="required" align="center" />
<colspec colname="default" align="center" /> <colspec colname="default" align="center" />
<colspec colname="desc" /> <colspec colname="desc" />
<thead> <thead>
<row> <row>
<entry>Attribute Name</entry> <entry>Attribute Name</entry>
<entry>Type</entry> <entry>Type</entry>
<entry>Required</entry> <entry>Required</entry>
<entry>Default</entry> <entry>Default</entry>
<entry>Description</entry> <entry>Description</entry>
</row> </row>
</thead> </thead>
<tbody> <tbody>
<row> <row>
<entry>name</entry> <entry>name</entry>
<entry>string</entry> <entry>string</entry>
<entry>No</entry> <entry>No</entry>
<entry><emphasis>default</emphasis></entry> <entry><emphasis>default</emphasis></entry>
<entry>The name of the counter</entry> <entry>The name of the counter</entry>
</row> </row>
<row> <row>
<entry>start</entry> <entry>start</entry>
<entry>number</entry> <entry>number</entry>
<entry>No</entry> <entry>No</entry>
<entry><emphasis>1</emphasis></entry> <entry><emphasis>1</emphasis></entry>
<entry>The initial number to start counting from</entry> <entry>The initial number to start counting from</entry>
</row> </row>
<row> <row>
<entry>skip</entry> <entry>skip</entry>
<entry>number</entry> <entry>number</entry>
<entry>No</entry> <entry>No</entry>
<entry><emphasis>1</emphasis></entry> <entry><emphasis>1</emphasis></entry>
<entry>The interval to count by</entry> <entry>The interval to count by</entry>
</row> </row>
<row> <row>
<entry>direction</entry> <entry>direction</entry>
<entry>string</entry> <entry>string</entry>
<entry>No</entry> <entry>No</entry>
<entry><emphasis>up</emphasis></entry> <entry><emphasis>up</emphasis></entry>
<entry>the direction to count (up/down)</entry> <entry>the direction to count (up/down)</entry>
</row> </row>
<row> <row>
<entry>print</entry> <entry>print</entry>
<entry>boolean</entry> <entry>boolean</entry>
<entry>No</entry> <entry>No</entry>
<entry><emphasis>true</emphasis></entry> <entry><emphasis>true</emphasis></entry>
<entry>Whether or not to print the value</entry> <entry>Whether or not to print the value</entry>
</row> </row>
<row> <row>
<entry>assign</entry> <entry>assign</entry>
<entry>string</entry> <entry>string</entry>
<entry>No</entry> <entry>No</entry>
<entry><emphasis>n/a</emphasis></entry> <entry><emphasis>n/a</emphasis></entry>
<entry>the template variable the output will be assigned <entry>the template variable the output will be assigned
to</entry> to</entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
</informaltable> </informaltable>
<para> <para>
counter is used to print out a count. counter will remember the counter is used to print out a count. counter will remember the
count on each iteration. You can adjust the number, the interval count on each iteration. You can adjust the number, the interval
and the direction of the count, as well as determine whether or not and the direction of the count, as well as determine whether or not
to print the value. You can run multiple counters concurrently by to print the value. You can run multiple counters concurrently by
supplying a unique name for each one. If you do not supply a name, supplying a unique name for each one. If you do not supply a name,
the name 'default' will be used. the name 'default' will be used.
</para> </para>
<para> <para>
If you supply the special "assign" attribute, the output of the If you supply the special "assign" attribute, the output of the
counter function will be assigned to this template variable instead of counter function will be assigned to this template variable instead of
being output to the template. being output to the template.
</para> </para>
<example> <example>
<title>counter</title> <title>counter</title>
<programlisting> <programlisting>
<![CDATA[
{* initialize the count *} {* initialize the count *}
{counter start=0 skip=2}&lt;br&gt; {counter start=0 skip=2}<br />
{counter}&lt;br&gt; {counter}<br />
{counter}&lt;br&gt; {counter}<br />
{counter}&lt;br&gt; {counter}<br />
]]>
OUTPUT: </programlisting>
<para>
0&lt;br&gt; this will output:
2&lt;br&gt; </para>
4&lt;br&gt; <screen>
6&lt;br&gt;</programlisting> <![CDATA[
</example> 0<br />
2<br />
4<br />
6<br />
]]>
</screen>
</example>
</sect1> </sect1>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:

View File

@@ -1,118 +1,121 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="language.function.cycle"> <sect1 id="language.function.cycle">
<title>cycle</title> <title>cycle</title>
<informaltable frame="all"> <informaltable frame="all">
<tgroup cols="5"> <tgroup cols="5">
<colspec colname="param" align="center" /> <colspec colname="param" align="center" />
<colspec colname="type" align="center" /> <colspec colname="type" align="center" />
<colspec colname="required" align="center" /> <colspec colname="required" align="center" />
<colspec colname="default" align="center" /> <colspec colname="default" align="center" />
<colspec colname="desc" /> <colspec colname="desc" />
<thead> <thead>
<row> <row>
<entry>Attribute Name</entry> <entry>Attribute Name</entry>
<entry>Type</entry> <entry>Type</entry>
<entry>Required</entry> <entry>Required</entry>
<entry>Default</entry> <entry>Default</entry>
<entry>Description</entry> <entry>Description</entry>
</row> </row>
</thead> </thead>
<tbody> <tbody>
<row> <row>
<entry>name</entry> <entry>name</entry>
<entry>string</entry> <entry>string</entry>
<entry>No</entry> <entry>No</entry>
<entry><emphasis>default</emphasis></entry> <entry><emphasis>default</emphasis></entry>
<entry>The name of the cycle</entry> <entry>The name of the cycle</entry>
</row> </row>
<row> <row>
<entry>values</entry> <entry>values</entry>
<entry>mixed</entry> <entry>mixed</entry>
<entry>Yes</entry> <entry>Yes</entry>
<entry><emphasis>N/A</emphasis></entry> <entry><emphasis>N/A</emphasis></entry>
<entry>The values to cycle through, either a comma <entry>The values to cycle through, either a comma
delimited list (see delimiter attribute), or an array delimited list (see delimiter attribute), or an array
of values.</entry> of values.</entry>
</row> </row>
<row> <row>
<entry>print</entry> <entry>print</entry>
<entry>boolean</entry> <entry>boolean</entry>
<entry>No</entry> <entry>No</entry>
<entry><emphasis>true</emphasis></entry> <entry><emphasis>true</emphasis></entry>
<entry>Whether to print the value or not</entry> <entry>Whether to print the value or not</entry>
</row> </row>
<row> <row>
<entry>advance</entry> <entry>advance</entry>
<entry>boolean</entry> <entry>boolean</entry>
<entry>No</entry> <entry>No</entry>
<entry><emphasis>true</emphasis></entry> <entry><emphasis>true</emphasis></entry>
<entry>Whether or not to advance to the next value</entry> <entry>Whether or not to advance to the next value</entry>
</row> </row>
<row> <row>
<entry>delimiter</entry> <entry>delimiter</entry>
<entry>string</entry> <entry>string</entry>
<entry>No</entry> <entry>No</entry>
<entry><emphasis>,</emphasis></entry> <entry><emphasis>,</emphasis></entry>
<entry>The delimiter to use in the values attribute.</entry> <entry>The delimiter to use in the values attribute.</entry>
</row> </row>
<row> <row>
<entry>assign</entry> <entry>assign</entry>
<entry>string</entry> <entry>string</entry>
<entry>No</entry> <entry>No</entry>
<entry><emphasis>n/a</emphasis></entry> <entry><emphasis>n/a</emphasis></entry>
<entry>the template variable the output will be assigned <entry>the template variable the output will be assigned
to</entry> to</entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
</informaltable> </informaltable>
<para> <para>
Cycle is used to cycle though a set of values. This makes it easy Cycle is used to cycle though a set of values. This makes it easy
to alternate between two or more colors in a table, or cycle to alternate between two or more colors in a table, or cycle
through an array of values. through an array of values.
</para> </para>
<para> <para>
You can cycle through more than one set of values in your template You can cycle through more than one set of values in your template
by supplying a name attribute. Give each set of values a unique by supplying a name attribute. Give each set of values a unique
name. name.
</para> </para>
<para> <para>
You can force the current value not to print with the print You can force the current value not to print with the print
attribute set to false. This would be useful for silently skipping attribute set to false. This would be useful for silently skipping
a value. a value.
</para> </para>
<para> <para>
The advance attribute is used to repeat a value. When set to false, The advance attribute is used to repeat a value. When set to false,
the next call to cycle will print the same value. the next call to cycle will print the same value.
</para> </para>
<para> <para>
If you supply the special "assign" attribute, the output of the If you supply the special "assign" attribute, the output of the
cycle function will be assigned to this template variable instead of cycle function will be assigned to this template variable instead of
being output to the template. being output to the template.
</para> </para>
<example> <example>
<title>cycle</title> <title>cycle</title>
<programlisting> <programlisting>
<![CDATA[
{section name=rows loop=$data} {section name=rows loop=$data}
&lt;tr bgcolor="{cycle values="#eeeeee,#d0d0d0"}"&gt; <tr bgcolor="{cycle values="#eeeeee,#d0d0d0"}">
&lt;td&gt;{$data[rows]}&lt;/td&gt; <td>{$data[rows]}</td>
&lt;/tr&gt; </tr>
{/section} {/section}
]]>
OUTPUT: </programlisting>
<screen>
&lt;tr bgcolor="#eeeeee"&gt; <![CDATA[
&lt;td&gt;1&lt;/td&gt; <tr bgcolor="#eeeeee">
&lt;/tr&gt; <td>1</td>
&lt;tr bgcolor="#d0d0d0"&gt; </tr>
&lt;td&gt;2&lt;/td&gt; <tr bgcolor="#d0d0d0">
&lt;/tr&gt; <td>2</td>
&lt;tr bgcolor="#eeeeee"&gt; </tr>
&lt;td&gt;3&lt;/td&gt; <tr bgcolor="#eeeeee">
&lt;/tr&gt; <td>3</td>
</programlisting> </tr>
</example> ]]>
</screen>
</example>
</sect1> </sect1>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:

View File

@@ -1,42 +1,42 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="language.function.debug"> <sect1 id="language.function.debug">
<title>debug</title> <title>debug</title>
<informaltable frame="all"> <informaltable frame="all">
<tgroup cols="5"> <tgroup cols="5">
<colspec colname="param" align="center" /> <colspec colname="param" align="center" />
<colspec colname="type" align="center" /> <colspec colname="type" align="center" />
<colspec colname="required" align="center" /> <colspec colname="required" align="center" />
<colspec colname="default" align="center" /> <colspec colname="default" align="center" />
<colspec colname="desc" /> <colspec colname="desc" />
<thead> <thead>
<row> <row>
<entry>Attribute Name</entry> <entry>Attribute Name</entry>
<entry>Type</entry> <entry>Type</entry>
<entry>Required</entry> <entry>Required</entry>
<entry>Default</entry> <entry>Default</entry>
<entry>Description</entry> <entry>Description</entry>
</row> </row>
</thead> </thead>
<tbody> <tbody>
<row> <row>
<entry>output</entry> <entry>output</entry>
<entry>string</entry> <entry>string</entry>
<entry>No</entry> <entry>No</entry>
<entry><emphasis>html</emphasis></entry> <entry><emphasis>html</emphasis></entry>
<entry>output type, html or javascript</entry> <entry>output type, html or javascript</entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
</informaltable> </informaltable>
<para> <para>
{debug} dumps the debug console to the page. This works regardless {debug} dumps the debug console to the page. This works regardless
of the <link linkend="chapter.debugging.console">debug</link> of the <link linkend="chapter.debugging.console">debug</link>
settings in Smarty. Since this gets executed at runtime, this is settings in Smarty. Since this gets executed at runtime, this is
only able to show the assigned variables, not the templates that only able to show the assigned variables, not the templates that
are in use. But, you see all the currently available variables are in use. But, you see all the currently available variables
within the scope of this template. within the scope of this template.
</para> </para>
</sect1> </sect1>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:

View File

@@ -1,74 +1,75 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="language.function.fetch"> <sect1 id="language.function.fetch">
<title>fetch</title> <title>fetch</title>
<informaltable frame="all"> <informaltable frame="all">
<tgroup cols="5"> <tgroup cols="5">
<colspec colname="param" align="center" /> <colspec colname="param" align="center" />
<colspec colname="type" align="center" /> <colspec colname="type" align="center" />
<colspec colname="required" align="center" /> <colspec colname="required" align="center" />
<colspec colname="default" align="center" /> <colspec colname="default" align="center" />
<colspec colname="desc" /> <colspec colname="desc" />
<thead> <thead>
<row> <row>
<entry>Attribute Name</entry> <entry>Attribute Name</entry>
<entry>Type</entry> <entry>Type</entry>
<entry>Required</entry> <entry>Required</entry>
<entry>Default</entry> <entry>Default</entry>
<entry>Description</entry> <entry>Description</entry>
</row> </row>
</thead> </thead>
<tbody> <tbody>
<row> <row>
<entry>file</entry> <entry>file</entry>
<entry>string</entry> <entry>string</entry>
<entry>Yes</entry> <entry>Yes</entry>
<entry><emphasis>n/a</emphasis></entry> <entry><emphasis>n/a</emphasis></entry>
<entry>the file, http or ftp site to fetch</entry> <entry>the file, http or ftp site to fetch</entry>
</row> </row>
<row> <row>
<entry>assign</entry> <entry>assign</entry>
<entry>string</entry> <entry>string</entry>
<entry>No</entry> <entry>No</entry>
<entry><emphasis>n/a</emphasis></entry> <entry><emphasis>n/a</emphasis></entry>
<entry>the template variable the output will be assigned <entry>the template variable the output will be assigned
to</entry> to</entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
</informaltable> </informaltable>
<para> <para>
fetch is used to fetch files from the local file system, http, or fetch is used to fetch files from the local file system, http, or
ftp and display the contents. If the file name begins with ftp and display the contents. If the file name begins with
"http://", the web site page will be fetched and displayed. If the "http://", the web site page will be fetched and displayed. If the
file name begins with "ftp://", the file will be fetched from the file name begins with "ftp://", the file will be fetched from the
ftp server and displayed. For local files, the full system file ftp server and displayed. For local files, the full system file
path must be given, or a path relative to the executed php script. path must be given, or a path relative to the executed php script.
</para> </para>
<para> <para>
If you supply the special "assign" attribute, the output of the If you supply the special "assign" attribute, the output of the
fetch function will be assigned to this template variable instead of fetch function will be assigned to this template variable instead of
being output to the template. (new in Smarty 1.5.0) being output to the template. (new in Smarty 1.5.0)
</para> </para>
<note> <note>
<title>Technical Note</title> <title>Technical Note</title>
<para> <para>
This will not support http redirects, be sure to This will not support http redirects, be sure to
include a trailing slash on your web page fetches where necessary. include a trailing slash on your web page fetches where necessary.
</para> </para>
</note> </note>
<note> <note>
<title>Technical Note</title> <title>Technical Note</title>
<para> <para>
If template security is turned on and you are If template security is turned on and you are
fetching a file from the local file system, this will only allow fetching a file from the local file system, this will only allow
files from within one of the defined secure directories. files from within one of the defined secure directories.
($secure_dir) ($secure_dir)
</para> </para>
</note> </note>
<example> <example>
<title>fetch</title> <title>fetch</title>
<programlisting> <programlisting>
<![CDATA[
{* include some javascript in your template *} {* include some javascript in your template *}
{fetch file="/export/httpd/www.domain.com/docs/navbar.js"} {fetch file="/export/httpd/www.domain.com/docs/navbar.js"}
@@ -81,9 +82,11 @@
{* assign the fetched contents to a template variable *} {* assign the fetched contents to a template variable *}
{fetch file="http://www.myweather.com/68502/" assign="weather"} {fetch file="http://www.myweather.com/68502/" assign="weather"}
{if $weather ne ""} {if $weather ne ""}
&lt;b&gt;{$weather}&lt;/b&gt; <b>{$weather}</b>
{/if}</programlisting> {/if}
</example> ]]
</programlisting>
</example>
</sect1> </sect1>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:

View File

@@ -1,129 +1,147 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="language.function.html.checkboxes"> <sect1 id="language.function.html.checkboxes">
<title>html_checkboxes</title> <title>html_checkboxes</title>
<informaltable frame="all"> <informaltable frame="all">
<tgroup cols="5"> <tgroup cols="5">
<colspec colname="param" align="center" /> <colspec colname="param" align="center" />
<colspec colname="type" align="center" /> <colspec colname="type" align="center" />
<colspec colname="required" align="center" /> <colspec colname="required" align="center" />
<colspec colname="default" align="center" /> <colspec colname="default" align="center" />
<colspec colname="desc" /> <colspec colname="desc" />
<thead> <thead>
<row> <row>
<entry>Attribute Name</entry> <entry>Attribute Name</entry>
<entry>Type</entry> <entry>Type</entry>
<entry>Required</entry> <entry>Required</entry>
<entry>Default</entry> <entry>Default</entry>
<entry>Description</entry> <entry>Description</entry>
</row> </row>
</thead> </thead>
<tbody> <tbody>
<row> <row>
<entry>name</entry> <entry>name</entry>
<entry>string</entry> <entry>string</entry>
<entry>No</entry> <entry>No</entry>
<entry><emphasis>checkbox</emphasis></entry> <entry><emphasis>checkbox</emphasis></entry>
<entry>name of checkbox list</entry> <entry>name of checkbox list</entry>
</row> </row>
<row> <row>
<entry>values</entry> <entry>values</entry>
<entry>array</entry> <entry>array</entry>
<entry>Yes, unless using options attribute</entry> <entry>Yes, unless using options attribute</entry>
<entry><emphasis>n/a</emphasis></entry> <entry><emphasis>n/a</emphasis></entry>
<entry>an array of values for checkbox buttons</entry> <entry>an array of values for checkbox buttons</entry>
</row> </row>
<row> <row>
<entry>output</entry> <entry>output</entry>
<entry>array</entry> <entry>array</entry>
<entry>Yes, unless using options attribute</entry> <entry>Yes, unless using options attribute</entry>
<entry><emphasis>n/a</emphasis></entry> <entry><emphasis>n/a</emphasis></entry>
<entry>an array of output for checkbox buttons</entry> <entry>an array of output for checkbox buttons</entry>
</row> </row>
<row> <row>
<entry>selected</entry> <entry>selected</entry>
<entry>string/array</entry> <entry>string/array</entry>
<entry>No</entry> <entry>No</entry>
<entry><emphasis>empty</emphasis></entry> <entry><emphasis>empty</emphasis></entry>
<entry>the selected checkbox element(s)</entry> <entry>the selected checkbox element(s)</entry>
</row> </row>
<row> <row>
<entry>options</entry> <entry>options</entry>
<entry>associative array</entry> <entry>associative array</entry>
<entry>Yes, unless using values and output</entry> <entry>Yes, unless using values and output</entry>
<entry><emphasis>n/a</emphasis></entry> <entry><emphasis>n/a</emphasis></entry>
<entry>an associative array of values and output</entry> <entry>an associative array of values and output</entry>
</row> </row>
<row> <row>
<entry>separator</entry> <entry>separator</entry>
<entry>string</entry> <entry>string</entry>
<entry>No</entry> <entry>No</entry>
<entry><emphasis>empty</emphasis></entry> <entry><emphasis>empty</emphasis></entry>
<entry>string of text to separate each checkbox item</entry> <entry>string of text to separate each checkbox item</entry>
</row> </row>
<row> <row>
<entry>labels</entry> <entry>labels</entry>
<entry>boolean</entry> <entry>boolean</entry>
<entry>No</entry> <entry>No</entry>
<entry><emphasis>true</emphasis></entry> <entry><emphasis>true</emphasis></entry>
<entry>add &lt;label&gt;-tags to the output</entry> <entry>add &lt;label&gt;-tags to the output</entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
</informaltable> </informaltable>
<para> <para>
html_checkboxes is a custom function that creates an html checkbox html_checkboxes is a custom function that creates an html checkbox
group with provided data. It takes care of which item(s) are group with provided data. It takes care of which item(s) are
selected by default as well. Required attributes are values and selected by default as well. Required attributes are values and
output, unless you use options instead. All output is XHTML output, unless you use options instead. All output is XHTML
compatible. compatible.
</para> </para>
<para> <para>
All parameters that are not in the list above are printed as All parameters that are not in the list above are printed as
name/value-pairs inside each of the created &lt;input&gt;-tags. name/value-pairs inside each of the created &lt;input&gt;-tags.
</para> </para>
<example> <example>
<title>html_checkboxes</title> <title>html_checkboxes</title>
<programlisting> <programlisting role="php">
index.php: <![CDATA[
<?php
require('Smarty.class.php'); require('Smarty.class.php');
$smarty = new Smarty; $smarty = new Smarty;
$smarty-&gt;assign('cust_ids', array(1000,1001,1002,1003)); $smarty->assign('cust_ids', array(1000,1001,1002,1003));
$smarty-&gt;assign('cust_names', array('Joe Schmoe','Jack Smith','Jane Johnson','Charlie Brown')); $smarty->assign('cust_names', array('Joe Schmoe','Jack Smith','Jane Johnson','Charlie Brown'));
$smarty-&gt;assign('customer_id', 1001); $smarty->assign('customer_id', 1001);
$smarty-&gt;display('index.tpl'); $smarty->display('index.tpl');
?>
index.tpl: ]]
</programlisting>
{html_checkboxes name="id" values=$cust_ids selected=$customer_id output=$cust_names separator="&lt;br /&gt;"} <para>
where index.tpl is:
</para>
index.php: <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'); require('Smarty.class.php');
$smarty = new Smarty; $smarty = new Smarty;
$smarty-&gt;assign('cust_checkboxes', array( $smarty->assign('cust_checkboxes', array(
1000 =&gt; 'Joe Schmoe', 1000 => 'Joe Schmoe',
1001 =&gt; 'Jack Smith', 1001 => 'Jack Smith',
1002 =&gt; 'Jane Johnson', 1002 => 'Jane Johnson',
1003 =&gt; 'Charlie Brown')); 1003 => 'Charlie Brown'));
$smarty-&gt;assign('customer_id', 1001); $smarty->assign('customer_id', 1001);
$smarty-&gt;display('index.tpl'); $smarty->display('index.tpl');
?>
index.tpl: ]]>
</programlisting>
<para>
where index.tpl is:
</para>
<programlisting>
<![CDATA[
{html_checkboxes name="id" options=$cust_checkboxes selected=$customer_id separator="&lt;br /&gt;"} {html_checkboxes name="id" options=$cust_checkboxes selected=$customer_id separator="&lt;br /&gt;"}
]]>
</programlisting>
OUTPUT: (both examples) <para>
both examples will output:
&lt;label&gt;&lt;input type="checkbox" name="id[]" value="1000" /&gt;Joe Schmoe&lt;/label&gt;&lt;br /&gt; </para>
&lt;label&gt;&lt;input type="checkbox" name="id[]" value="1001" checked="checked" /&gt;Jack Smith&lt;/label&gt;&lt;br /&gt; <screen>
&lt;label&gt;&lt;input type="checkbox" name="id[]" value="1002" /&gt;Jane Johnson&lt;/label&gt;&lt;br /&gt; <![CDATA[
&lt;label&gt;&lt;input type="checkbox" name="id[]" value="1003" /&gt;Charlie Brown&lt;/label&gt;&lt;br /&gt;</programlisting> <label><input type="checkbox" name="id[]" value="1000" />Joe Schmoe</label><br />
</example> <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> </sect1>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:

View File

@@ -1,318 +1,323 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="language.function.html.select.time"> <sect1 id="language.function.html.select.time">
<title>html_select_time</title> <title>html_select_time</title>
<informaltable frame="all"> <informaltable frame="all">
<tgroup cols="5"> <tgroup cols="5">
<colspec colname="param" align="center" /> <colspec colname="param" align="center" />
<colspec colname="type" align="center" /> <colspec colname="type" align="center" />
<colspec colname="required" align="center" /> <colspec colname="required" align="center" />
<colspec colname="default" align="center" /> <colspec colname="default" align="center" />
<colspec colname="desc" /> <colspec colname="desc" />
<thead> <thead>
<row> <row>
<entry>Attribute Name</entry> <entry>Attribute Name</entry>
<entry>Type</entry> <entry>Type</entry>
<entry>Required</entry> <entry>Required</entry>
<entry>Default</entry> <entry>Default</entry>
<entry>Description</entry> <entry>Description</entry>
</row> </row>
</thead> </thead>
<tbody> <tbody>
<row> <row>
<entry>prefix</entry> <entry>prefix</entry>
<entry>string</entry> <entry>string</entry>
<entry>No</entry> <entry>No</entry>
<entry>Time_</entry> <entry>Time_</entry>
<entry>what to prefix the var name with</entry> <entry>what to prefix the var name with</entry>
</row> </row>
<row> <row>
<entry>time</entry> <entry>time</entry>
<entry>timestamp</entry> <entry>timestamp</entry>
<entry>No</entry> <entry>No</entry>
<entry>current time</entry> <entry>current time</entry>
<entry>what date/time to use</entry> <entry>what date/time to use</entry>
</row> </row>
<row> <row>
<entry>display_hours</entry> <entry>display_hours</entry>
<entry>boolean</entry> <entry>boolean</entry>
<entry>No</entry> <entry>No</entry>
<entry>true</entry> <entry>true</entry>
<entry>whether or not to display hours</entry> <entry>whether or not to display hours</entry>
</row> </row>
<row> <row>
<entry>display_minutes</entry> <entry>display_minutes</entry>
<entry>boolean</entry> <entry>boolean</entry>
<entry>No</entry> <entry>No</entry>
<entry>true</entry> <entry>true</entry>
<entry>whether or not to display minutes</entry> <entry>whether or not to display minutes</entry>
</row> </row>
<row> <row>
<entry>display_seconds</entry> <entry>display_seconds</entry>
<entry>boolean</entry> <entry>boolean</entry>
<entry>No</entry> <entry>No</entry>
<entry>true</entry> <entry>true</entry>
<entry>whether or not to display seconds</entry> <entry>whether or not to display seconds</entry>
</row> </row>
<row> <row>
<entry>display_meridian</entry> <entry>display_meridian</entry>
<entry>boolean</entry> <entry>boolean</entry>
<entry>No</entry> <entry>No</entry>
<entry>true</entry> <entry>true</entry>
<entry>whether or not to display meridian (am/pm)</entry> <entry>whether or not to display meridian (am/pm)</entry>
</row> </row>
<row> <row>
<entry>use_24_hours</entry> <entry>use_24_hours</entry>
<entry>boolean</entry> <entry>boolean</entry>
<entry>No</entry> <entry>No</entry>
<entry>true</entry> <entry>true</entry>
<entry>whether or not to use 24 hour clock</entry> <entry>whether or not to use 24 hour clock</entry>
</row> </row>
<row> <row>
<entry>minute_interval</entry> <entry>minute_interval</entry>
<entry>integer</entry> <entry>integer</entry>
<entry>No</entry> <entry>No</entry>
<entry>1</entry> <entry>1</entry>
<entry>number interval in minute dropdown</entry> <entry>number interval in minute dropdown</entry>
</row> </row>
<row> <row>
<entry>second_interval</entry> <entry>second_interval</entry>
<entry>integer</entry> <entry>integer</entry>
<entry>No</entry> <entry>No</entry>
<entry>1</entry> <entry>1</entry>
<entry>number interval in second dropdown</entry> <entry>number interval in second dropdown</entry>
</row> </row>
<row> <row>
<entry>field_array</entry> <entry>field_array</entry>
<entry>string</entry> <entry>string</entry>
<entry>No</entry> <entry>No</entry>
<entry>n/a</entry> <entry>n/a</entry>
<entry>outputs values to array of this name</entry> <entry>outputs values to array of this name</entry>
</row> </row>
<row> <row>
<entry>all_extra</entry> <entry>all_extra</entry>
<entry>string</entry> <entry>string</entry>
<entry>No</entry> <entry>No</entry>
<entry>null</entry> <entry>null</entry>
<entry>adds extra attributes to select/input tags if <entry>adds extra attributes to select/input tags if
given</entry> given</entry>
</row> </row>
<row> <row>
<entry>hour_extra</entry> <entry>hour_extra</entry>
<entry>string</entry> <entry>string</entry>
<entry>No</entry> <entry>No</entry>
<entry>null</entry> <entry>null</entry>
<entry>adds extra attributes to select/input tags if <entry>adds extra attributes to select/input tags if
given</entry> given</entry>
</row> </row>
<row> <row>
<entry>minute_extra</entry> <entry>minute_extra</entry>
<entry>string</entry> <entry>string</entry>
<entry>No</entry> <entry>No</entry>
<entry>null</entry> <entry>null</entry>
<entry>adds extra attributes to select/input tags if <entry>adds extra attributes to select/input tags if
given</entry> given</entry>
</row> </row>
<row> <row>
<entry>second_extra</entry> <entry>second_extra</entry>
<entry>string</entry> <entry>string</entry>
<entry>No</entry> <entry>No</entry>
<entry>null</entry> <entry>null</entry>
<entry>adds extra attributes to select/input tags if <entry>adds extra attributes to select/input tags if
given</entry> given</entry>
</row> </row>
<row> <row>
<entry>meridian_extra</entry> <entry>meridian_extra</entry>
<entry>string</entry> <entry>string</entry>
<entry>No</entry> <entry>No</entry>
<entry>null</entry> <entry>null</entry>
<entry>adds extra attributes to select/input tags if <entry>adds extra attributes to select/input tags if
given</entry> given</entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
</informaltable> </informaltable>
<para> <para>
html_select_time is a custom function that html_select_time is a custom function that
creates time dropdowns for you. It can display creates time dropdowns for you. It can display
any or all of hour, minute, second and any or all of hour, minute, second and
meridian. meridian.
</para> </para>
<para> <para>
The time-attribute can have different The time-attribute can have different
formats. It can be a uniq-timestamp or a formats. It can be a uniq-timestamp or a
string containing Y-M-D. YYYY-MM-DD may be the string containing Y-M-D. YYYY-MM-DD may be the
most common, but months and days with less most common, but months and days with less
than two digits are also recognized. If one of than two digits are also recognized. If one of
the 3 values (Y,M,D) is the empty string, than the 3 values (Y,M,D) is the empty string, than
the according select-box is not pre-selected the according select-box is not pre-selected
at all. This is especially useful with the at all. This is especially useful with the
empty_year-, -month- and -day-attritbutes. empty_year-, -month- and -day-attritbutes.
</para> </para>
<example>
<example> <title>html_select_time</title>
<title>html_select_time</title> <programlisting>
<programlisting> <![CDATA[
{html_select_time use_24_hours=true} {html_select_time use_24_hours=true}
]]>
</programlisting>
OUTPUT: <para>
This will output:
&lt;select name="Time_Hour"&gt; </para>
&lt;option value="00"&gt;00&lt;/option&gt; <screen>
&lt;option value="01"&gt;01&lt;/option&gt; <![CDATA[
&lt;option value="02"&gt;02&lt;/option&gt; <select name="Time_Hour">
&lt;option value="03"&gt;03&lt;/option&gt; <option value="00">00</option>
&lt;option value="04"&gt;04&lt;/option&gt; <option value="01">01</option>
&lt;option value="05"&gt;05&lt;/option&gt; <option value="02">02</option>
&lt;option value="06"&gt;06&lt;/option&gt; <option value="03">03</option>
&lt;option value="07"&gt;07&lt;/option&gt; <option value="04">04</option>
&lt;option value="08"&gt;08&lt;/option&gt; <option value="05">05</option>
&lt;option value="09" selected&gt;09&lt;/option&gt; <option value="06">06</option>
&lt;option value="10"&gt;10&lt;/option&gt; <option value="07">07</option>
&lt;option value="11"&gt;11&lt;/option&gt; <option value="08">08</option>
&lt;option value="12"&gt;12&lt;/option&gt; <option value="09" selected>09</option>
&lt;option value="13"&gt;13&lt;/option&gt; <option value="10">10</option>
&lt;option value="14"&gt;14&lt;/option&gt; <option value="11">11</option>
&lt;option value="15"&gt;15&lt;/option&gt; <option value="12">12</option>
&lt;option value="16"&gt;16&lt;/option&gt; <option value="13">13</option>
&lt;option value="17"&gt;17&lt;/option&gt; <option value="14">14</option>
&lt;option value="18"&gt;18&lt;/option&gt; <option value="15">15</option>
&lt;option value="19"&gt;19&lt;/option&gt; <option value="16">16</option>
&lt;option value="20"&gt;20&lt;/option&gt; <option value="17">17</option>
&lt;option value="21"&gt;21&lt;/option&gt; <option value="18">18</option>
&lt;option value="22"&gt;22&lt;/option&gt; <option value="19">19</option>
&lt;option value="23"&gt;23&lt;/option&gt; <option value="20">20</option>
&lt;/select&gt; <option value="21">21</option>
&lt;select name="Time_Minute"&gt; <option value="22">22</option>
&lt;option value="00"&gt;00&lt;/option&gt; <option value="23">23</option>
&lt;option value="01"&gt;01&lt;/option&gt; </select>
&lt;option value="02"&gt;02&lt;/option&gt; <select name="Time_Minute">
&lt;option value="03"&gt;03&lt;/option&gt; <option value="00">00</option>
&lt;option value="04"&gt;04&lt;/option&gt; <option value="01">01</option>
&lt;option value="05"&gt;05&lt;/option&gt; <option value="02">02</option>
&lt;option value="06"&gt;06&lt;/option&gt; <option value="03">03</option>
&lt;option value="07"&gt;07&lt;/option&gt; <option value="04">04</option>
&lt;option value="08"&gt;08&lt;/option&gt; <option value="05">05</option>
&lt;option value="09"&gt;09&lt;/option&gt; <option value="06">06</option>
&lt;option value="10"&gt;10&lt;/option&gt; <option value="07">07</option>
&lt;option value="11"&gt;11&lt;/option&gt; <option value="08">08</option>
&lt;option value="12"&gt;12&lt;/option&gt; <option value="09">09</option>
&lt;option value="13"&gt;13&lt;/option&gt; <option value="10">10</option>
&lt;option value="14"&gt;14&lt;/option&gt; <option value="11">11</option>
&lt;option value="15"&gt;15&lt;/option&gt; <option value="12">12</option>
&lt;option value="16"&gt;16&lt;/option&gt; <option value="13">13</option>
&lt;option value="17"&gt;17&lt;/option&gt; <option value="14">14</option>
&lt;option value="18"&gt;18&lt;/option&gt; <option value="15">15</option>
&lt;option value="19"&gt;19&lt;/option&gt; <option value="16">16</option>
&lt;option value="20" selected&gt;20&lt;/option&gt; <option value="17">17</option>
&lt;option value="21"&gt;21&lt;/option&gt; <option value="18">18</option>
&lt;option value="22"&gt;22&lt;/option&gt; <option value="19">19</option>
&lt;option value="23"&gt;23&lt;/option&gt; <option value="20" selected>20</option>
&lt;option value="24"&gt;24&lt;/option&gt; <option value="21">21</option>
&lt;option value="25"&gt;25&lt;/option&gt; <option value="22">22</option>
&lt;option value="26"&gt;26&lt;/option&gt; <option value="23">23</option>
&lt;option value="27"&gt;27&lt;/option&gt; <option value="24">24</option>
&lt;option value="28"&gt;28&lt;/option&gt; <option value="25">25</option>
&lt;option value="29"&gt;29&lt;/option&gt; <option value="26">26</option>
&lt;option value="30"&gt;30&lt;/option&gt; <option value="27">27</option>
&lt;option value="31"&gt;31&lt;/option&gt; <option value="28">28</option>
&lt;option value="32"&gt;32&lt;/option&gt; <option value="29">29</option>
&lt;option value="33"&gt;33&lt;/option&gt; <option value="30">30</option>
&lt;option value="34"&gt;34&lt;/option&gt; <option value="31">31</option>
&lt;option value="35"&gt;35&lt;/option&gt; <option value="32">32</option>
&lt;option value="36"&gt;36&lt;/option&gt; <option value="33">33</option>
&lt;option value="37"&gt;37&lt;/option&gt; <option value="34">34</option>
&lt;option value="38"&gt;38&lt;/option&gt; <option value="35">35</option>
&lt;option value="39"&gt;39&lt;/option&gt; <option value="36">36</option>
&lt;option value="40"&gt;40&lt;/option&gt; <option value="37">37</option>
&lt;option value="41"&gt;41&lt;/option&gt; <option value="38">38</option>
&lt;option value="42"&gt;42&lt;/option&gt; <option value="39">39</option>
&lt;option value="43"&gt;43&lt;/option&gt; <option value="40">40</option>
&lt;option value="44"&gt;44&lt;/option&gt; <option value="41">41</option>
&lt;option value="45"&gt;45&lt;/option&gt; <option value="42">42</option>
&lt;option value="46"&gt;46&lt;/option&gt; <option value="43">43</option>
&lt;option value="47"&gt;47&lt;/option&gt; <option value="44">44</option>
&lt;option value="48"&gt;48&lt;/option&gt; <option value="45">45</option>
&lt;option value="49"&gt;49&lt;/option&gt; <option value="46">46</option>
&lt;option value="50"&gt;50&lt;/option&gt; <option value="47">47</option>
&lt;option value="51"&gt;51&lt;/option&gt; <option value="48">48</option>
&lt;option value="52"&gt;52&lt;/option&gt; <option value="49">49</option>
&lt;option value="53"&gt;53&lt;/option&gt; <option value="50">50</option>
&lt;option value="54"&gt;54&lt;/option&gt; <option value="51">51</option>
&lt;option value="55"&gt;55&lt;/option&gt; <option value="52">52</option>
&lt;option value="56"&gt;56&lt;/option&gt; <option value="53">53</option>
&lt;option value="57"&gt;57&lt;/option&gt; <option value="54">54</option>
&lt;option value="58"&gt;58&lt;/option&gt; <option value="55">55</option>
&lt;option value="59"&gt;59&lt;/option&gt; <option value="56">56</option>
&lt;/select&gt; <option value="57">57</option>
&lt;select name="Time_Second"&gt; <option value="58">58</option>
&lt;option value="00"&gt;00&lt;/option&gt; <option value="59">59</option>
&lt;option value="01"&gt;01&lt;/option&gt; </select>
&lt;option value="02"&gt;02&lt;/option&gt; <select name="Time_Second">
&lt;option value="03"&gt;03&lt;/option&gt; <option value="00">00</option>
&lt;option value="04"&gt;04&lt;/option&gt; <option value="01">01</option>
&lt;option value="05"&gt;05&lt;/option&gt; <option value="02">02</option>
&lt;option value="06"&gt;06&lt;/option&gt; <option value="03">03</option>
&lt;option value="07"&gt;07&lt;/option&gt; <option value="04">04</option>
&lt;option value="08"&gt;08&lt;/option&gt; <option value="05">05</option>
&lt;option value="09"&gt;09&lt;/option&gt; <option value="06">06</option>
&lt;option value="10"&gt;10&lt;/option&gt; <option value="07">07</option>
&lt;option value="11"&gt;11&lt;/option&gt; <option value="08">08</option>
&lt;option value="12"&gt;12&lt;/option&gt; <option value="09">09</option>
&lt;option value="13"&gt;13&lt;/option&gt; <option value="10">10</option>
&lt;option value="14"&gt;14&lt;/option&gt; <option value="11">11</option>
&lt;option value="15"&gt;15&lt;/option&gt; <option value="12">12</option>
&lt;option value="16"&gt;16&lt;/option&gt; <option value="13">13</option>
&lt;option value="17"&gt;17&lt;/option&gt; <option value="14">14</option>
&lt;option value="18"&gt;18&lt;/option&gt; <option value="15">15</option>
&lt;option value="19"&gt;19&lt;/option&gt; <option value="16">16</option>
&lt;option value="20"&gt;20&lt;/option&gt; <option value="17">17</option>
&lt;option value="21"&gt;21&lt;/option&gt; <option value="18">18</option>
&lt;option value="22"&gt;22&lt;/option&gt; <option value="19">19</option>
&lt;option value="23" selected&gt;23&lt;/option&gt; <option value="20">20</option>
&lt;option value="24"&gt;24&lt;/option&gt; <option value="21">21</option>
&lt;option value="25"&gt;25&lt;/option&gt; <option value="22">22</option>
&lt;option value="26"&gt;26&lt;/option&gt; <option value="23" selected>23</option>
&lt;option value="27"&gt;27&lt;/option&gt; <option value="24">24</option>
&lt;option value="28"&gt;28&lt;/option&gt; <option value="25">25</option>
&lt;option value="29"&gt;29&lt;/option&gt; <option value="26">26</option>
&lt;option value="30"&gt;30&lt;/option&gt; <option value="27">27</option>
&lt;option value="31"&gt;31&lt;/option&gt; <option value="28">28</option>
&lt;option value="32"&gt;32&lt;/option&gt; <option value="29">29</option>
&lt;option value="33"&gt;33&lt;/option&gt; <option value="30">30</option>
&lt;option value="34"&gt;34&lt;/option&gt; <option value="31">31</option>
&lt;option value="35"&gt;35&lt;/option&gt; <option value="32">32</option>
&lt;option value="36"&gt;36&lt;/option&gt; <option value="33">33</option>
&lt;option value="37"&gt;37&lt;/option&gt; <option value="34">34</option>
&lt;option value="38"&gt;38&lt;/option&gt; <option value="35">35</option>
&lt;option value="39"&gt;39&lt;/option&gt; <option value="36">36</option>
&lt;option value="40"&gt;40&lt;/option&gt; <option value="37">37</option>
&lt;option value="41"&gt;41&lt;/option&gt; <option value="38">38</option>
&lt;option value="42"&gt;42&lt;/option&gt; <option value="39">39</option>
&lt;option value="43"&gt;43&lt;/option&gt; <option value="40">40</option>
&lt;option value="44"&gt;44&lt;/option&gt; <option value="41">41</option>
&lt;option value="45"&gt;45&lt;/option&gt; <option value="42">42</option>
&lt;option value="46"&gt;46&lt;/option&gt; <option value="43">43</option>
&lt;option value="47"&gt;47&lt;/option&gt; <option value="44">44</option>
&lt;option value="48"&gt;48&lt;/option&gt; <option value="45">45</option>
&lt;option value="49"&gt;49&lt;/option&gt; <option value="46">46</option>
&lt;option value="50"&gt;50&lt;/option&gt; <option value="47">47</option>
&lt;option value="51"&gt;51&lt;/option&gt; <option value="48">48</option>
&lt;option value="52"&gt;52&lt;/option&gt; <option value="49">49</option>
&lt;option value="53"&gt;53&lt;/option&gt; <option value="50">50</option>
&lt;option value="54"&gt;54&lt;/option&gt; <option value="51">51</option>
&lt;option value="55"&gt;55&lt;/option&gt; <option value="52">52</option>
&lt;option value="56"&gt;56&lt;/option&gt; <option value="53">53</option>
&lt;option value="57"&gt;57&lt;/option&gt; <option value="54">54</option>
&lt;option value="58"&gt;58&lt;/option&gt; <option value="55">55</option>
&lt;option value="59"&gt;59&lt;/option&gt; <option value="56">56</option>
&lt;/select&gt; <option value="57">57</option>
&lt;select name="Time_Meridian"&gt; <option value="58">58</option>
&lt;option value="am" selected&gt;AM&lt;/option&gt; <option value="59">59</option>
&lt;option value="pm"&gt;PM&lt;/option&gt; </select>
&lt;/select&gt;</programlisting> <select name="Time_Meridian">
</example> <option value="am" selected>AM</option>
<option value="pm">PM</option>
</select>
]]>
</screen>
</example>
</sect1> </sect1>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:

View File

@@ -1,28 +1,31 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="language.function.popup.init"> <sect1 id="language.function.popup.init">
<title>popup_init</title> <title>popup_init</title>
<para> <para>
popup is an integration of overLib, a library used for popup popup is an integration of overLib, a library used for popup
windows. These are used for context sensitive information, such as windows. These are used for context sensitive information, such as
help windows or tooltips. popup_init must be called once at the help windows or tooltips. popup_init must be called once at the
top of any page you plan on using the <link top of any page you plan on using the <link
linkend="language.function.popup">popup</link> function. overLib linkend="language.function.popup">popup</link> function. overLib
was written by Erik Bosrup, and the homepage is located at was written by Erik Bosrup, and the homepage is located at
http://www.bosrup.com/web/overlib/. http://www.bosrup.com/web/overlib/.
</para> </para>
<para> <para>
As of Smarty version 2.1.2, overLib does NOT come with the release. As of Smarty version 2.1.2, overLib does NOT come with the release.
Download overLib, place the overlib.js file under your document Download overLib, place the overlib.js file under your document
root and supply the relative path to this file as the "src" root and supply the relative path to this file as the "src"
parameter to popup_init. parameter to popup_init.
</para> </para>
<example> <example>
<title>popup_init</title> <title>popup_init</title>
<programlisting> <programlisting>
<![CDATA[
{* popup_init must be called once at the top of the page *} {* popup_init must be called once at the top of the page *}
{popup_init src="/javascripts/overlib.js"}</programlisting> {popup_init src="/javascripts/overlib.js"}
</example> ]]>
</programlisting>
</example>
</sect1> </sect1>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables: