mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 10:54:27 +02:00
tag 2_6_26
This commit is contained in:
6
.gitattributes
vendored
6
.gitattributes
vendored
@@ -5,3 +5,9 @@ docs/fop/thrybi.ttf -text
|
||||
docs/fop/thryi.ttf -text
|
||||
docs/fop/thryn.ttf -text
|
||||
misc/smarty_icon.gif -text
|
||||
trunk/docs/chm/make_chm_spc.gif -text
|
||||
trunk/docs/fop/thryb.ttf -text
|
||||
trunk/docs/fop/thrybi.ttf -text
|
||||
trunk/docs/fop/thryi.ttf -text
|
||||
trunk/docs/fop/thryn.ttf -text
|
||||
trunk/misc/smarty_icon.gif -text
|
||||
|
19
.gitignore
vendored
19
.gitignore
vendored
@@ -17,3 +17,22 @@ docs/phpweb
|
||||
docs/revcheck.html
|
||||
docs/scripts/file-entities.php
|
||||
/templates_c
|
||||
trunk/docs/*.cache
|
||||
trunk/docs/*.fot
|
||||
trunk/docs/Makefile
|
||||
trunk/docs/chm/*.chm
|
||||
trunk/docs/chm/*.hh?
|
||||
trunk/docs/chm/fancy
|
||||
trunk/docs/config.*
|
||||
trunk/docs/configure
|
||||
trunk/docs/diff
|
||||
trunk/docs/dsssl/html-common.dsl
|
||||
trunk/docs/entities/file-entities.ent
|
||||
trunk/docs/entities/version.ent
|
||||
trunk/docs/html
|
||||
trunk/docs/manual.pdf
|
||||
trunk/docs/manual.xml
|
||||
trunk/docs/phpweb
|
||||
trunk/docs/revcheck.html
|
||||
trunk/docs/scripts/file-entities.php
|
||||
trunk/templates_c
|
||||
|
1
trunk/.cvsignore
Normal file
1
trunk/.cvsignore
Normal file
@@ -0,0 +1 @@
|
||||
templates_c
|
7
trunk/BUGS
Normal file
7
trunk/BUGS
Normal file
@@ -0,0 +1,7 @@
|
||||
Smarty is supported only in PHP 4.0.6 or later.
|
||||
|
||||
Smarty versions previous to 2.0 require the PEAR libraries. Be sure to include
|
||||
the path to the PEAR libraries in your php include_path. Config_file.class.php
|
||||
uses the PEAR library for its error handling routines. PEAR comes with the PHP
|
||||
distribution. Unix users check /usr/local/lib/php, windows users check
|
||||
C:/php/pear.
|
458
trunk/COPYING.lib
Normal file
458
trunk/COPYING.lib
Normal file
@@ -0,0 +1,458 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
9183
trunk/ChangeLog
Normal file
9183
trunk/ChangeLog
Normal file
File diff suppressed because it is too large
Load Diff
284
trunk/FAQ
Normal file
284
trunk/FAQ
Normal file
@@ -0,0 +1,284 @@
|
||||
QUESTION INDEX
|
||||
--------------
|
||||
|
||||
GENERAL
|
||||
|
||||
Q: What is Smarty?
|
||||
Q: What's the difference between Smarty and other template engines?
|
||||
Q: What do you mean "Compiled PHP Scripts" ?
|
||||
Q: Why can't I just use PHPA (http://php-accelerator.co.uk) or Zend Cache?
|
||||
Q: Why does smarty have a built in cache? Wouldn't it be better to handle this
|
||||
in a separate class?
|
||||
Q: Is Smarty faster than <insert other PHP template engine>?
|
||||
Q: How can I be sure to get the best performance from Smarty?
|
||||
Q: Do you have a mailing list?
|
||||
Q: Can you change the mailing list so reply-to sends to the list and not the
|
||||
user?
|
||||
|
||||
TROUBLESHOOTING
|
||||
|
||||
Q: Smarty doesn't work.
|
||||
Q: I get the following error when running Smarty:
|
||||
Warning: Smarty error: problem creating directory "templates_c/239/239105369"
|
||||
in /path/to/Smarty.class.php on line 542
|
||||
Q: I get the following error when running Smarty:
|
||||
Warning: Wrong parameter count for preg_replace() in
|
||||
Smarty.class.php on line 371
|
||||
Q: I get this error when passing variables to {include}:
|
||||
Fatal error: Call to undefined function: get_defined_vars() in
|
||||
/path/to/Smarty/templates_c/index.tpl.php on line 8
|
||||
Q: I get PHP errors in my {if} tag logic.
|
||||
Q: I'm changing my php code and/or templates, and my results are not getting
|
||||
updated.
|
||||
Q: I'm running Windows 2000 and I get blank content. My compiled PHP files are
|
||||
also zero length.
|
||||
Q: The template goes into an infinite loop when I include included templates
|
||||
that pass local variables
|
||||
Q: Javascript is causing Smarty errors in my templates.
|
||||
Q: I get "SAFE MODE Restriction in effect. ..."-errors when running smarty.
|
||||
|
||||
MISC
|
||||
|
||||
Q: Can I use Macromedia's Dreamweaver to edit my templates?
|
||||
Q: Dreamweaver is urlencoding the template delimiters when they are in a SRC or
|
||||
HREF link. How do I get around this?
|
||||
|
||||
HOWTO
|
||||
|
||||
Q: How do I generate different cache files per template based on arguments
|
||||
passed to the page?
|
||||
Q: How do I pass a template variable as a parameter? {function param={$varname}}
|
||||
does not work.
|
||||
Q: How do I include cached template(s) within a non-cached template?
|
||||
|
||||
|
||||
GENERAL
|
||||
-------
|
||||
|
||||
Q: What is Smarty?
|
||||
A: Smarty is a template engine for PHP... but be aware this isn't just another
|
||||
PHP template engine. It's much more than that.
|
||||
|
||||
Q: What's the difference between Smarty and other template engines?
|
||||
A: Most other template engines for PHP provide basic variable substitution and
|
||||
dynamic block functionality. Smarty takes a step further to be a "smart"
|
||||
template engine, adding features such as configuration files, template
|
||||
functions, variable modifiers (see the docs!) and making all of this
|
||||
functionality as easy as possible to use for both programmers and template
|
||||
designers. Smarty also compiles the templates into PHP scripts, eliminating
|
||||
the need to parse the templates on every invocation, making Smarty extremely
|
||||
scalable and manageable for large application needs.
|
||||
|
||||
Q: What do you mean "Compiled PHP Scripts" ?
|
||||
A: Smarty reads the template files and creates PHP scripts from them. Once
|
||||
these PHP scripts are created, Smarty executes these, never having to parse
|
||||
the template files again. If you change a template file, Smarty will
|
||||
recreate the PHP script for it. All this is done automatically by Smarty.
|
||||
Template designers never need to mess with the generated PHP scripts or even
|
||||
know of their existance. (NOTE: you can turn off this compile checking step
|
||||
in Smarty for increased performance.)
|
||||
|
||||
Q: Why can't I just use PHPA (http://php-accelerator.co.uk) or Zend Cache?
|
||||
A: You certainly can, and we highly recommend it! What PHPA does is caches
|
||||
compiled bytecode of your PHP scripts in shared memory or in a file. This
|
||||
speeds up server response and saves the compilation step. Smarty creates PHP
|
||||
scripts, which PHPA will cache nicely. Now, Smarty's built-in cache is
|
||||
something completely different. It caches the _output_ of the template
|
||||
contents. For example, if you have a template that requires several database
|
||||
queries, Smarty can cache this output, saving the need to call the database
|
||||
every time. Smarty and PHPA (or Zend Cache) complement each other nicely. If
|
||||
performance is of the utmost importance, we would recommend using one of
|
||||
these with any PHP application, using Smarty or not. As you can see in the
|
||||
benchmarks, Smartys performance _really_ excels in combination with a PHP
|
||||
accelerator.
|
||||
|
||||
Q: Why does Smarty have a built in cache? Wouldn't it be better to handle this
|
||||
in a separate class?
|
||||
A: Smarty's caching functionality is tightly integrated with the template
|
||||
engine, making it quite a bit more flexible than a simple caching wrapper.
|
||||
For instance, you can cache select portions of a template page. Let's say
|
||||
you have a polling box on your site. With Smarty, you can leave the poll
|
||||
dynamic and cache the rest of the page. You can also pass templates
|
||||
multiple cache ids, meaning that a template can have several caches
|
||||
depending on URL, cookies, etc.
|
||||
|
||||
Q: Is Smarty faster than <insert other PHP template engine>?
|
||||
A: See the benchmark page for some performance comparisons. Smarty's approach
|
||||
to templates is a bit different from some languages: it compiles templates
|
||||
into PHP scripts instead of parsing them on each invocation. This usually
|
||||
results in great performance gains, especially with complex templates.
|
||||
Coupled with the built-in caching of Smarty templates, the performance is
|
||||
outstanding.
|
||||
|
||||
Q: How can I be sure to get the best performance from Smarty?
|
||||
A: Be sure you set $compile_check=false once your templates are initially
|
||||
compiled. This will skip the unneeded step of testing if the template has
|
||||
changed since it was last compiled. If you have complex pages that don't
|
||||
change too often, turn on the caching engine and adjust your application so
|
||||
it doesn't do unnecessary work (like db calls) if a cached page is
|
||||
available. See the documentation for examples.
|
||||
|
||||
Q: Do you have a mailing list?
|
||||
A: We have a few mailing lists. "general" for you to share your ideas or ask
|
||||
questions, "dev" for those interested in the development efforts of Smarty,
|
||||
and "cvs" for those that would like to track the updates made in the cvs
|
||||
repository.
|
||||
|
||||
send a blank e-mail message to:
|
||||
smarty-general-subscribe@lists.php.net (subscribe to the general list)
|
||||
smarty-general-unsubscribe@lists.php.net (unsubscribe from the general list)
|
||||
smarty-general-digest-subscribe@lists.php.net (subscribe to digest)
|
||||
smarty-general-digest-unsubscribe@lists.php.net (unsubscribe from digest)
|
||||
smarty-dev-subscribe@lists.php.net (subscribe to the dev list)
|
||||
smarty-dev-unsubscribe@lists.php.net (unsubscribe from the dev list)
|
||||
smarty-cvs-subscribe@lists.php.net (subscribe to the cvs list)
|
||||
smarty-cvs-unsubscribe@lists.php.net (unsubscribe from the cvs list)
|
||||
You can also browse the mailing list archives at
|
||||
http://marc.theaimsgroup.com/?l=smarty&r=1&w=2
|
||||
|
||||
|
||||
|
||||
Q: Can you change the mailing list so Reply-To sends to the list and not the
|
||||
user?
|
||||
A: Yes we could, but no we won't. Use "Reply-All" in your e-mail client to send
|
||||
to the list. http://www.unicom.com/pw/reply-to-harmful.html
|
||||
|
||||
TROUBLESHOOTING
|
||||
---------------
|
||||
|
||||
Q: Smarty doesn't work.
|
||||
A: You must be using PHP 4.0.6 or later if you use any version of Smarty
|
||||
past 2.0.1. Read the BUGS file for more info.
|
||||
|
||||
Q: I get the following error when running Smarty:
|
||||
Warning: Smarty error: problem creating directory "templates_c/239/239105369"
|
||||
in /path/to/Smarty.class.php on line 542
|
||||
A: Your web server user does not have permission to write to the templates_c
|
||||
directory, or is unable to create the templates_c directory. Be sure the
|
||||
templates_c directory exists in the location defined in Smarty.class.php,
|
||||
and the web server user can write to it. If you do not know the web server
|
||||
user, chmod 777 the templates_c directory, reload the page, then check the
|
||||
file ownership of the files created in templates_c. Or, you can check the
|
||||
httpd.conf (usually in /usr/local/apache/conf) file for this setting:
|
||||
User nobody
|
||||
Group nobody
|
||||
|
||||
Q: I get the following error when running Smarty: Warning: Wrong parameter
|
||||
count for preg_replace() in Smarty.class.php on line 371
|
||||
A: preg_replace had a parameter added in PHP 4.0.2 that Smarty
|
||||
requires. Upgrade to at least 4.0.6 to fix all known PHP issues with
|
||||
Smarty.
|
||||
|
||||
Q: I get this error when passing variables to {include}:
|
||||
Fatal error: Call to undefined function: get_defined_vars() in
|
||||
/path/to/Smarty/templates_c/index.tpl.php on line 8
|
||||
A: get_defined_vars() was added to PHP 4.0.4. If you plan on passing
|
||||
variables to included templates, you will need PHP 4.0.6 or later.
|
||||
|
||||
Q: I get PHP errors in my {if} tag logic.
|
||||
A: All conditional qualifiers must be separated by spaces. This syntax will not
|
||||
work: {if $name=="Wilma"} You must instead do this: {if $name == "Wilma"}.
|
||||
The reason for this is syntax ambiguity. Both "==" and "eq" are equivalent
|
||||
in the template parser, so something like {if $nameeq"Wilma"} wouldn't be
|
||||
parsable by the tokenizer.
|
||||
|
||||
Q: I'm changing my php code and/or templates, and my results are not getting
|
||||
updated.
|
||||
A: This may be the result of your compile or cache settings. If you are
|
||||
changing your php code, your templates will not necessarily get recompiled
|
||||
to reflect the changes. Use $force_compile during develpment to avoid these
|
||||
situations. Also turn off caching during development when you aren't
|
||||
specifically testing it. You can also remove everything from your
|
||||
compile_dir and cache_dir and reload the page to be sure everything gets
|
||||
regenerated.
|
||||
|
||||
Q: I'm running Windows 2000 and I get blank content. My compiled PHP files are
|
||||
also zero length.
|
||||
A: There seems to be a problem with some W2k machines and exclusive file
|
||||
locking. Comment out the flock() call in _write_file to get around this,
|
||||
although be aware this could possibly cause a problem with simultaneous
|
||||
writes to a file, especially with caching turned on. NOTE: As of Smarty
|
||||
1.4.0, a workaround was put in place that should solve this.
|
||||
|
||||
Q: The template goes into an infinite loop when I include included templates
|
||||
that pass local variables
|
||||
A: This was fixed in 1.3.2 (new global attribute)
|
||||
|
||||
Q: Javascript is causing Smarty errors in my templates.
|
||||
A: Surround your javascript with {literal}{/literal} tags. See the docs.
|
||||
|
||||
Q: I get "SAFE MODE Restriction in effect. ..."-errors when running smarty.
|
||||
A: Use $smarty->use_sub_dirs = false when running php in safe mode.
|
||||
|
||||
MISC
|
||||
----
|
||||
|
||||
Q: Can I use Macromedia's Dreamweaver to edit my templates?
|
||||
A: Certainly. You might want to change your tag delimiters from {} to something
|
||||
that resembles valid HTML, like <!--{ }--> or <{ }> or something similar.
|
||||
This way the editor won't view the template tags as errors.
|
||||
|
||||
Q: Dreamweaver is urlencoding the template delimiters when they are in a SRC or
|
||||
HREF link. How do I get around this?
|
||||
A: In Edit - Properties - Rewrite HTML you can specify if Dreamweaver should
|
||||
change special letters to %-equivalent or not. The default is on which
|
||||
produces this error.
|
||||
|
||||
HOWTO
|
||||
-----
|
||||
|
||||
Q: How do I generate different cache files per template based on arguments
|
||||
passed to the page?
|
||||
A: Use your $REQUEST_URI as the cache_id when fetching the page:
|
||||
|
||||
global $REQUEST_URI; // if not already present
|
||||
$smarty->display('index.tpl',$REQUEST_URI);
|
||||
|
||||
This will create a separate cache file for each unique URL when you call
|
||||
index.tpl. See the documentation for display() and fetch()
|
||||
|
||||
Q: How do I pass a template variable as a parameter? {function param={$varname}}
|
||||
does not work.
|
||||
A: {function param=$varname} (You cannot nest template delimiters.)
|
||||
|
||||
Q: How do I include cached template(s) within a non-cached template?
|
||||
A: One way to do it:
|
||||
|
||||
$smarty->caching = true;
|
||||
$tpl1 = $smarty->fetch("internal1.tpl");
|
||||
$tpl2 = $smarty->fetch("internal2.tpl");
|
||||
$tpl3 = $smarty->fetch("internal3.tpl");
|
||||
|
||||
$smarty->assign("tpl1_contents",$tpl1);
|
||||
$smarty->assign("tpl2_contents",$tpl2);
|
||||
$smarty->assign("tpl3_contents",$tpl3);
|
||||
|
||||
$smarty->caching = false;
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl
|
||||
---------
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>{$tpl1_contents}</td>
|
||||
<td>{$tpl2_contents}</td>
|
||||
<td>{$tpl3_contents}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
Another approach:
|
||||
|
||||
You could write a custom insert function to fetch your internal
|
||||
templates:
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>{insert name=fetch_tpl tpl="internal1.tpl"}</td>
|
||||
<td>{insert name=fetch_tpl tpl="internal2.tpl"}</td>
|
||||
<td>{insert name=fetch_tpl tpl="internal3.tpl"}</td>
|
||||
</tr>
|
||||
</table>
|
29
trunk/INSTALL
Normal file
29
trunk/INSTALL
Normal file
@@ -0,0 +1,29 @@
|
||||
REQUIREMENTS:
|
||||
|
||||
Smarty requires PHP 4.0.6 or later.
|
||||
See the on-line documentation for complete install instructions.
|
||||
|
||||
INSTALLATION (quick):
|
||||
|
||||
* copy the files under the libs/ directory to a directory that is in your PHP
|
||||
include_path, or set the SMARTY_DIR constant and put them in this directory.
|
||||
(if you upgrade from versions before 2.5.0 be aware that up to Smarty 2.4.2
|
||||
all necessary files where in the distribution's root directory, but are now
|
||||
in libs/.)
|
||||
|
||||
* for each application using Smarty, create a "templates", "configs", and a
|
||||
"templates_c" directory, be sure to set the appropriate directory settings in
|
||||
Smarty for them. If they are located in the same directory as your
|
||||
application, they shouldn't need to be modified. Be sure the "templates_c"
|
||||
directory is writable by your web server user (usually nobody). chown
|
||||
nobody:nobody templates_c; chmod 700 templates_c You can also chmod 777 this
|
||||
directory, but be aware of security issues for multi-user systems. If you are
|
||||
using Smarty's built-in caching, create a "cache" directory and also chown
|
||||
nobody:nobody.
|
||||
|
||||
* setup your php and template files. A good working example is in the on-line
|
||||
documentation.
|
||||
|
||||
* TECHNICAL NOTE: If you do not have access to the php.ini file, you can change
|
||||
non-server settings (such as your include_path) with the ini_set() command.
|
||||
example: ini_set("include_path",".:/usr/local/lib/php");
|
1065
trunk/NEWS
Normal file
1065
trunk/NEWS
Normal file
File diff suppressed because it is too large
Load Diff
103
trunk/QUICK_START
Normal file
103
trunk/QUICK_START
Normal file
@@ -0,0 +1,103 @@
|
||||
This is a simple guide to get Smarty setup and running quickly. The online
|
||||
documentation includes a very thorough explanation of a Smarty installation.
|
||||
This guide is meant to be a quick and painless way of getting Smarty working,
|
||||
and nothing more. The guide assumes you are familiar with the UNIX system
|
||||
environment. Windows users will need to make adjustments where necessary.
|
||||
|
||||
INSTALL SMARTY LIBRARY FILES
|
||||
|
||||
Copy the Smarty library files to your system. In our example, we place them in
|
||||
/usr/local/lib/php/Smarty/
|
||||
|
||||
$> cd YOUR_DOWNLOAD_DIRECTORY
|
||||
$> gtar -ztvf Smarty-2.6.7.tar.gz
|
||||
$> mkdir /usr/local/lib/php/Smarty
|
||||
$> cp -r Smarty-2.6.7/libs/* /usr/local/lib/php/Smarty
|
||||
|
||||
You should now have the following file structure:
|
||||
|
||||
/usr/local/lib/php/Smarty/
|
||||
Config_File.class.php
|
||||
debug.tpl
|
||||
internals/
|
||||
plugins/
|
||||
Smarty.class.php
|
||||
Smarty_Compiler.class.php
|
||||
|
||||
|
||||
SETUP SMARTY DIRECTORIES
|
||||
|
||||
You will need four directories setup for Smarty to work. These files are for
|
||||
templates, compiled templates, cached templates and config files. You may or
|
||||
may not use caching or config files, but it is a good idea to set them up
|
||||
anyways. It is also recommended to place them outside of the web server
|
||||
document root. The web server PHP user will need write access to the cache and
|
||||
compile directories as well.
|
||||
|
||||
In our example, the document root is /web/www.domain.com/docs and the
|
||||
web server username is "nobody". We will keep our Smarty files under
|
||||
/web/www.domain.com/smarty
|
||||
|
||||
$> cd /web/www.domain.com
|
||||
$> mkdir smarty
|
||||
$> mkdir smarty/templates
|
||||
$> mkdir smarty/templates_c
|
||||
$> mkdir smarty/cache
|
||||
$> mkdir smarty/configs
|
||||
$> chown nobody:nobody smarty/templates_c
|
||||
$> chown nobody:nobody smarty/cache
|
||||
$> chmod 775 smarty/templates_c
|
||||
$> chmod 775 smarty/cache
|
||||
|
||||
|
||||
SETUP SMARTY PHP SCRIPTS
|
||||
|
||||
Now we setup our application in the document root:
|
||||
|
||||
$> cd /web/www.domain.com/docs
|
||||
$> mkdir myapp
|
||||
$> cd myapp
|
||||
$> vi index.php
|
||||
|
||||
Edit the index.php file to look like the following:
|
||||
|
||||
<?php
|
||||
|
||||
// put full path to Smarty.class.php
|
||||
require('/usr/local/lib/php/Smarty/Smarty.class.php');
|
||||
$smarty = new Smarty();
|
||||
|
||||
$smarty->template_dir = '/web/www.domain.com/smarty/templates';
|
||||
$smarty->compile_dir = '/web/www.domain.com/smarty/templates_c';
|
||||
$smarty->cache_dir = '/web/www.domain.com/smarty/cache';
|
||||
$smarty->config_dir = '/web/www.domain.com/smarty/configs';
|
||||
|
||||
$smarty->assign('name', 'Ned');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
|
||||
|
||||
SETUP SMARTY TEMPLATE
|
||||
|
||||
$> vi /web/www.domain.com/smarty/templates/index.tpl
|
||||
|
||||
Edit the index.tpl file with the following:
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Smarty</title>
|
||||
</head>
|
||||
<body>
|
||||
Hello, {$name}!
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
Now go to your new application through the web browser,
|
||||
http://www.domain.com/myapp/index.php in our example. You should see the text
|
||||
"Hello Ned!" in your browser.
|
||||
|
||||
Once you get this far, you can continue on to the Smarty Crash Course to learn
|
||||
a few more simple things, or on to the documentation to learn it all.
|
86
trunk/README
Normal file
86
trunk/README
Normal file
@@ -0,0 +1,86 @@
|
||||
|
||||
NAME:
|
||||
|
||||
Smarty - the PHP compiling template engine
|
||||
|
||||
VERSION: 2.6.18
|
||||
|
||||
AUTHORS:
|
||||
|
||||
Monte Ohrt <monte at ohrt dot com>
|
||||
Andrei Zmievski <andrei@php.net>
|
||||
|
||||
MAILING LISTS:
|
||||
|
||||
We have a few mailing lists. "discussion" for you to share your ideas or ask
|
||||
questions, "developers" for those interested in the development efforts of Smarty,
|
||||
and "svn" for those that would like to track the updates made in the svn
|
||||
repository.
|
||||
|
||||
send a blank e-mail message to:
|
||||
smarty-discussion-subscribe@googlecode.com(subscribe to the general discussion list)
|
||||
smarty-discussion-unsubscribe@googlecode.com (unsubscribe from the general discussion list)
|
||||
smarty-discussion-digest-subscribe@googlecode.com (subscribe to digest)
|
||||
smarty-discussion-digest-unsubscribe@googlecode.com (unsubscribe from digest)
|
||||
smarty-developers-subscribe@googlecode.com (subscribe to the dev list)
|
||||
smarty-developers-unsubscribe@googlecode.com (unsubscribe from the dev list)
|
||||
smarty-svn-subscribe@googlecode.com (subscribe to the svn list)
|
||||
smarty-svn-unsubscribe@googlecode.com (unsubscribe from the svn list)
|
||||
|
||||
You can also browse the mailing list archives at
|
||||
http://groups.google.com/group/smarty-discussion
|
||||
http://groups.google.com/group/smarty-developers
|
||||
|
||||
and the OLD list archives at
|
||||
http://marc.theaimsgroup.com/?l=smarty&r=1&w=2
|
||||
|
||||
SYNOPSIS:
|
||||
|
||||
require("Smarty.class.php");
|
||||
|
||||
$smarty = new Smarty;
|
||||
|
||||
$smarty->assign("Title","My Homepage");
|
||||
$smarty->assign("Names",array("John","Gary","Gregg","James"));
|
||||
|
||||
$smarty->display("index.tpl");
|
||||
|
||||
|
||||
DESCRIPTION:
|
||||
|
||||
What is Smarty?
|
||||
|
||||
Smarty is a template engine for PHP. Many other template engines for PHP
|
||||
provide basic variable substitution and dynamic block functionality.
|
||||
Smarty takes a step further to be a "smart" template engine, adding
|
||||
features such as configuration files, template functions, and variable
|
||||
modifiers, and making all of this functionality as easy as possible to
|
||||
use for both programmers and template designers. Smarty also converts
|
||||
the templates into PHP scripts, eliminating the need to parse the
|
||||
templates on every invocation. This makes Smarty extremely scalable and
|
||||
manageable for large application needs.
|
||||
|
||||
Some of Smarty's features:
|
||||
|
||||
* it is extremely fast
|
||||
* no template parsing overhead, only compiles once.
|
||||
* it is smart about recompiling only the template files that have
|
||||
changed.
|
||||
* the template language is remarkably extensible via the plugin
|
||||
architecture.
|
||||
* configurable template delimiter tag syntax, so you can use
|
||||
{}, {{}}, <!--{}-->, or whatever you like.
|
||||
* built-in caching of template output.
|
||||
* arbitrary template sources (filesystem, databases, etc.)
|
||||
* template if/elseif/else/endif constructs are passed to the PHP parser,
|
||||
so the if syntax can be as simple or as complex as you like.
|
||||
* unlimited nesting of sections, conditionals, etc. allowed
|
||||
* it is possible to embed PHP code right in your template files,
|
||||
although not recommended and doubtfully needed since the engine
|
||||
is so customizable.
|
||||
* and many more.
|
||||
|
||||
COPYRIGHT:
|
||||
Copyright (c) 2001-2005 New Digital Group, Inc. All rights reserved.
|
||||
This software is released under the GNU Lesser General Public License.
|
||||
Please read the disclaimer at the top of the Smarty.class.php file.
|
428
trunk/RELEASE_NOTES
Normal file
428
trunk/RELEASE_NOTES
Normal file
@@ -0,0 +1,428 @@
|
||||
2.6.7
|
||||
-----
|
||||
|
||||
Those using Smarty with security enabled: a hole was found that allowed PHP code to be executed from within a template file. This has been fixed and you are engouraged to upgrade immediately. Note that this hole does NOT affect the security of your web server or PHP applications, only the ability for someone editing a template to execute PHP code. Other changes in this release can be found in the NEWS file.
|
||||
|
||||
2.5.0
|
||||
-----
|
||||
|
||||
Very minor adjustments since RC2, see the NEWS file for details.
|
||||
|
||||
2.5.0-RC2
|
||||
---------
|
||||
|
||||
Many fixes since the RC1 release. This one is as close to production quality as
|
||||
they come, so this will be the last release before 2.5.0. The SGML documentation
|
||||
files have also been removed from the tarball. If you want them, get them from
|
||||
the CVS repository.
|
||||
|
||||
2.5.0-RC1
|
||||
---------
|
||||
|
||||
Release Candidate 1. All $smarty vars can now be dynamic, such as
|
||||
$smarty.get.$foo. A new class function get_function_object() gets you a
|
||||
reference to an assigned object, useful within your own custom functions.
|
||||
append() can now merge as well as append with a third optional attribute. A new
|
||||
class function get_config_vars() was added, and get_template_vars() can now be
|
||||
used to get individual vars. Full variable syntax is now supported within
|
||||
double quotes via a backtick (`) syntax. Files created by smarty are now
|
||||
written to a tmp file then renamed to avoid file lock retention. html_radios,
|
||||
html_checkboxes, html_table, html_image, nl2br functions added, see the NEWS
|
||||
file for full details.
|
||||
|
||||
2.4.2
|
||||
-----
|
||||
Another point release. Added support for dynamic object reference syntax
|
||||
($foo->$bar), support for full variable syntax within quotes ("$foo[0].bar"),
|
||||
and other minor fixes. See the NEWS file for full details.
|
||||
|
||||
2.4.1
|
||||
-----
|
||||
|
||||
This is basically a point release, cleaning up a few things caught
|
||||
in the 2.4.0 release. See the NEWS file for full details.
|
||||
|
||||
2.4.0
|
||||
-----
|
||||
|
||||
Smarty now supports the ability to access objects within the templates. Two
|
||||
methods are available, one which closely follows Smartys conventions, and
|
||||
another that follows more traditional object syntax for those familiar with
|
||||
PHP.
|
||||
|
||||
The internal compiling engine has also undergone some major work. The regex
|
||||
parsing was rewritten to be much more strict, more secure and more
|
||||
maintainable. Config files are now compiled, which can speed up pages quite a
|
||||
bit that use config files extensively. Assigned variables are no longer
|
||||
extracted to PHP namespace, saving an extract call for every template. There is
|
||||
now support for applying modifiers to static values and functions. You can now
|
||||
access constants with $smarty.const.VAR. See the NEWS file for complete
|
||||
changes.
|
||||
|
||||
2.3.1
|
||||
-----
|
||||
|
||||
The mtime on compiled files will now match the source files, in the case where
|
||||
the source file may not get the current timestamp, recompiling will still work
|
||||
as expected. Proper support for open_basedir has been added, so Smarty should
|
||||
work correctly in safe mode. Added a few new features such as textformat block
|
||||
function, strip variable modifier and optgroup support for html_options. Also
|
||||
other minor bug fixes, see the Change Log.
|
||||
|
||||
2.3.0
|
||||
-----
|
||||
|
||||
Smarty now has a {debug} template function that brings up the debugging console
|
||||
right where {debug} is called, regardless of $debugging settings. This works a
|
||||
little different than turning on $debugging in the sense that it shows all the
|
||||
template variables available at the time {debug} is called, including local
|
||||
scope vars. It does not show the templates names however, since this
|
||||
executed during runtime of the template.
|
||||
|
||||
You can now supply an expire time when clearing cache or compile files. This is
|
||||
mostly useful for removing stale files via the API.
|
||||
|
||||
Plugins now stop execution upon error, instead of outputting a warning and
|
||||
continuing.
|
||||
|
||||
Two new API functions, assign_by_ref() and append_by_ref() were added. They
|
||||
allow assigning template variables by reference. This can make a significant
|
||||
performance gain, especially if you are assigning large arrays of data. PHP 5.0
|
||||
will do this implicitly, so these functions are basically workarounds.
|
||||
|
||||
Several misc bug fixes, see the Change Log for information.
|
||||
|
||||
|
||||
2.2.0
|
||||
-----
|
||||
|
||||
Smarty now allows an array of paths for the $plugin_dir class variable. The
|
||||
directories will be searched in the order they are given, so for efficiency keep
|
||||
the most-used plugins at the top. Also, absolute paths to the plugin directories are
|
||||
more efficient than relying on the PHP include_path.
|
||||
|
||||
Cache files can now be grouped with the cache_id. See the documentation under
|
||||
the new "Caching" section for details. compile_id also respects the same
|
||||
grouping syntax. The cache/compile file structure changed, so be sure to clear
|
||||
out all your cache and compile files when upgrading Smarty. Also if you are
|
||||
using PHP-accelerator, restart apache. I've seen some quirky things happen if
|
||||
the phpa files do not get cleared (known issue with phpa and parent
|
||||
class-member changes, so just clear 'em.)
|
||||
|
||||
Smarty now correctly respects the PHP include_path for $template_dir, $compile_dir,
|
||||
$cache_dir, $config_dir and $plugin_dir. Be aware that relying on the
|
||||
include_path is an overhead, try to use absolute pathnames when possible
|
||||
(or relative to working directory.)
|
||||
|
||||
Documentation has been updated and rearranged a bit. Most notably, the
|
||||
installation instructions are completely revamped, and a new Caching section
|
||||
explains Smarty's caching in detail along with the new grouping functionality.
|
||||
|
||||
Many misc. bug fixes and enhancements, see the full ChangeLog (NEWS file) for
|
||||
details.
|
||||
|
||||
2.1.1
|
||||
-----
|
||||
|
||||
There was a bug with template paths and the include_path, this has been fixed.
|
||||
Also register_outputfilter() did not work, this is fixed. A new template
|
||||
function named "cycle" has been added to the distribution, nice for cycling
|
||||
through a list (or array) of values.
|
||||
|
||||
2.1.0
|
||||
-----
|
||||
|
||||
This release has quite a few new features and fixes. Most notable are the
|
||||
introduction of block functions, so you can write plugins that work on a block
|
||||
of text with {func}{/func} notation. Also output filters were added, so you can
|
||||
apply a function against the output of your templates. This differs from the
|
||||
postfilter function, which works on the compiled template at compile time, and
|
||||
output filters work on the template output at runtime.
|
||||
|
||||
Many other features and bug fixes are noted in the NEWS file.
|
||||
|
||||
|
||||
2.0.1
|
||||
-----
|
||||
|
||||
This is a point release, fixing a few bugs and cleaning things up. A plugin
|
||||
was renamed, the dash "-" was removed from compiled template and cached file
|
||||
names. If you're upgrading, you might want to clear them out first. See the
|
||||
ChangeLog for details.
|
||||
|
||||
2.0.0
|
||||
-----
|
||||
|
||||
This release is a huge milestone for Smarty. Most notable new things are a
|
||||
plugin architecture, removal of PEAR dependency, and optimizations that
|
||||
drastically improve the performance of Smarty in most cases.
|
||||
|
||||
The plugin architecture allows modifiers, custom functions, compiler functions,
|
||||
prefilters, postfilters, resources, and insert functions to be added by
|
||||
simply dropping a file into the plugins directory. Once dropped in, they are
|
||||
automatically registered by the template engine. This makes user-contributed
|
||||
plugins easy to manage, as well as the internal workings of Smarty easy to
|
||||
control and customize. This new architecture depends on the __FILE__ constant,
|
||||
which contains the full path to the executing script. Some older versions of
|
||||
PHP incorrectly gave the script name and not the full filesystem path. Be sure
|
||||
your version of PHP populates __FILE__ correctly. If you use custom template
|
||||
resource functions, the format of these changed with the plugin architecture.
|
||||
Be sure to update your functions accordingly. See the template resource section
|
||||
of the documentation.
|
||||
|
||||
The PEAR dependancy was removed from Smarty. The Config_File class that comes
|
||||
with Smarty was actually what needed PEAR for error handling which Smarty didn't
|
||||
use, but now everything is self-contained.
|
||||
|
||||
Performance improvements are graphed on the benchmark page, you will see that
|
||||
overall performance has been sped up by as much as 80% in some cases.
|
||||
|
||||
Smarty-cached pages now support If-Modified-Since headers, meaning that if a
|
||||
cached template page has not changed since the last request, a "304 Not
|
||||
Modified" header will be sent instead of resending the same page. This is
|
||||
disabled by default, change the setting of $cache_modified_check.
|
||||
|
||||
|
||||
1.5.2
|
||||
-----
|
||||
|
||||
Mostly bug fixes, added a default template resource handler.
|
||||
|
||||
|
||||
1.5.1
|
||||
-----
|
||||
|
||||
Critical bug fix release. If you use caching, you'll need to upgrade.
|
||||
|
||||
|
||||
1.5.0
|
||||
-----
|
||||
|
||||
Several feature enhancements were made to this version, most notably the
|
||||
{foreach ...} command which is an alternative to {section ...} with an easier
|
||||
syntax for looping through a single array of values. Several functions were
|
||||
enhanced so that the output can be automatically assigned to a template
|
||||
variable instead of displayed (assign attribute). Cache files can now be
|
||||
controlled with a custom function as an alternative to the built-in file based
|
||||
method. Many code cleanups and bug fixed went into this release as well.
|
||||
|
||||
|
||||
1.4.6
|
||||
-----
|
||||
|
||||
The behavior with caching and compile_check has been slightly enhanced. If
|
||||
caching is enabled AND compile_check is enabled, the cache will immediately get
|
||||
regenerated if _any_ involved template or config file is updated. This imposes
|
||||
a slight performance hit because it must check all the files for changes, so be
|
||||
sure to run live sites with caching enabled and compile_check disabled for best
|
||||
performance. If you update a template or config file, simply turn on
|
||||
compile_check, load the page, then turn it back off. This will update the cache
|
||||
file with the new content. This is accomplished by maintaining a list of
|
||||
included/loaded templates and config files at the beginning of the cache file.
|
||||
Therefore it is advisable to remove all cache files after upgrading to 1.4.6
|
||||
(although not absolutely necessary, old cache files will regenerate)
|
||||
|
||||
The debug console now has script timing and array values printed. You MUST
|
||||
update your debug.tpl file with this version of Smarty. Also, the new debug.tpl
|
||||
will not work with older versions of Smarty.
|
||||
|
||||
|
||||
1.4.5
|
||||
-----
|
||||
|
||||
Mostly bug fixes and minor improvements. Added compile id for separate compiled
|
||||
versions of the same script. The directory format and filename convention for
|
||||
the files in templates_c has changed, so you may want to remove all of the
|
||||
existing ones before you upgrade.
|
||||
|
||||
|
||||
1.4.4
|
||||
-----
|
||||
|
||||
A few bug fixes, new section looping attributes and properties, debugging
|
||||
console function for control via URL, and overLib integration and access
|
||||
to request variables from within the template.
|
||||
|
||||
|
||||
1.4.3
|
||||
-----
|
||||
|
||||
This release has a few bug fixes and several enhancements. Smarty now supports
|
||||
template security for third-party template editing. These features disallow the
|
||||
ability for someone to execute commands or PHP code from the template language.
|
||||
Smarty also now has a built-in debugging console, which is a javascript pop-up
|
||||
window that displays all the included template names and assigned variables.
|
||||
|
||||
|
||||
1.4.2
|
||||
-----
|
||||
|
||||
This was mostly one bug fix with variable scoping within included templates
|
||||
and a few documentation changes and updates. See the ChangeLog file for full
|
||||
details.
|
||||
|
||||
|
||||
1.4.1
|
||||
-----
|
||||
|
||||
It seems that the EX_LOCK logic from the previous release didn't fix all the
|
||||
problems with windows platforms. Hopefully this one does. It basically
|
||||
disables file locking on windows, so there is a potential that two programs
|
||||
could write over the same file at the same time, fyi.
|
||||
|
||||
The reset is minor bug fixes, please refer to the ChangeLog file.
|
||||
|
||||
|
||||
1.4.0
|
||||
-----
|
||||
|
||||
IMPORTANT NOTICE
|
||||
|
||||
Smarty now has a new syntax for accessing elements within section loops. The
|
||||
new syntax is easier to use and nicely handles data structures of any
|
||||
complexity. Consequently, this breaks the old syntax.
|
||||
|
||||
Here is an example of the syntax change:
|
||||
|
||||
old syntax:
|
||||
{$sec1/sec2/sec3/customer.phone}
|
||||
|
||||
new syntax:
|
||||
{$customer[$sec1][$sec2][$sec3].phone}
|
||||
|
||||
The section names used to come first, followed by the variable name. Now the
|
||||
variable name always comes first, followed by the section names in brackets.
|
||||
You can access variable indexes anywhere, depending on how you passed the
|
||||
variables in.
|
||||
|
||||
To fix your current templates, we have provided a script that will adjust the
|
||||
syntax for you. Located in misc/fix_vars.php, run this script from the the
|
||||
command line, giving each template as an argument. Be sure to use absolute
|
||||
pathnames, or pathnames relative to the executing script. Probably the easiest
|
||||
way to do this is to copy the fix_vars.php script into your template directory
|
||||
and run 'php -q fix_vars.php *.tpl' Be sure you have proper write permission,
|
||||
and backup your scripts first to be safe! The examples in the 1.4.0
|
||||
documentation have been updated to reflect the changes.
|
||||
|
||||
cd /path/to/templates
|
||||
cp /path/to/fix_vars.php .
|
||||
find . -name "*.tpl" -exec php -q ./fix_vars.php {} \;
|
||||
|
||||
NEW AND IMPROVED COMPILATION PROCESS
|
||||
|
||||
Smarty 1.4.0 also has a new compilation process. Instead of compiling all the
|
||||
templates up front, it now compiles them at runtime. This has several
|
||||
advantages. First of all, there is no longer a need to have a single template
|
||||
directory. You can now have arbitrary template sources, such as multiple
|
||||
directories or even database calls. This also speeds the performance of Smarty
|
||||
when $compile_check is enabled, since it is only checking the template that is
|
||||
being executed instead of everything found in the template directory. The
|
||||
$tpl_file_ext is no longer needed, but kept for backward compatability.
|
||||
Templates can now be named anything you like with any extension.
|
||||
|
||||
MINOR FIXES
|
||||
|
||||
A workaround for LOCK_EX on Windows systems was added, and changed a couple of
|
||||
file permissions for better security on public servers.
|
||||
|
||||
$show_info_header is now defaulted to false instead of true. This header causes
|
||||
problems when displaying content other than HTML, so now you must explicitly
|
||||
set this flag to true to show the header information (or change the default in
|
||||
your copy of Smarty.)
|
||||
|
||||
Documentation is written in docbook format. I updated the docbook -> HTML
|
||||
generating software & style-sheets, and consequently the examples are no longer
|
||||
in a different background color. If anyone wants to contribute a better
|
||||
stylesheet or help with documentation, drop me a line. <monte at ohrt dot com>
|
||||
|
||||
CHANGES/ENHANCEMENTS/UPDATES
|
||||
|
||||
date_format, html_select_date and html_select_time used to require a unix
|
||||
timestamp as the format of the date passed into the template. Smarty is now a
|
||||
bit smarter at this. It will take a unix timestamp, a mysql timestamp, or any
|
||||
date string that is parsable by strtotime, such as 10/01/2001 or 2001-10-01,
|
||||
etc. Just give some formats a try and see what works.
|
||||
|
||||
Smarty now has template prefilters, meaning that you can run your templates
|
||||
through custom functions before they are compiled. This is good for things like
|
||||
removing unwanted comments, keeping an eye on words or functionality people are
|
||||
putting in templates, translating XML -> HTML, etc. See the register_prefilter
|
||||
documentation for more info.
|
||||
|
||||
Another addition are the so-called compiler functions. These are custom
|
||||
functions registered by the user that are executed at compilation time of the
|
||||
template. They can be used to inject PHP code or time-sensitive static content
|
||||
into the compiled template.
|
||||
|
||||
The run-time custom functions are now passed the Smarty object as the second
|
||||
parameter. This can be used, for example, to assign or clear template variables
|
||||
from inside the custom function.
|
||||
|
||||
clear_compile_dir() was added for clearing out compiled versions of your
|
||||
templates. Not something normally needed, but you may have a need for this if
|
||||
you have $compile_check set to false and you periodically update templates via
|
||||
some automated process. As of 1.4.0, uncompiled templates _always_ get
|
||||
compiled regardless of $compile_check setting, although they won't be checked
|
||||
for recompile if $compile_check is set to false.
|
||||
|
||||
You can now refer to properties of objects assigned from PHP by using the '->'
|
||||
symbol and specifying the property name after it, e.g. $foo->bar.
|
||||
|
||||
{php}{/php} tags were added to embed php into the templates. Not normally
|
||||
needed, but some circumstances may call for it. Check out the "componentized
|
||||
templates" tip in the documentation for an example.
|
||||
|
||||
{capture}{/capture} and {counter} functions were added. See the documentation
|
||||
for a complete description and examples.
|
||||
|
||||
UPGRADE NOTES
|
||||
|
||||
The format of the files created in the $compile_dir are now a bit different.
|
||||
The compiled template filename is the template resource name url-encoded.
|
||||
Therefore, all compiled files are now in the top directory of $compile_dir.
|
||||
This was done to make way for arbitrary template resources. Each compiled
|
||||
template also has a header that states what template resource was used to
|
||||
create it. From a unix command prompt, you can use "head -2 *" to see the first
|
||||
two lines of each file.
|
||||
|
||||
When upgrading to 1.4.0, you will want to clear out all your old files in the
|
||||
$compile_dir. If you have $compile_check set to false and the compiled template
|
||||
does not yet exist, it will compile it regardless of this setting. This way you
|
||||
can clear out the $compile_dir and not worry about setting $compile_check to
|
||||
true to get the inital compilation under way.
|
||||
|
||||
|
||||
1.3.2
|
||||
-----
|
||||
|
||||
Smarty now has (an optional) header prepended to the output of the Smarty
|
||||
templates. This displays the Smarty version and the date/time when the page was
|
||||
generated. This is useful for debugging your cache routines, and purely
|
||||
informational so there is evidence that the page was generated by Smarty. Set
|
||||
$show_info_header to false to disable it.
|
||||
|
||||
{config_load ...} performance was tuned by placing the loaded variables into a
|
||||
global array, so basically a config file is read from the file system and
|
||||
placed into a php array structure only once, no matter how many times it is
|
||||
called in any of the templates. The scope of the loaded variables has changed a
|
||||
bit as well. Variables loaded by config_load used to be treated as global
|
||||
variables, meaning that parent templates (templates that included the current
|
||||
template) could see them. Now the default behavior is such that loaded
|
||||
variables are only visible by the current template and child templates (all
|
||||
templates included after the {config_load ...} is called.) To mimic the
|
||||
original behavior, provide the attribute "global=yes" like so: {config_load
|
||||
file="mystuff.conf" global=yes}. Now when you load in mystuff.conf, the
|
||||
variables will be visible to parent templates (merged with any existing config
|
||||
variables.)
|
||||
|
||||
A formatting attribute was added to the {math ...} function, adding the ability
|
||||
to control the format of the output. Use the same formatting syntax as the PHP
|
||||
function sprintf().
|
||||
|
||||
{html_select_time ...} was added, a custom function that works much like
|
||||
{html_select_date ...} except it displays time elements instead of dates.
|
||||
|
||||
A few custom modifiers were added: count_characters, count_words,
|
||||
count_sentences, count_paragraphs. All pretty self-explanatory.
|
||||
|
||||
/* vim: set et: */
|
10
trunk/TODO
Normal file
10
trunk/TODO
Normal file
@@ -0,0 +1,10 @@
|
||||
* handle asp style tags in $php_handler
|
||||
* fix all E_NOTICE warnings
|
||||
* make simple math easier
|
||||
* caching all but parts of the template
|
||||
* change plugins so $smarty variable always comes first
|
||||
* get cache ttl with function call
|
||||
FIX: make inserts use normal functions before plugins
|
||||
UPD: change it so that if template comes from some resource,
|
||||
that resource stays as the default, no need to specify it
|
||||
in includes.
|
5
trunk/demo/configs/test.conf
Normal file
5
trunk/demo/configs/test.conf
Normal file
@@ -0,0 +1,5 @@
|
||||
title = Welcome to Smarty!
|
||||
cutoff_size = 40
|
||||
|
||||
[setup]
|
||||
bold = true
|
25
trunk/demo/index.php
Normal file
25
trunk/demo/index.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
require '../libs/Smarty.class.php';
|
||||
|
||||
$smarty = new Smarty;
|
||||
|
||||
$smarty->compile_check = true;
|
||||
$smarty->debugging = true;
|
||||
|
||||
$smarty->assign("Name","Fred Irving Johnathan Bradley Peppergill");
|
||||
$smarty->assign("FirstName",array("John","Mary","James","Henry"));
|
||||
$smarty->assign("LastName",array("Doe","Smith","Johnson","Case"));
|
||||
$smarty->assign("Class",array(array("A","B","C","D"), array("E", "F", "G", "H"),
|
||||
array("I", "J", "K", "L"), array("M", "N", "O", "P")));
|
||||
|
||||
$smarty->assign("contacts", array(array("phone" => "1", "fax" => "2", "cell" => "3"),
|
||||
array("phone" => "555-4444", "fax" => "555-3333", "cell" => "760-1234")));
|
||||
|
||||
$smarty->assign("option_values", array("NY","NE","KS","IA","OK","TX"));
|
||||
$smarty->assign("option_output", array("New York","Nebraska","Kansas","Iowa","Oklahoma","Texas"));
|
||||
$smarty->assign("option_selected", "NE");
|
||||
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
2
trunk/demo/templates/footer.tpl
Normal file
2
trunk/demo/templates/footer.tpl
Normal file
@@ -0,0 +1,2 @@
|
||||
</BODY>
|
||||
</HTML>
|
6
trunk/demo/templates/header.tpl
Normal file
6
trunk/demo/templates/header.tpl
Normal file
@@ -0,0 +1,6 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
{popup_init src="/javascripts/overlib.js"}
|
||||
<TITLE>{$title} - {$Name}</TITLE>
|
||||
</HEAD>
|
||||
<BODY bgcolor="#ffffff">
|
81
trunk/demo/templates/index.tpl
Normal file
81
trunk/demo/templates/index.tpl
Normal file
@@ -0,0 +1,81 @@
|
||||
{config_load file=test.conf section="setup"}
|
||||
{include file="header.tpl" title=foo}
|
||||
|
||||
<PRE>
|
||||
|
||||
{* bold and title are read from the config file *}
|
||||
{if #bold#}<b>{/if}
|
||||
{* capitalize the first letters of each word of the title *}
|
||||
Title: {#title#|capitalize}
|
||||
{if #bold#}</b>{/if}
|
||||
|
||||
The current date and time is {$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}
|
||||
|
||||
The value of global assigned variable $SCRIPT_NAME is {$SCRIPT_NAME}
|
||||
|
||||
Example of accessing server environment variable SERVER_NAME: {$smarty.server.SERVER_NAME}
|
||||
|
||||
The value of {ldelim}$Name{rdelim} is <b>{$Name}</b>
|
||||
|
||||
variable modifier example of {ldelim}$Name|upper{rdelim}
|
||||
|
||||
<b>{$Name|upper}</b>
|
||||
|
||||
|
||||
An example of a section loop:
|
||||
|
||||
{section name=outer loop=$FirstName}
|
||||
{if $smarty.section.outer.index is odd by 2}
|
||||
{$smarty.section.outer.rownum} . {$FirstName[outer]} {$LastName[outer]}
|
||||
{else}
|
||||
{$smarty.section.outer.rownum} * {$FirstName[outer]} {$LastName[outer]}
|
||||
{/if}
|
||||
{sectionelse}
|
||||
none
|
||||
{/section}
|
||||
|
||||
An example of section looped key values:
|
||||
|
||||
{section name=sec1 loop=$contacts}
|
||||
phone: {$contacts[sec1].phone}<br>
|
||||
fax: {$contacts[sec1].fax}<br>
|
||||
cell: {$contacts[sec1].cell}<br>
|
||||
{/section}
|
||||
<p>
|
||||
|
||||
testing strip tags
|
||||
{strip}
|
||||
<table border=0>
|
||||
<tr>
|
||||
<td>
|
||||
<A HREF="{$SCRIPT_NAME}">
|
||||
<font color="red">This is a test </font>
|
||||
</A>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{/strip}
|
||||
|
||||
</PRE>
|
||||
|
||||
This is an example of the html_select_date function:
|
||||
|
||||
<form>
|
||||
{html_select_date start_year=1998 end_year=2010}
|
||||
</form>
|
||||
|
||||
This is an example of the html_select_time function:
|
||||
|
||||
<form>
|
||||
{html_select_time use_24_hours=false}
|
||||
</form>
|
||||
|
||||
This is an example of the html_options function:
|
||||
|
||||
<form>
|
||||
<select name=states>
|
||||
{html_options values=$option_values selected=$option_selected output=$option_output}
|
||||
</select>
|
||||
</form>
|
||||
|
||||
{include file="footer.tpl"}
|
11
trunk/docs/.cvsignore
Normal file
11
trunk/docs/.cvsignore
Normal file
@@ -0,0 +1,11 @@
|
||||
configure
|
||||
Makefile
|
||||
manual.xml
|
||||
config.*
|
||||
*.cache
|
||||
*.fot
|
||||
html
|
||||
phpweb
|
||||
diff
|
||||
revcheck.html
|
||||
manual.pdf
|
75
trunk/docs/Makefile.in
Executable file
75
trunk/docs/Makefile.in
Executable file
@@ -0,0 +1,75 @@
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP Version 5 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997-2004 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 3.0 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available through the world-wide-web at the following url: |
|
||||
# | http://www.php.net/license/3_0.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
all: html
|
||||
|
||||
# {{{ variables
|
||||
|
||||
PHP=@PHP@
|
||||
LANG=@LANG@
|
||||
NSGMLS=@SP_OPTIONS@ @NSGMLS@
|
||||
JADE=@SP_OPTIONS@ @JADE@ -D . -wno-idref
|
||||
XMLLINT=@XMLLINT@
|
||||
FOP=@FOP@
|
||||
XMLDCL=./dtds/dbxml-4.1.2/phpdocxml.dcl
|
||||
CATALOG=@CATALOG@
|
||||
HTML_STYLESHEET=dsssl/html.dsl
|
||||
PHPWEB_STYLESHEET=dsssl/php.dsl
|
||||
|
||||
# }}}
|
||||
|
||||
#default behaviour
|
||||
all:html
|
||||
|
||||
FORCE:
|
||||
|
||||
html: FORCE
|
||||
@test -d html || mkdir html
|
||||
$(JADE) $(CATALOG) -d $(HTML_STYLESHEET) -V use-output-dir -t sgml $(XMLDCL) manual.xml
|
||||
$(PHP) scripts/html_syntax.php html html/
|
||||
|
||||
web: FORCE
|
||||
@test -d phpweb || mkdir phpweb
|
||||
$(JADE) $(CATALOG) -d $(PHPWEB_STYLESHEET) -V use-output-dir -t sgml $(XMLDCL) manual.xml
|
||||
$(PHP) scripts/generate_web.php
|
||||
$(PHP) scripts/html_syntax.php php phpweb/
|
||||
|
||||
pdf: FORCE
|
||||
${FOP} -xml manual.xml -xsl xsl/fo.xsl -pdf manual.pdf
|
||||
|
||||
chm: html FORCE
|
||||
chm/make_chm.bat $(LANG)
|
||||
|
||||
test:
|
||||
$(NSGMLS) -i lang-$(LANG) -s $(XMLDCL) manual.xml
|
||||
|
||||
test_xml:
|
||||
$(XMLLINT) --noent --noout --valid manual.xml
|
||||
|
||||
revcheck: FORCE
|
||||
$(PHP) -f scripts/revcheck.php $(LANG) > revcheck.html
|
||||
|
||||
# {{{ cleanup
|
||||
|
||||
clean:
|
||||
rm -f Makefile config.* manual.xml configure entities/version.ent *.fot dsssl/html-common.dsl manual.pdf
|
||||
rm -f revcheck.html file-entities.php entities/file-entities.ent scripts/file-entities.php manual.fo
|
||||
rm -fr autom4te.cache html phpweb
|
||||
|
||||
# }}}
|
43
trunk/docs/README
Normal file
43
trunk/docs/README
Normal file
@@ -0,0 +1,43 @@
|
||||
This directory contains the documentation for Smarty. All files are in docbook
|
||||
format with an .xml extention. Different subdirs contain different available languages.
|
||||
|
||||
|
||||
NEW BUILD SYSTEM
|
||||
================
|
||||
Firstly issue these commands:
|
||||
1) autoconf
|
||||
2) ./configure --with-lang=xx [DEFAULT=en]
|
||||
|
||||
TEST:
|
||||
* make test
|
||||
* make test_xml (test for XML validity)
|
||||
|
||||
MAKE:
|
||||
* make (to make plain html)
|
||||
* make web (to make docs for website)
|
||||
|
||||
|
||||
Generate PDF files
|
||||
==================
|
||||
In order to generate PDF files you need some tools:
|
||||
* Apache FOP (http://xml.apache.org/fop/)
|
||||
* JRE 1.2 or later
|
||||
|
||||
To generate the file, just type 'make pdf'
|
||||
|
||||
|
||||
Generate CHM files
|
||||
==================
|
||||
In order to generate CHM files you need the Microsoft(r) HTML Help Workshop,
|
||||
which can be freely downloaded at
|
||||
http://msdn.microsoft.com/library/en-us/htmlhelp/html/vsconhh1start.asp
|
||||
|
||||
Then type 'make chm'. This will run the 'make html' and then build the chm file.
|
||||
|
||||
|
||||
Revision Tracking (for translations):
|
||||
* make revcheck (this will create revcheck.html)
|
||||
|
||||
|
||||
You should have libxml and autoconf installed in your system.
|
||||
Read http://doc.php.net/php/dochowto/chapter-tools.php for more info.
|
55
trunk/docs/TODO
Normal file
55
trunk/docs/TODO
Normal file
@@ -0,0 +1,55 @@
|
||||
*normal mode* :
|
||||
- add CDATA sections in all programlistings.
|
||||
- add roles to programlisting (especially role="php") and add PHP tags in PHP examples (short_open_tag is banned). This will help to :
|
||||
-- check parse errors : for i in $(ls |grep xml); do php -d short_open_tag=off -l $i; done
|
||||
|
||||
*pedentic mode* :
|
||||
- fix indenting in all .xml files : don't uses tabs, indent by a space. Here's a nice indentation :
|
||||
|
||||
<para>
|
||||
<example>
|
||||
<title />
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
// ..
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
|
||||
- clean all the examples :
|
||||
(if aggreed) examples should be XHTML compliant and should stick to PEAR's coding standards.
|
||||
|
||||
Here's how a complete example, using PHP and templates, should be written :
|
||||
|
||||
<example>
|
||||
<title>html_image example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
where index.tpl is:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{html_image file="pumpkin.jpg"}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
a possible output would be:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
<img src="pumpkin.jpg" alt="" border="0" width="44" height="68" />
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
3
trunk/docs/chm/.cvsignore
Executable file
3
trunk/docs/chm/.cvsignore
Executable file
@@ -0,0 +1,3 @@
|
||||
*.chm
|
||||
*.hh?
|
||||
fancy
|
97
trunk/docs/chm/README
Executable file
97
trunk/docs/chm/README
Executable file
@@ -0,0 +1,97 @@
|
||||
****************************************************************
|
||||
** This is a modified version of phpdoc/chm **
|
||||
****************************************************************
|
||||
|
||||
BUILDING THE MANUAL IN WINDOWS HELP FILE (.CHM) FORMAT
|
||||
|
||||
Note: Where 'lang' is mentioned in this doc, it is the actual
|
||||
language code (e.g. en) of the manual you are compiling,
|
||||
not the 'lang' word itself!
|
||||
|
||||
With the herein described tools you're able to build the .chm manual
|
||||
with two options:
|
||||
|
||||
a) Simply build the traditional html manual
|
||||
b) Make a fancy version of the html manual and build it
|
||||
|
||||
=======================================================================
|
||||
WHAT YOU NEED
|
||||
|
||||
* Microsoft(r) HTML Help Workshop.
|
||||
You can download it freely at:
|
||||
http://msdn.microsoft.com/library/en-us/htmlhelp/html/vsconhh1start.asp
|
||||
You need the complete workshop package install (about 4 Megs).
|
||||
Of course you need Microsoft(r) Windows to run that software :)
|
||||
|
||||
* The html manual (build with 'make')
|
||||
|
||||
The .chm manual generator files (from cvs.php.net):
|
||||
|
||||
make_chm.bat - The only file you need to run yourself.
|
||||
make_chm.php - Auto toc generator.
|
||||
|
||||
To make the fancy manual, additional files are needed:
|
||||
|
||||
make_chm_fancy.php - Converts the normal html files to fancy
|
||||
(good looking) pages
|
||||
make_chm_index_lang.html - Fancy index. (you find it in phpdoc/lang
|
||||
dir, if it exists for that language).
|
||||
make_chm_spc.gif - GIF file needed by the fancy pages.
|
||||
make_chm_style.css - This adds some good style to html files.
|
||||
|
||||
=======================================================================
|
||||
INSTALLATION
|
||||
|
||||
Install Microsoft(r) HTML Help Workshop.
|
||||
|
||||
Put the above listed make_chm_* files to one directory.
|
||||
|
||||
Open make_chm.bat in a text editor and set the appropriate
|
||||
environment variables. You need to
|
||||
|
||||
- set PHP_PATH to the full path of the CGI php.exe on
|
||||
your machine (including php.exe).
|
||||
- set PHP_HELP_COMPILER to the full path of hhc.exe on
|
||||
your machine (including hhc.exe).
|
||||
- set PHP_HELP_COMPILE_LANG to the language code of the
|
||||
actual manual (use the code from cvs.php.net, eg. hu)
|
||||
- set PHP_HELP_COMPILE_DIR to the directory of the
|
||||
html manual (eg. ..\html when you build it like mentioned in the howto)
|
||||
- set PHP_HELP_COMPILE_INDEX to the index filename in
|
||||
the directory you set above. This used to be manual.html
|
||||
for a long time, but it seems it is now index.html.
|
||||
|
||||
The following variable is only needed for the fancy manual:
|
||||
|
||||
- set PHP_HELP_COMPILE_FANCYDIR to the directory name where
|
||||
the fancy pages will go.
|
||||
You can decide not to sacrifice any more space for the fancy dir
|
||||
(it takes ~25% more space than the normal html-manual), and set
|
||||
this variable to the same as PHP_HELP_COMPILE_DIR. Then your old
|
||||
HTML files will be rewritten to be fancy ones.
|
||||
|
||||
=======================================================================
|
||||
BUILDING THE MANUAL:
|
||||
|
||||
Put the html manual (~2100 files) under the subdir specified above in
|
||||
PHP_HELP_COMPILE_DIR (eg. html).
|
||||
|
||||
To compile the NORMAL manual, use the 'normal' command line option:
|
||||
|
||||
make_chm normal
|
||||
|
||||
To compile the FANCY manual, just run:
|
||||
|
||||
make_chm
|
||||
|
||||
After this process, you will have smarty_manual_lang.chm...
|
||||
|
||||
=======================================================================
|
||||
The fancy design improvemenets and the .css file is based on
|
||||
the newsite design(TM) work of Colin Viebrock [colin@easyDNS.com] :)
|
||||
|
||||
Written by Gabor Hojtsy (goba@php.net), and adapted by
|
||||
Thomas Schoefbeck (tom@php.net). Contact them or the phpdoc list
|
||||
(phpdoc@lists.php.net) if you have any questions or suggestions...
|
||||
|
||||
Last modified $Date$
|
157
trunk/docs/chm/chm_settings.php
Executable file
157
trunk/docs/chm/chm_settings.php
Executable file
@@ -0,0 +1,157 @@
|
||||
<?php
|
||||
$DEFAULT_FONT = "Arial,10,0";
|
||||
|
||||
// Array to manual code -> HTML Help Code conversion
|
||||
// Code list: http://www.helpware.net/htmlhelp/hh_info.htm
|
||||
// Charset list: http://www.microsoft.com/globaldev/nlsweb/default.asp
|
||||
// Language code: http://www.unicode.org/unicode/onlinedat/languages.html
|
||||
// MIME preferred charset list: http://www.iana.org/assignments/character-sets
|
||||
// Font list: http://www.microsoft.com/office/ork/xp/three/inte03.htm
|
||||
|
||||
$LANGUAGES = array(
|
||||
"hk" => array(
|
||||
"langcode" => "0xc04 Hong Kong Cantonese",
|
||||
"preferred_charset" => "CP950",
|
||||
"mime_charset_name" => "Big5",
|
||||
"preferred_font" => "MingLiu,10,0"
|
||||
),
|
||||
"tw" => array(
|
||||
"langcode" => "0x404 Traditional Chinese",
|
||||
"preferred_charset" => "CP950",
|
||||
"mime_charset_name" => "Big5",
|
||||
"preferred_font" => "MingLiu,10,0"
|
||||
),
|
||||
"cs" => array(
|
||||
"langcode" => "0x405 Czech",
|
||||
"preferred_charset" => "Windows-1250",
|
||||
"mime_charset_name" => "Windows-1250",
|
||||
"preferred_font" => $DEFAULT_FONT,
|
||||
),
|
||||
"da" => array(
|
||||
"langcode" => "0x406 Danish",
|
||||
"preferred_charset" => "Windows-1252",
|
||||
"mime_charset_name" => "Windows-1252",
|
||||
"preferred_font" => $DEFAULT_FONT,
|
||||
),
|
||||
"de" => array(
|
||||
"langcode" => "0x407 German (Germany)",
|
||||
"preferred_charset" => "Windows-1252",
|
||||
"mime_charset_name" => "Windows-1252",
|
||||
"preferred_font" => $DEFAULT_FONT,
|
||||
),
|
||||
"el" => array(
|
||||
"langcode" => "0x408 Greek",
|
||||
"preferred_charset" => "Windows-1253",
|
||||
"mime_charset_name" => "Windows-1253",
|
||||
"preferred_font" => $DEFAULT_FONT
|
||||
),
|
||||
"en" => array(
|
||||
"langcode" => "0x809 English (United Kingdom)",
|
||||
"preferred_charset" => "Windows-1252",
|
||||
"mime_charset_name" => "Windows-1252",
|
||||
"preferred_font" => $DEFAULT_FONT
|
||||
),
|
||||
"es" => array(
|
||||
"langcode" => "0xc0a Spanish (International Sort)",
|
||||
"preferred_charset" => "Windows-1252",
|
||||
"mime_charset_name" => "Windows-1252",
|
||||
"preferred_font" => $DEFAULT_FONT
|
||||
),
|
||||
"fr" => array(
|
||||
"langcode" => "0x40c French (France)",
|
||||
"preferred_charset" => "Windows-1252",
|
||||
"mime_charset_name" => "Windows-1252",
|
||||
"preferred_font" => $DEFAULT_FONT
|
||||
),
|
||||
"fi" => array(
|
||||
"langcode" => "0x40b Finnish",
|
||||
"preferred_charset" => "Windows-1252",
|
||||
"mime_charset_name" => "Windows-1252",
|
||||
"preferred_font" => $DEFAULT_FONT
|
||||
),
|
||||
"he" => array(
|
||||
"langcode" => "0x40d Hebrew",
|
||||
"preferred_charset" => "Windows-1255",
|
||||
"mime_charset_name" => "Windows-1255",
|
||||
"preferred_font" => $DEFAULT_FONT
|
||||
),
|
||||
"hu" => array(
|
||||
"langcode" => "0x40e Hungarian",
|
||||
"preferred_charset" => "Windows-1250",
|
||||
"mime_charset_name" => "Windows-1250",
|
||||
"preferred_font" => $DEFAULT_FONT
|
||||
),
|
||||
"it" => array(
|
||||
"langcode" => "0x410 Italian (Italy)",
|
||||
"preferred_charset" => "Windows-1252",
|
||||
"mime_charset_name" => "Windows-1252",
|
||||
"preferred_font" => $DEFAULT_FONT
|
||||
),
|
||||
"ja" => array(
|
||||
"langcode" => "0x411 Japanese",
|
||||
"preferred_charset" => "CP932",
|
||||
"mime_charset_name" => "csWindows31J",
|
||||
"preferred_font" => "MS PGothic,10,0"
|
||||
),
|
||||
"kr" => array(
|
||||
"langcode" => "0x412 Korean",
|
||||
"preferred_charset" => "CP949",
|
||||
"mime_charset_name" => "EUC-KR",
|
||||
"preferred_font" => "Gulim,10,0"
|
||||
),
|
||||
"nl" => array(
|
||||
"langcode" => "0x413 Dutch (Netherlands)",
|
||||
"preferred_charset" => "Windows-1252",
|
||||
"mime_charset_name" => "Windows-1252",
|
||||
"preferred_font" => $DEFAULT_FONT
|
||||
),
|
||||
"pl" => array(
|
||||
"langcode" => "0x415 Polish",
|
||||
"preferred_charset" => "Windows-1250",
|
||||
"mime_charset_name" => "Windows-1250",
|
||||
"preferred_font" => $DEFAULT_FONT
|
||||
),
|
||||
"pt_BR" => array(
|
||||
"langcode" => "0x416 Portuguese (Brazil)",
|
||||
"preferred_charset" => "Windows-1252",
|
||||
"mime_charset_name" => "Windows-1252",
|
||||
"preferred_font" => $DEFAULT_FONT
|
||||
),
|
||||
"ro" => array(
|
||||
"langcode" => "0x418 Romanian",
|
||||
"preferred_charset" => "Windows-1250",
|
||||
"mime_charset_name" => "Windows-1250",
|
||||
"preferred_font" => $DEFAULT_FONT
|
||||
),
|
||||
"ru" => array(
|
||||
"langcode" => "0x419 Russian",
|
||||
"preferred_charset" => "Windows-1251",
|
||||
"mime_charset_name" => "Windows-1251",
|
||||
"preferred_font" => $DEFAULT_FONT
|
||||
),
|
||||
"sk" => array(
|
||||
"langcode" => "0x41b Slovak",
|
||||
"preferred_charset" => "Windows-1250",
|
||||
"mime_charset_name" => "Windows-1250",
|
||||
"preferred_font" => $DEFAULT_FONT
|
||||
),
|
||||
"sl" => array(
|
||||
"langcode" => "0x424 Slovenian",
|
||||
"preferred_charset" => "Windows-1250",
|
||||
"mime_charset_name" => "Windows-1250",
|
||||
"preferred_font" => $DEFAULT_FONT
|
||||
),
|
||||
"sv" => array(
|
||||
"langcode" => "0x41d Swedish",
|
||||
"preferred_charset" => "Windows-1252",
|
||||
"mime_charset_name" => "Windows-1252",
|
||||
"preferred_font" => $DEFAULT_FONT
|
||||
),
|
||||
"zh" => array(
|
||||
"langcode" => "0x804 Simplified Chinese",
|
||||
"preferred_charset" => "CP936",
|
||||
"mime_charset_name" => "gb2312",
|
||||
"preferred_font" => "simsun,10,0"
|
||||
)
|
||||
);
|
||||
?>
|
75
trunk/docs/chm/common.php
Executable file
75
trunk/docs/chm/common.php
Executable file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
// Used directories and files
|
||||
$HTML_PATH = getenv("PHP_HELP_COMPILE_DIR");
|
||||
$FANCY_PATH = getenv("PHP_HELP_COMPILE_FANCYDIR");
|
||||
$LANGUAGE = getenv("PHP_HELP_COMPILE_LANG");
|
||||
$INTERNAL_CHARSET = "UTF-8";
|
||||
|
||||
// Return a file joined on one line
|
||||
function oneLiner($filename, $only_tags = false)
|
||||
{
|
||||
global $INTERNAL_CHARSET;
|
||||
|
||||
if ($only_tags) {
|
||||
$buf = @preg_replace("/<([a-zA-Z1-9]+)(>|[^a-zA-Z1-9][^>]*>)/Ue", "preg_replace('/[\r\n]{1,2}/U', ' ', \"<\$1 \$2\")", file_get_contents($filename));
|
||||
} else {
|
||||
$buf = preg_replace("/[\r|\n]{1,2}/U", " ", file_get_contents($filename));
|
||||
}
|
||||
$charset = detectDocumentCharset($buf);
|
||||
|
||||
if ($charset === false) $charset = "UTF-8";
|
||||
|
||||
if ($charset != $INTERNAL_CHARSET) {
|
||||
if (function_exists("iconv")) {
|
||||
$buf = iconv($charset, $INTERNAL_CHARSET, $buf);
|
||||
} elseif (function_exists("mb_convert_encoding")) {
|
||||
$buf = mb_convert_encoding($buf, $INTERNAL_CHARSET, $charset);
|
||||
} elseif (preg_match("/^UTF-?8$/i", $INTERNAL_CHARSET) && preg_match("/^(ISO-8859-1|WINDOWS-1252)$/i", $charset)) {
|
||||
$buf = utf8_encode($buf);
|
||||
} else {
|
||||
die("charset conversion function is not available.");
|
||||
}
|
||||
}
|
||||
return $buf;
|
||||
}
|
||||
|
||||
function fputs_wrapper($fp, $str)
|
||||
{
|
||||
fputs($fp, convertCharset($str));
|
||||
}
|
||||
|
||||
function convertCharset($buf)
|
||||
{
|
||||
global $LANGUAGE, $LANGUAGES, $INTERNAL_CHARSET;
|
||||
|
||||
$charset = $LANGUAGES[$LANGUAGE]['preferred_charset'];
|
||||
|
||||
if ($charset != $INTERNAL_CHARSET) {
|
||||
if (function_exists("iconv")) {
|
||||
$buf = iconv($INTERNAL_CHARSET, "$charset//TRANSLIT", $buf);
|
||||
} elseif (function_exists("mb_convert_encoding")) {
|
||||
$buf = mb_convert_encoding($buf, $charset, $INTERNAL_CHARSET);
|
||||
} elseif (preg_match("/^UTF-?8$/i", $INTERNAL_CHARSET) && preg_match("/^(ISO-8859-1|WINDOWS-1252)$/i", $charset)) {
|
||||
$buf = utf8_decode($buf);
|
||||
} else {
|
||||
die("$LANGUAGE locale is not supported.");
|
||||
}
|
||||
}
|
||||
return $buf;
|
||||
} // oneLiner() function end
|
||||
|
||||
// Returns the name of character set in the given document
|
||||
function detectDocumentCharset($doc)
|
||||
{
|
||||
if (preg_match('/<META[^>]+CHARSET=["\'\s]?([\w\d-]+)["\'\s]?\s*>/iS', $doc, $reg)) {
|
||||
return $reg[1];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function setDocumentCharset($doc, $charset)
|
||||
{
|
||||
return preg_replace("/(<META\\s+HTTP-EQUIV=\"CONTENT-TYPE\"\\s+CONTENT=\"TEXT\\/HTML;\\s+CHARSET=)([\\w\\d-]*)(\"\\s*>)/iU", "\$1$charset\$3", $doc);
|
||||
}
|
||||
?>
|
||||
|
54
trunk/docs/chm/make_chm.bat
Executable file
54
trunk/docs/chm/make_chm.bat
Executable file
@@ -0,0 +1,54 @@
|
||||
@echo off
|
||||
|
||||
rem !! Please read the make_chm.README file for information
|
||||
rem !! about how to build a "php_manual_lang.chm" file.
|
||||
|
||||
rem Path of the PHP executable
|
||||
set PHP_PATH=php
|
||||
|
||||
rem Path of the Help Compiler command line tool
|
||||
set PHP_HELP_COMPILER=C:\progra~1\htmlhe~1\hhc.exe
|
||||
|
||||
rem The source directory with the original DSSSL made HTML
|
||||
set PHP_HELP_COMPILE_DIR=html
|
||||
|
||||
rem The directory, where the fancy files need to be copied
|
||||
set PHP_HELP_COMPILE_FANCYDIR=chm\fancy
|
||||
|
||||
rem ==========================================================
|
||||
rem !!!!! DO NOT MODIFY ANYTHING BELOW THIS LINE !!!!!
|
||||
rem ==========================================================
|
||||
|
||||
echo.
|
||||
|
||||
set PHP_HELP_COMPILE_LANG=%1
|
||||
if "%1" == "" set PHP_HELP_COMPILE_LANG=en
|
||||
|
||||
echo Language choosen: %PHP_HELP_COMPILE_LANG%
|
||||
|
||||
if a%2a == anormala goto skipfancy
|
||||
|
||||
echo Now generating the fancy manual in %PHP_HELP_COMPILE_FANCYDIR% dir...
|
||||
IF NOT EXIST %PHP_HELP_COMPILE_FANCYDIR%\NUL md %PHP_HELP_COMPILE_FANCYDIR%
|
||||
%PHP_PATH% chm\make_chm_fancy.php
|
||||
|
||||
goto normal
|
||||
|
||||
:skipfancy
|
||||
set PHP_HELP_COMPILE_FANCYDIR=
|
||||
echo Skipping fancy manual generation...
|
||||
|
||||
:normal
|
||||
|
||||
echo Now running the toc and project file generator script...
|
||||
%PHP_PATH% chm\make_chm.php
|
||||
|
||||
echo Compiling the actual helpfile (smarty_manual_%PHP_HELP_COMPILE_LANG%.chm)...
|
||||
%PHP_HELP_COMPILER% chm\smarty_manual_%PHP_HELP_COMPILE_LANG%.hhp
|
||||
|
||||
echo.
|
||||
echo Cleaning up the directory
|
||||
del chm\smarty_manual_%PHP_HELP_COMPILE_LANG%.hh?
|
||||
|
||||
echo Done!
|
||||
echo.
|
219
trunk/docs/chm/make_chm.php
Executable file
219
trunk/docs/chm/make_chm.php
Executable file
@@ -0,0 +1,219 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
PLEASE DO NOT MAKE ANY MAJOR MODIFICATIONS TO THIS CODE!
|
||||
There is a new script collection on the way to replace
|
||||
these scripts. Please see the htmlhelp folder for the new
|
||||
build system.
|
||||
|
||||
See make_chm.README for information about this system.
|
||||
*/
|
||||
|
||||
include_once('common.php');
|
||||
include_once('chm_settings.php');
|
||||
|
||||
$INDEX_IN_HTML = "index.html";
|
||||
|
||||
if (empty($FANCY_PATH)) { $FANCY_PATH = $HTML_PATH; }
|
||||
|
||||
// Files on the top level of the TOC
|
||||
$MAIN_FILES = array(
|
||||
'getting.started.html',
|
||||
'smarty.for.designers.html',
|
||||
'smarty.for.programmers.html',
|
||||
'appendixes.html'
|
||||
);
|
||||
|
||||
// Header for index and toc
|
||||
$HEADER = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta name="generator" content="PHP 4 - Auto TOC script">
|
||||
<!-- Sitemap 1.0 -->
|
||||
</head>
|
||||
<body>
|
||||
<object type="text/site properties">
|
||||
<param name="Window Styles" value="0x800227">
|
||||
</object>
|
||||
<ul>';
|
||||
|
||||
makeProjectFile();
|
||||
makeContentFiles();
|
||||
|
||||
// Generate the HTML Help content files
|
||||
function makeContentFiles()
|
||||
{
|
||||
global $LANGUAGE, $MANUAL_TITLE, $HEADER, $MAIN_FILES,
|
||||
$HTML_PATH, $INDEX_IN_HTML, $FIRST_PAGE;
|
||||
|
||||
$toc = fopen("chm/smarty_manual_$LANGUAGE.hhc", "w");
|
||||
$index = fopen("chm/smarty_manual_$LANGUAGE.hhk", "w");
|
||||
|
||||
// Write out file headers
|
||||
fputs_wrapper($toc, $HEADER);
|
||||
fputs_wrapper($index, $HEADER);
|
||||
|
||||
// Read original index file and drop out newlines
|
||||
$indexline = oneLiner("$HTML_PATH/$INDEX_IN_HTML");
|
||||
|
||||
// Print out the objects, autoparsing won't find
|
||||
mapAndIndex($MANUAL_TITLE, $FIRST_PAGE, " ", $toc, $index, 21);
|
||||
|
||||
// There is a fancy index
|
||||
if ($FIRST_PAGE != $INDEX_IN_HTML) {
|
||||
|
||||
// Find the name of the Table of Contents
|
||||
preg_match('|CLASS=\"TOC\" *><DL *><DT *><B *>(.*)</B|U', $indexline, $match);
|
||||
if (empty($match[1])) { // Fallback
|
||||
$match[1] = "Table of Contents";
|
||||
}
|
||||
mapAndIndex($match[1], $INDEX_IN_HTML, " ", $toc, $index, 21);
|
||||
|
||||
}
|
||||
|
||||
// Find the name of the Preface
|
||||
preg_match('|<A +HREF="preface.html" *>([^<]*)</A *>|U', $indexline, $match);
|
||||
if (empty($match[1])) { // Fallback
|
||||
$match[1] = "Preface";
|
||||
}
|
||||
mapAndIndex($match[1], "preface.html", " ", $toc, $index);
|
||||
|
||||
// Now autofind the main pages
|
||||
$MAIN_REGEXP = join("|", $MAIN_FILES);
|
||||
|
||||
preg_match_all("![IVX]+\. <A\\s+HREF=\"($MAIN_REGEXP)\"\\s*>([^<]+)</A\\s*>.*</DT\\s*></DL\\s*>(?:</DD\\s*></DL\\s*>)?(?:</DD\\s*><DT\\s*>[IVX]|</DIV)!Ui", $indexline, $matches, PREG_SET_ORDER);
|
||||
|
||||
// Go through the main files, and link in subpages
|
||||
foreach ($matches as $matchinfo) {
|
||||
mapAndIndex($matchinfo[2], $matchinfo[1], " ", $toc, $index);
|
||||
|
||||
fputs_wrapper($toc, "\n <ul>\n");
|
||||
preg_match_all('!\d+\. <A\\s+HREF="([^"]+)"\\s*>([^<]*)</A\\s*>!iSU', $matchinfo[0], $subpages, PREG_SET_ORDER);
|
||||
|
||||
foreach ($subpages as $spinfo) {
|
||||
mapAndIndex($spinfo[2], $spinfo[1], " ", $toc, $index);
|
||||
findDeeperLinks($spinfo[1], $toc, $index);
|
||||
}
|
||||
fputs_wrapper($toc, "\n </ul>\n");
|
||||
}
|
||||
|
||||
// Write out closing line, and end files
|
||||
fputs_wrapper($index, " </ul>\n</body>\n</html>");
|
||||
fputs_wrapper($toc, " </ul>\n</body>\n</html>");
|
||||
fclose($index);
|
||||
fclose($toc);
|
||||
} // makeContentfiles() function end
|
||||
|
||||
// Generates the HTML Help project file
|
||||
function makeProjectFile()
|
||||
{
|
||||
global $LANGUAGE, $MANUAL_TITLE, $LANGUAGES,
|
||||
$HTML_PATH, $FANCY_PATH, $INDEX_IN_HTML,
|
||||
$FIRST_PAGE;
|
||||
|
||||
// Try to find the fancy index file
|
||||
if (file_exists("$FANCY_PATH/fancy-index.html")) {
|
||||
$FIRST_PAGE = 'fancy-index.html';
|
||||
} else {
|
||||
$FIRST_PAGE = $INDEX_IN_HTML;
|
||||
}
|
||||
|
||||
$FIRST_PAGEP = substr($FANCY_PATH, 4) . "\\$FIRST_PAGE";
|
||||
|
||||
// Start writing the project file
|
||||
$project = fopen("chm/smarty_manual_$LANGUAGE.hhp", "w");
|
||||
fputs_wrapper($project, "[OPTIONS]\n");
|
||||
fputs_wrapper($project, "Compatibility=1.1 or later\n");
|
||||
fputs_wrapper($project, "Compiled file=smarty_manual_$LANGUAGE.chm\n");
|
||||
fputs_wrapper($project, "Contents file=smarty_manual_$LANGUAGE.hhc\n");
|
||||
fputs_wrapper($project, "Index file=smarty_manual_$LANGUAGE.hhk\n");
|
||||
fputs_wrapper($project, "Default Window=smarty\n");
|
||||
fputs_wrapper($project, "Default topic=$FIRST_PAGEP\n");
|
||||
fputs_wrapper($project, "Display compile progress=Yes\n");
|
||||
fputs_wrapper($project, "Full-text search=Yes\n");
|
||||
|
||||
// Get the proper language code from the array
|
||||
fputs_wrapper($project, "Language={$LANGUAGES[$LANGUAGE]["langcode"]}\n");
|
||||
|
||||
// Now try to find out how the manual named in the actual language
|
||||
// this must be in the index.html file as the title (DSSSL generated)
|
||||
$content = oneLiner("$HTML_PATH/$INDEX_IN_HTML");
|
||||
if (preg_match("|<TITLE\s*>([^<]*)</TITLE\s*>|U", $content, $found)) {
|
||||
$MANUAL_TITLE = $found[1];
|
||||
} else { // Fallback
|
||||
$MANUAL_TITLE = "Smarty Manual";
|
||||
}
|
||||
|
||||
fputs_wrapper($project, "Title=$MANUAL_TITLE\n");
|
||||
fputs_wrapper($project, "Default Font={$LANGUAGES[$LANGUAGE]['preferred_font']}\n");
|
||||
|
||||
// Define the phpdoc window style (adds more functionality)
|
||||
fputs_wrapper($project, "\n[WINDOWS]\nsmarty=\"$MANUAL_TITLE\",\"smarty_manual_$LANGUAGE.hhc\",\"smarty_manual_$LANGUAGE.hhk\"," .
|
||||
"\"$FIRST_PAGEP\",\"$FIRST_PAGEP\",,,,,0x23520,,0x386e,,,,,,,,0\n");
|
||||
|
||||
// Write out all the filenames as in FANCY_PATH
|
||||
fputs_wrapper($project, "\n[FILES]\n");
|
||||
$handle = opendir($FANCY_PATH);
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file != "." && $file != "..") {
|
||||
fputs_wrapper($project, substr($FANCY_PATH, 4)."\\$file\n");
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
fclose($project);
|
||||
} // makeProjectFile() function end
|
||||
|
||||
// Print out a SiteMap object for a file
|
||||
function mapAndIndex($name, $local, $tabs, $toc, $index, $imgnum = "auto")
|
||||
{
|
||||
global $FANCY_PATH;
|
||||
$name = str_replace('"', '"', $name);
|
||||
|
||||
fputs_wrapper($toc, "
|
||||
$tabs<li><object type=\"text/sitemap\">
|
||||
$tabs <param name=\"Name\" value=\"$name\">
|
||||
$tabs <param name=\"Local\" value=\"".substr($FANCY_PATH, 4)."\\$local\">
|
||||
");
|
||||
|
||||
if ($imgnum != "auto") {
|
||||
fputs_wrapper($toc, "$tabs <param name=\"ImageNumber\" value=\"$imgnum\">\r\n");
|
||||
}
|
||||
fputs_wrapper($toc, "$tabs </object>\r\n");
|
||||
|
||||
fputs_wrapper($index, "
|
||||
<li><object type=\"text/sitemap\">
|
||||
<param name=\"Local\" value=\"".substr($FANCY_PATH, 4)."\\$local\">
|
||||
<param name=\"Name\" value=\"$name\">
|
||||
</object></li>
|
||||
");
|
||||
|
||||
} // mapAndIndex() function end
|
||||
|
||||
|
||||
// Process a file, and find any links need to be presented in tree
|
||||
function findDeeperLinks ($filename, $toc, $index)
|
||||
{
|
||||
global $HTML_PATH;
|
||||
$contents = oneLiner("$HTML_PATH/$filename");
|
||||
|
||||
// Find all sublinks
|
||||
if (preg_match_all("!<DT\\s*><A\\s+HREF=\"(([\\w\\.-]+\\.)+html)(\\#[\\w\\.-]+)?\"\\s*>([^<]*)</A\\s*>!U", $contents, $matches, PREG_SET_ORDER)) {
|
||||
|
||||
// Print out the file informations for all the links
|
||||
fputs_wrapper($toc, "\n <ul>");
|
||||
foreach ($matches as $onematch) {
|
||||
$param["html"] = $onematch[1];
|
||||
if (!empty($onematch[3])) {
|
||||
$param["html"] .= $onematch[3];
|
||||
}
|
||||
$param["title"] = strip_tags($onematch[4]);
|
||||
mapAndIndex($param["title"], $param["html"], " ", $toc, $index);
|
||||
}
|
||||
fputs_wrapper($toc, " </ul>\n");
|
||||
|
||||
} else {
|
||||
echo "no deeper TOC info found in $filename\n";
|
||||
}
|
||||
|
||||
} // findDeeperLinks() function end
|
||||
?>
|
131
trunk/docs/chm/make_chm_fancy.php
Executable file
131
trunk/docs/chm/make_chm_fancy.php
Executable file
@@ -0,0 +1,131 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
PLEASE DO NOT MAKE ANY MAJOR MODIFICATIONS TO THIS CODE!
|
||||
There is a new script collection on the way to replace
|
||||
these scripts. Please be patient while it will be ready
|
||||
to put here in CVS.
|
||||
*/
|
||||
|
||||
include_once('common.php');
|
||||
include_once('chm_settings.php');
|
||||
|
||||
// This script takes much time to run
|
||||
set_time_limit(0);
|
||||
|
||||
// Get ENV vars from the system
|
||||
$original_index = "index.html";
|
||||
|
||||
// How many files were processed
|
||||
$counter = 0;
|
||||
|
||||
// Open the directory, and do the work on all HTML files
|
||||
$handle = opendir($HTML_PATH);
|
||||
while (false !== ($filename = readdir($handle))) {
|
||||
if (strpos($filename, ".html") && ($filename != "fancy-index.html")) {
|
||||
fancy_design($filename);
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
|
||||
// Look for CHM index file (snap-downloader, cvs-usr with/without lang-support)
|
||||
if (false == ($content = oneLiner("$LANGUAGE/make_chm_index.html", true))) {
|
||||
$content = oneLiner("en/make_chm_index.html", true);
|
||||
}
|
||||
|
||||
// Make GENTIME the actual date/time
|
||||
$content = str_replace("[GENTIME]", date("D M d H:i:s Y"), $content);
|
||||
$content = str_replace("[PUBTIME]", $publication_date, $content);
|
||||
$content = setDocumentCharset($content, $LANGUAGES[$LANGUAGE]['mime_charset_name']);
|
||||
$fp = fopen("$FANCY_PATH/fancy-index.html", "w");
|
||||
fputs_wrapper($fp, $content);
|
||||
fclose($fp);
|
||||
|
||||
copy("chm/make_chm_style.css", "$FANCY_PATH/style.css");
|
||||
copy("chm/make_chm_spc.gif", "$FANCY_PATH/spacer.gif");
|
||||
|
||||
// Three files added (fancy-index.html, style.css and spacer.gif)
|
||||
$counter += 3;
|
||||
|
||||
echo "\nConverting ready...\n";
|
||||
echo "Total number of files written in $FANCY_PATH directory: $counter\n\n";
|
||||
|
||||
/***********************************************************************/
|
||||
/* End of script lines, one main function follows */
|
||||
/***********************************************************************/
|
||||
|
||||
// Convert one file from HTML => fancy HTML
|
||||
function fancy_design($fname)
|
||||
{
|
||||
global $HTML_PATH, $FANCY_PATH, $LANGUAGE, $LANGUAGES, $counter, $original_index, $publication_date;
|
||||
|
||||
// Get the contents of the file from $HTML_PATH
|
||||
$content = oneLiner("$HTML_PATH/$fname", true);
|
||||
|
||||
// CSS file linking
|
||||
$content = preg_replace("|</HEAD|", '<LINK REL="stylesheet" HREF="style.css"></HEAD', $content);
|
||||
|
||||
// No margins around
|
||||
$content = preg_replace("/<BODY/", '<BODY TOPMARGIN="0" LEFTMARGIN="0"', $content);
|
||||
|
||||
// HR dropout
|
||||
$content = preg_replace("/<HR\\s+ALIGN=\"LEFT\"\\s+WIDTH=\"100%\">/", '', $content);
|
||||
|
||||
// Whole page table and backgrounds
|
||||
$wpbegin = '<TABLE BORDER="0" WIDTH="100%" HEIGHT="100%" CELLSPACING="0" CELLPADDING="0"><TR><TD COLSPAN="3">';
|
||||
$bnavt = '<TABLE BGCOLOR="#CCCCFF" BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%">';
|
||||
$lnavt = '<TR BGCOLOR="#333366"><TD><IMG SRC="spacer.gif" BORDER="0" WIDTH="1" HEIGHT="1"><BR></TD></TR>';
|
||||
$space = '<IMG SRC="spacer.gif" WIDTH="10" HEIGHT="1">';
|
||||
|
||||
// Navheader backgound
|
||||
$content = preg_replace("/<DIV\\s+CLASS=\"NAVHEADER\"\\s*><TABLE(.*)CELLPADDING=\"0\"(.*)<\\/TABLE\\s*><\\/DIV\\s*>/Us",
|
||||
$wpbegin . '<DIV CLASS="NAVHEADER">' . $bnavt . '<TR><TD><TABLE\\1CELLPADDING="3"\\2</TABLE></TD></TR>' . $lnavt . '</TABLE></DIV></TD></TR><TR><TD>' . $space . '</TD><TD HEIGHT="100%" VALIGN="TOP" WIDTH="100%"><BR>', $content);
|
||||
|
||||
// Navfooter backgound
|
||||
$content = preg_replace("/<DIV\\s+CLASS=\"NAVFOOTER\"\\s*><TABLE(.*)CELLPADDING=\"0\"(.*)<\\/TABLE\\s*><\\/DIV\\s*>/Us",
|
||||
'<BR></TD><TD>' . $space . '</TD></TR><TR><TD COLSPAN="3"><DIV CLASS="NAVFOOTER">' . $bnavt . $lnavt . '<TR><TD><TABLE\\1CELLPADDING="3"\\2</TABLE></TD></TR></TABLE></DIV></TD></TR></TABLE>', $content);
|
||||
|
||||
// Fix copyright page fault...
|
||||
if ($fname == "copyright.html") {
|
||||
$content = preg_replace("/&copy;/", "©", $content);
|
||||
$content = preg_replace("/<A\\s+HREF=\"$original_index#(authors|translators)\"/U", "<A HREF=\"fancy-index.html\"", $content);
|
||||
$content = preg_replace("|(</TH\\s*></TR\\s*>)|", "\\1<TR><TH COLSPAN=\"3\" ALIGN=\"center\"> </TH></TR>", $content);
|
||||
$content = preg_replace("|( </TD\\s*></TR\\s*>)|", "\\1<TR><TD COLSPAN=\"3\" ALIGN=\"center\"> </TD></TR>", $content);
|
||||
}
|
||||
|
||||
// Fix the original manual index to look far better...
|
||||
elseif ($fname == "$original_index") {
|
||||
|
||||
// Find out manual generation date
|
||||
if (preg_match('|<P\s+CLASS="pubdate"\s*>([\\d-]+)<BR></P\s*>|U', $content, $match)) {
|
||||
$publication_date = $match[1];
|
||||
} else {
|
||||
$publication_date = 'n/a';
|
||||
}
|
||||
|
||||
// Modify the index file to meet our needs
|
||||
preg_match('|CLASS=\"title\"\\s*><A\\s+NAME=\"manual\"\\s*>(.*)</A\\s*>(.*)</H1|U', $content, $match);
|
||||
$indexchange = '<TABLE BORDER="0" WIDTH="100%" HEIGHT="100%" CELLSPACING="0" CELLPADDING="0"><TR><TD COLSPAN="3"><DIV CLASS="NAVHEADER"><TABLE BGCOLOR="#CCCCFF" BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%"><TR><TD><TABLE
|
||||
WIDTH="100%" BORDER="0" CELLPADDING="3" CELLSPACING="0"><TR><TH COLSPAN="3">'.$match[2].'</TH></TR><TR><TD COLSPAN="3" ALIGN="center"> </TD></TR></TABLE></TD></TR><TR BGCOLOR="#333366"><TD><IMG SRC="spacer.gif" BORDER="0" WIDTH="1" HEIGHT="1"><BR></TD></TR></TABLE>
|
||||
</DIV></TD></TR><TR><TD><IMG SRC="spacer.gif" WIDTH="10" HEIGHT="1"></TD><TD HEIGHT="100%" VALIGN="TOP" WIDTH="100%"><BR>';
|
||||
$content = preg_replace("/(<DIV\\s+CLASS=\"BOOK\")/", "$indexchange\\1", $content);
|
||||
$content = preg_replace("/(<DIV\\s+CLASS=\"author\").*<HR>/Us", "", $content);
|
||||
preg_match('|<DIV\\s+CLASS="TOC"\\s*><DL\\s*><DT\\s*><B\\s*>(.*)</B\\s*>|U', $content, $match);
|
||||
$content = preg_replace("|(CLASS=\"title\"\\s+><A\\s+NAME=\"manual\"\\s*>).*(</A\\s*>).*(</H1)|U", "\\1$match[1]\\2\\3", $content);
|
||||
$content = preg_replace("|<DT\\s*><B\\s*>(.*)</B\\s*></DT\\s*>|U", "", $content);
|
||||
|
||||
}
|
||||
|
||||
// Print out that new file to $FANCY_PATH
|
||||
$fp = fopen("$FANCY_PATH/$fname", "w");
|
||||
$content = setDocumentCharset($content, $LANGUAGES[$LANGUAGE]['mime_charset_name']);
|
||||
fputs_wrapper($fp, $content);
|
||||
fclose($fp);
|
||||
|
||||
// Print out a message to see the progress
|
||||
echo "$FANCY_PATH/$fname ready...\n";
|
||||
$counter++;
|
||||
|
||||
} // fancy_design() function end
|
||||
|
||||
?>
|
BIN
trunk/docs/chm/make_chm_spc.gif
Executable file
BIN
trunk/docs/chm/make_chm_spc.gif
Executable file
Binary file not shown.
After Width: | Height: | Size: 43 B |
57
trunk/docs/chm/make_chm_style.css
Executable file
57
trunk/docs/chm/make_chm_style.css
Executable file
@@ -0,0 +1,57 @@
|
||||
BODY {
|
||||
FONT-FAMILY: Verdana,arial,helvetica,sans-serif; FONT-SIZE: 10pt
|
||||
}
|
||||
TD {
|
||||
FONT-FAMILY: Verdana,arial,helvetica,sans-serif; FONT-SIZE: 10pt
|
||||
}
|
||||
TH {
|
||||
FONT-FAMILY: Verdana,arial,helvetica,sans-serif; FONT-SIZE: 10pt
|
||||
}
|
||||
P {
|
||||
MARGIN-BOTTOM: 2pt; MARGIN-TOP: 10pt
|
||||
}
|
||||
EM {
|
||||
FONT-STYLE: italic; FONT-WEIGHT: bold
|
||||
}
|
||||
UL {
|
||||
MARGIN-TOP: 10pt
|
||||
}
|
||||
OL {
|
||||
MARGIN-TOP: 10pt
|
||||
}
|
||||
PRE {
|
||||
FONT-FAMILY: "andale mono", "monotype.com", "courier new", monospace; FONT-SIZE: 10pt
|
||||
}
|
||||
A.nav {
|
||||
COLOR: #000066; TEXT-DECORATION: none; FONT-WEIGHT: bold
|
||||
}
|
||||
A.nav:hover {
|
||||
COLOR: #000066; TEXT-DECORATION: underline; FONT-WEIGHT: bold
|
||||
}
|
||||
H1 {
|
||||
COLOR: #000066; FONT-FAMILY: tahoma,arial,helvetica,sans-serif; FONT-SIZE: 18pt; FONT-WEIGHT: bold; MARGIN-BOTTOM: 5pt
|
||||
}
|
||||
H2 {
|
||||
COLOR: #000066; FONT-FAMILY: tahoma,arial,helvetica,sans-serif; FONT-SIZE: 14pt; FONT-WEIGHT: bold; MARGIN-BOTTOM: 5pt
|
||||
}
|
||||
H3 {
|
||||
COLOR: #000066; FONT-FAMILY: tahoma,arial,helvetica,sans-serif; FONT-SIZE: 12pt; FONT-WEIGHT: bold; MARGIN-BOTTOM: 5pt
|
||||
}
|
||||
SMALL {
|
||||
FONT-FAMILY: arial,helvetica,sans-serif; FONT-SIZE: 8.5pt
|
||||
}
|
||||
.tableTitle {
|
||||
FONT-FAMILY: arial,helvetica,sans-serif; FONT-SIZE: 12pt; FONT-WEIGHT: bold
|
||||
}
|
||||
.tableExtras {
|
||||
COLOR: #ffffff; FONT-FAMILY: arial,helvetica,sans-serif; FONT-SIZE: 8.5pt
|
||||
}
|
||||
|
||||
TABLE.warning, TABLE.caution {
|
||||
border-color : #B22222;
|
||||
background-color : #EEE8AA;
|
||||
border-width : 2;
|
||||
font : bold normal Arial, Helvetica, sans-serif;
|
||||
margin : 0;
|
||||
border-spacing : 0px;
|
||||
}
|
428
trunk/docs/configure.in
Executable file
428
trunk/docs/configure.in
Executable file
@@ -0,0 +1,428 @@
|
||||
dnl $Id$
|
||||
|
||||
dnl autoconf initialisation
|
||||
AC_INIT()
|
||||
WORKDIR=`pwd`
|
||||
SRCDIR=$srcdir
|
||||
AC_SUBST(SRCDIR)
|
||||
|
||||
AC_SUBST(WORKDIR)
|
||||
|
||||
dnl debug output
|
||||
echo "file versions"
|
||||
for file in ./*.in; do
|
||||
fgrep '$Id' $file | head -n1 | sed -e"s/^.*: //g" | sed -e"s/200.\/.*$//g"
|
||||
done
|
||||
echo "configure options: $@"
|
||||
echo "working directory: $WORKDIR"
|
||||
echo
|
||||
|
||||
dnl {{{ check for support programs
|
||||
|
||||
dnl {{{ check for PHP
|
||||
|
||||
dnl use given argument, if any, else search in path
|
||||
AC_ARG_WITH(php,
|
||||
[ --with-php=PATH look for PHP executable needed for helper scripts],
|
||||
[
|
||||
if test $withval != "yes"; then
|
||||
AC_MSG_CHECKING([for php])
|
||||
if test -x $withval; then
|
||||
PHP=$withval
|
||||
AC_MSG_RESULT($PHP)
|
||||
else
|
||||
PHP=no
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR([$withval: not an executable file])
|
||||
fi
|
||||
else
|
||||
if test -e ../../phpdoc-tools/php.bat ; then
|
||||
AC_MSG_CHECKING([for php])
|
||||
PHP=../../phpdoc-tools/php.bat
|
||||
AC_MSG_RESULT($PHP)
|
||||
else
|
||||
AC_PATH_PROG(PHP,"php",no)
|
||||
if test $PHP = "no"; then
|
||||
AC_PATH_PROG(PHP4,"php4",no)
|
||||
PHP=$PHP4
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
],[
|
||||
if test -e ../../phpdoc-tools/php.bat ; then
|
||||
AC_MSG_CHECKING([for php])
|
||||
PHP=../../phpdoc-tools/php.bat
|
||||
AC_MSG_RESULT($PHP)
|
||||
else
|
||||
AC_PATH_PROG(PHP,"php",no)
|
||||
if test $PHP = "no"; then
|
||||
AC_PATH_PROG(PHP4,"php4",no)
|
||||
PHP=$PHP4
|
||||
fi
|
||||
fi
|
||||
]
|
||||
)
|
||||
if test $PHP = "no"; then
|
||||
AC_MSG_ERROR([no PHP binary found])
|
||||
fi
|
||||
AC_SUBST(PHP)
|
||||
|
||||
dnl }}}
|
||||
|
||||
dnl {{{ check for the Jade or OpenJade DSSSL parser
|
||||
|
||||
dnl use given argument, if any, else search in path
|
||||
|
||||
AC_ARG_WITH(jade,
|
||||
[ --with-jade=PATH look for jade or openjade executable],[
|
||||
if test $withval != "yes"; then
|
||||
AC_MSG_CHECKING([for jade])
|
||||
if test -x $withval; then
|
||||
JADE=$withval
|
||||
AC_MSG_RESULT($JADE)
|
||||
else
|
||||
JADE=no
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR([$withval: not an executable file])
|
||||
fi
|
||||
else
|
||||
if test -e ../../phpdoc-tools/jade/jade.exe ; then
|
||||
AC_MSG_CHECKING([for jade])
|
||||
JADE=../../phpdoc-tools/jade/jade.exe
|
||||
AC_MSG_RESULT($JADE)
|
||||
else
|
||||
AC_PATH_PROG(OPENJADE,"openjade",no)
|
||||
if test $OPENJADE = "no"; then
|
||||
AC_PATH_PROG(JADE,"jade",no)
|
||||
else
|
||||
JADE=$OPENJADE
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
],[
|
||||
if test -e ../../phpdoc-tools/jade/jade.exe ; then
|
||||
AC_MSG_CHECKING([for jade])
|
||||
JADE=../../phpdoc-tools/jade/jade.exe
|
||||
AC_MSG_RESULT($JADE)
|
||||
else
|
||||
AC_PATH_PROG(OPENJADE,"openjade",no)
|
||||
if test $OPENJADE = "no"; then
|
||||
AC_PATH_PROG(JADE,"jade",no)
|
||||
else
|
||||
JADE=$OPENJADE
|
||||
fi
|
||||
fi
|
||||
]
|
||||
)
|
||||
if test $JADE = "no"; then
|
||||
AC_MSG_ERROR([can't find jade or openjade])
|
||||
fi
|
||||
|
||||
if test ${JADE:0:18} = "../../phpdoc-tools"; then
|
||||
WINJADE=1
|
||||
else
|
||||
WINJADE=0
|
||||
fi
|
||||
|
||||
AC_SUBST(JADE)
|
||||
AC_SUBST(WINJADE)
|
||||
|
||||
dnl }}}
|
||||
|
||||
dnl {{{ check for nsgmls or onsgmls
|
||||
|
||||
AC_ARG_WITH(nsgmls,
|
||||
[ --with-nsgmls=PATH look for nsgmls or onsgmls executable],[
|
||||
if test $withval != "yes"; then
|
||||
AC_MSG_CHECKING([for nsgmls])
|
||||
if test -x $withval; then
|
||||
NSGMLS=$withval
|
||||
AC_MSG_RESULT($NSGMLS)
|
||||
else
|
||||
NSGMLS=no
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR([$withval: not an executable file])
|
||||
fi
|
||||
else
|
||||
if test -e ../../phpdoc-tools/jade/nsgmls.exe ; then
|
||||
AC_MSG_CHECKING([for nsgmls])
|
||||
NSGMLS=../../phpdoc-tools/jade/nsgmls.exe
|
||||
AC_MSG_RESULT($NSGMLS)
|
||||
else
|
||||
AC_PATH_PROG(ONSGMLS,"onsgmls",no)
|
||||
if test $ONSGMLS = "no"; then
|
||||
AC_PATH_PROG(NSGMLS,"nsgmls",no)
|
||||
else
|
||||
NSGMLS=$ONSGMLS
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
],[
|
||||
if test -e ../../phpdoc-tools/jade/nsgmls.exe ; then
|
||||
AC_MSG_CHECKING([for nsgmls])
|
||||
NSGMLS=../../phpdoc-tools/jade/nsgmls.exe
|
||||
AC_MSG_RESULT($NSGMLS)
|
||||
else
|
||||
AC_PATH_PROG(ONSGMLS,"onsgmls",no)
|
||||
if test $ONSGMLS = "no"; then
|
||||
AC_PATH_PROG(NSGMLS,"nsgmls",no)
|
||||
else
|
||||
NSGMLS=$ONSGMLS
|
||||
fi
|
||||
fi
|
||||
]
|
||||
)
|
||||
if test $NSGMLS = "no"; then
|
||||
AC_MSG_ERROR([can't find nsgmls or onsgmls])
|
||||
fi
|
||||
AC_SUBST(NSGMLS)
|
||||
|
||||
dnl }}}
|
||||
|
||||
dnl {{{ check for FOP
|
||||
|
||||
AC_ARG_WITH(fop,
|
||||
[ --with-fop=PATH look for fop],
|
||||
[
|
||||
if test $withval != "yes"; then
|
||||
AC_MSG_CHECKING([for FOP])
|
||||
if test -x $withval -a -f $withval
|
||||
then
|
||||
FOP=$withval
|
||||
AC_MSG_RESULT($FOP)
|
||||
else
|
||||
FOP=no
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR([$withval: not an executable file])
|
||||
fi
|
||||
else
|
||||
if test -e ../../phpdoc-tools/fop/fop.bat ; then
|
||||
AC_MSG_CHECKING([for FOP])
|
||||
FOP=../../phpdoc-tools/fop/fop.bat
|
||||
AC_MSG_RESULT($FOP)
|
||||
else
|
||||
AC_PATH_PROG(FOP,"fop",no)
|
||||
fi
|
||||
fi
|
||||
],[
|
||||
if test -e ../../phpdoc-tools/fop/fop.bat ; then
|
||||
AC_MSG_CHECKING([for FOP])
|
||||
FOP=../../phpdoc-tools/fop/fop.bat
|
||||
AC_MSG_RESULT($FOP)
|
||||
else
|
||||
AC_PATH_PROG(FOP,"fop",no)
|
||||
fi
|
||||
]
|
||||
)
|
||||
if test $FOP = "no"; then
|
||||
AC_MSG_WARN([no fop binary found, PDF generation won't work])
|
||||
fi
|
||||
dnl }}}
|
||||
|
||||
dnl {{{ check for xmllint
|
||||
|
||||
AC_ARG_WITH(xmllint,
|
||||
[ --with-xmllint=PATH check for xmllint],
|
||||
[
|
||||
if test $withval != "yes"; then
|
||||
AC_MSG_CHECKING([for xmllint])
|
||||
if test -x $withval -a -f $withval
|
||||
then
|
||||
XMLLINT=$withval
|
||||
AC_MSG_RESULT($XMLLINT)
|
||||
else
|
||||
XMLLINT=no
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR([$withval: no xmllint binary found])
|
||||
fi
|
||||
else
|
||||
if test -e ../../phpdoc-tools/libxml/xmllint.exe ; then
|
||||
AC_MSG_CHECKING([for xmllint])
|
||||
XSLTPROC=../../phpdoc-tools/libxml/xmllint.exe
|
||||
AC_MSG_RESULT($XMLLINT)
|
||||
else
|
||||
AC_PATH_PROG(XMLLINT,"xmllint",no)
|
||||
fi
|
||||
fi
|
||||
],[
|
||||
if test -e ../../phpdoc-tools/libxml/xmllint.exe ; then
|
||||
AC_MSG_CHECKING([for xmllint])
|
||||
XMLLINT=../../phpdoc-tools/libxml/xmllint.exe
|
||||
AC_MSG_RESULT($XMLLINT)
|
||||
else
|
||||
AC_PATH_PROG(XMLLINT,"xmllint",no)
|
||||
fi
|
||||
]
|
||||
)
|
||||
if test $XMLLINT = "no"; then
|
||||
AC_MSG_WARN([no xmllint binary found, XML Validation won't work])
|
||||
fi
|
||||
AC_SUBST(XMLLINT)
|
||||
|
||||
dnl }}}
|
||||
|
||||
dnl }}}
|
||||
|
||||
dnl {{{ check for catalog files
|
||||
|
||||
CATALOG=""
|
||||
|
||||
dnl iso-ents catalog file
|
||||
dnl The 4.1.2 DocBook DTD also includes entity files, but they cannot be used with Jade!
|
||||
if test -e ./entities/ISO/catalog
|
||||
then
|
||||
CATALOG="$CATALOG -c ./entities/ISO/catalog"
|
||||
fi
|
||||
|
||||
dnl DSSSL catalog file
|
||||
if test -e ./dsssl/docbook/catalog
|
||||
then
|
||||
CATALOG="$CATALOG -c ./dsssl/docbook/catalog"
|
||||
fi
|
||||
|
||||
dnl For windows (and maybe *nix too?) users lacking catalog-files
|
||||
|
||||
dnl jade catalog file
|
||||
# how about using JADEPATH? You should replace the last 4 chars ('jade') with catalog
|
||||
# !! JADEPATH may not properly be set on windows, so do not use it !!
|
||||
if test -e ../../phpdoc-tools/jade/catalog
|
||||
then
|
||||
CATALOG="$CATALOG -c ../../phpdoc-tools/jade/catalog"
|
||||
fi
|
||||
dnl SuSE openjade setup
|
||||
if test -e /usr/share/sgml/CATALOG.docbk41
|
||||
then
|
||||
CATALOG="$CATALOG -c /usr/share/sgml/CATALOG.docbk41"
|
||||
fi
|
||||
if test -e /usr/share/sgml/CATALOG.jade_dsl
|
||||
then
|
||||
CATALOG="$CATALOG -c /usr/share/sgml/CATALOG.jade_dsl"
|
||||
fi
|
||||
|
||||
dnl As a very last option, include default catalog files from phpdoc
|
||||
dnl (imported from the openjade distribution)
|
||||
if test -e $srcdir/dsssl/defaults/catalog
|
||||
then
|
||||
CATALOG="$CATALOG -c ./dsssl/defaults/catalog"
|
||||
fi
|
||||
|
||||
AC_SUBST(CATALOG)
|
||||
|
||||
dnl }}}
|
||||
|
||||
dnl {{{ language specific stuff
|
||||
|
||||
AC_MSG_CHECKING(for language)
|
||||
BUILD_DATE=`date '+%Y-%m-%d'`
|
||||
|
||||
AC_ARG_WITH(lang,
|
||||
[ --with-lang=LANG choose a language to work with],[
|
||||
if test "$withval" = "yes"; then
|
||||
LANG=en
|
||||
AC_MSG_RESULT([en (default)])
|
||||
else
|
||||
if test ! -d "./$withval"; then
|
||||
AC_MSG_RESULT()
|
||||
AC_MSG_ERROR(Language \"$withval\" not supported!)
|
||||
else
|
||||
LANG=$withval
|
||||
AC_MSG_RESULT($LANG)
|
||||
fi
|
||||
|
||||
BUILD_DATE=`date '+%d-%m-%Y'`
|
||||
fi
|
||||
|
||||
case $withval in
|
||||
ja)
|
||||
BUILD_DATE=`date '+%Y/%m/%d'`
|
||||
;;
|
||||
*)
|
||||
esac
|
||||
],[
|
||||
LANG=en
|
||||
AC_MSG_RESULT([en (default)])
|
||||
])
|
||||
AC_SUBST(LANG)
|
||||
AC_SUBST(BUILD_DATE)
|
||||
|
||||
case "$LANG" in
|
||||
ru) ENCODING="utf-8"
|
||||
FOP="$FOP -c fop/ru.cfg";;
|
||||
de) ENCODING="utf-8";;
|
||||
es) ENCODING="utf-8";;
|
||||
fr) ENCODING="utf-8";;
|
||||
id) ENCODING="utf-8";;
|
||||
it) ENCODING="utf-8";;
|
||||
ja) ENCODING="utf-8";;
|
||||
pt_BR) ENCODING="utf-8";;
|
||||
*) ENCODING="ISO-8859-1";;
|
||||
esac
|
||||
|
||||
SP_OPTIONS="SP_ENCODING=XML SP_CHARSET_FIXED=YES"
|
||||
|
||||
AC_SUBST(ENCODING)
|
||||
AC_SUBST(FOP)
|
||||
AC_SUBST(SP_OPTIONS)
|
||||
|
||||
dnl }}}
|
||||
|
||||
dnl {{{ makefile targets for configure-generated files
|
||||
|
||||
rm -f autogenerated_rules
|
||||
(
|
||||
for file in `find . -name "*.in"`; do
|
||||
case "$file" in
|
||||
./configure.in)
|
||||
echo configure: configure.in
|
||||
printf '\t autoconf'
|
||||
echo
|
||||
;;
|
||||
./manual.xml.in)
|
||||
;;
|
||||
*)
|
||||
echo `dirname $file`/`basename $file .in`: '$(srcdir)'/$file ./config.status
|
||||
printf '\t CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status'
|
||||
echo
|
||||
esac
|
||||
done
|
||||
) > autogenerated_rules
|
||||
AUTOGENERATED_RULES=autogenerated_rules
|
||||
AC_SUBST_FILE(AUTOGENERATED_RULES)
|
||||
rm -f autogenerated_rules
|
||||
|
||||
dnl }}}
|
||||
|
||||
dnl {{{ generate output files
|
||||
|
||||
dnl {{{ find all *.in files and process them with AC_OUTPUT
|
||||
for infile in `find $srcdir -name "*.in"`
|
||||
do
|
||||
if test `basename $infile` != "configure.in"
|
||||
then
|
||||
outfile=`basename $infile .in`
|
||||
outdir=`dirname $infile`
|
||||
outdir=`echo $outdir/ | sed -e"s|$srcdir/||"`
|
||||
OUTFILES="$OUTFILES ./$outdir$outfile"
|
||||
fi
|
||||
done
|
||||
AC_OUTPUT($OUTFILES)
|
||||
dnl }}}
|
||||
|
||||
dnl {{{ generate entity mapping file, missing entities and IDs
|
||||
|
||||
dnl if we have PHP use it for all of these things
|
||||
if test $PHP != "no"
|
||||
then
|
||||
|
||||
dnl create entity mapping file
|
||||
$PHP -q ./scripts/file-entities.php
|
||||
|
||||
else
|
||||
|
||||
echo ERROR: configure process cannot continue, PHP is not found
|
||||
|
||||
fi
|
||||
|
||||
dnl }}}
|
||||
|
||||
dnl }}}
|
30
trunk/docs/de/appendixes/bugs.xml
Normal file
30
trunk/docs/de/appendixes/bugs.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- EN-Revision: 1.2 Maintainer: andreas Status: ready -->
|
||||
<!-- $Revision$ -->
|
||||
<chapter id="bugs">
|
||||
<title>BUGS</title>
|
||||
<para>
|
||||
Bitte konsultieren Sie die Datei <filename>BUGS</filename> welche mit Smarty ausgeliefert wird,
|
||||
oder die Webseite.
|
||||
</para>
|
||||
</chapter>
|
||||
<!-- 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
|
||||
-->
|
33
trunk/docs/de/appendixes/resources.xml
Normal file
33
trunk/docs/de/appendixes/resources.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: andreas Status: ready -->
|
||||
<chapter id="resources">
|
||||
<title>Weiterführende Informationen</title>
|
||||
<para>
|
||||
Smarty's Homepage erreicht man unter <ulink
|
||||
url="&url.smarty;">&url.smarty;</ulink>. Sie können der Smarty
|
||||
Mailingliste beitreten in dem sie ein E-mail an
|
||||
&ml.general.sub;. Das Archiv der Liste ist hier <ulink
|
||||
url="&url.ml.archive;">&url.ml.archive;</ulink> einsehbar.
|
||||
</para>
|
||||
</chapter>
|
||||
<!-- 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
|
||||
-->
|
426
trunk/docs/de/appendixes/tips.xml
Normal file
426
trunk/docs/de/appendixes/tips.xml
Normal file
@@ -0,0 +1,426 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.10 Maintainer: messju Status: ready -->
|
||||
<chapter id="tips">
|
||||
<title>Tips & Tricks</title>
|
||||
<para>
|
||||
</para>
|
||||
<sect1 id="tips.blank.var.handling">
|
||||
<title>Handhabung unangewiesener Variablen</title>
|
||||
<para>
|
||||
Manchmal möchten Sie vielleicht, dass anstatt einer Leerstelle ein
|
||||
Standardwert ausgegeben wird - zum Beispiel um im
|
||||
Tabellenhintergrund "&nbsp;" auszugeben, damit er korrekt
|
||||
angezeigt wird. Damit dafür keine <link
|
||||
linkend="language.function.if">{if}</link> Anweisung verwendet
|
||||
werden muss, gibt es in Smarty eine Abkürzung: die Verwendung des
|
||||
<emphasis>default</emphasis> Variablen-Modifikators.
|
||||
</para>
|
||||
<example>
|
||||
<title>"&nbsp;" ausgeben wenn eine Variable nicht zugewiesen ist</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* die lange Variante: *}
|
||||
{if $titel eq ""}
|
||||
|
||||
{else}
|
||||
{$titel}
|
||||
{/if}
|
||||
|
||||
|
||||
{* kürzer: *}
|
||||
{$titel|default:" "}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Siehe auch <link linkend="language.modifier.default">default
|
||||
(Standardwert)</link> und <link
|
||||
linkend="tips.default.var.handling">Handhabung von
|
||||
Standardwerten</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="tips.default.var.handling">
|
||||
<title>Handhabung von Standardwerten</title>
|
||||
<para>
|
||||
Wenn eine Variable in einem Template häufig zum Einsatz kommt,
|
||||
kann es ein bisschen störend wirken, den <link
|
||||
linkend="language.modifier.default"><emphasis>default</emphasis></link>-Modifikator
|
||||
jedes mal anzuwenden. Sie können dies umgehen, indem Sie der
|
||||
Variable mit der <link
|
||||
linkend="language.function.assign">{assign}</link> Funktion einen
|
||||
Standardwert zuweisen.
|
||||
</para>
|
||||
<example>
|
||||
<title>Zuweisen des Standardwertes einer Variable</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* schreiben sie dieses statement an den Anfang des Templates *}
|
||||
{assign var="titel" value=$titel|default:"kein Titel"}
|
||||
|
||||
{* falls 'titel' bei der Anweisung leer war, enthält es nun den Wert
|
||||
'kein Titel' wenn Sie es ausgeben *}
|
||||
{$titel}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Siehe auch <link linkend="language.modifier.default">default
|
||||
(Standardwert)</link> und <link
|
||||
linkend="tips.blank.var.handling">Handhabung nicht zugewiesener
|
||||
Variablen</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="tips.passing.vars">
|
||||
<title>Variablen an eingebundene Templates weitergeben</title>
|
||||
<para>
|
||||
Wenn die Mehrzahl Ihrer Templates den gleichen Header und Footer
|
||||
verwenden, lagert man diese meist in eigene Templates aus und
|
||||
bindet diese mit<link
|
||||
linkend="language.function.include">{include}</link> ein. Was
|
||||
geschieht aber wenn der Header einen seitenspezifischen Titel
|
||||
haben soll? Smarty bietet die Möglichkeit, dem eingebundenen
|
||||
Template, Variablen als <link
|
||||
linkend="language.syntax.attributes">Attribute</link> zu
|
||||
übergeben.
|
||||
</para>
|
||||
<example>
|
||||
<title>Die Titel-Variable dem Header-Template zuweisen</title>
|
||||
<para>
|
||||
<filename>mainpage.tpl</filename> - Beim Aufbau der Hauptseite
|
||||
wird der Titel "Hauptseite" an <filename>header.tpl</filename>
|
||||
übergeben und dort verwendet.
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{include file="header.tpl" title="Hauptseite"}
|
||||
{* template body hier *}
|
||||
{include file="footer.tpl"}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
<filename>archives.tpl</filename>
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
|
||||
{config_load file="archiv.conf"}
|
||||
{include file="header.tpl" title=#archivSeiteTitel#}
|
||||
{* template body hier *}
|
||||
{include file="footer.tpl"}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
<filename>header.tpl</filename> - Zur Info: wenn kein $titel
|
||||
übergeben wurde wird hier mittels des <link
|
||||
linkend="language.modifier.default">default</link>-Modifikator der
|
||||
Titel "Nachrichten" verwendet.
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
<html>
|
||||
<head>
|
||||
<title>{$title|default:"Nachrichten"}</title>
|
||||
</head>
|
||||
<body>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
<filename>footer.tpl</filename>
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
</BODY>
|
||||
</HTML>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<sect1 id="tips.dates">
|
||||
<title>Zeitangaben</title>
|
||||
<para>
|
||||
Um dem Template Designer höchstmögliche Kontrolle über die Ausgabe
|
||||
von Zeitangaben/Daten zu ermöglichen, ist es empfehlenswert Daten
|
||||
immer als <ulink url="&url.php-manual;time">Timestamp</ulink> zu
|
||||
übergeben. Der Designer kann danach die Funktion <link
|
||||
linkend="language.modifier.date.format">date_format</link> für die
|
||||
Formatierung verwenden.
|
||||
</para>
|
||||
<para>
|
||||
Bemerkung: Seit Smarty 1.4.0 ist es möglich jede Timestamp zu
|
||||
übergeben, welche mit strtotime() ausgewertet werden kann. Dazu
|
||||
gehören Unix-Timestamps und MySQL-Timestamps.
|
||||
</para>
|
||||
<example>
|
||||
<title>Die Verwendung von date_format</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$startDate|date_format}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
AUSGABE:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Jan 4, 2001
|
||||
]]>
|
||||
</screen>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$startDatum|date_format:"%Y/%m/%d"}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
AUSGABE:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
2001/01/04
|
||||
]]>
|
||||
</screen>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{if $datum1 < $datum2}
|
||||
...
|
||||
{/if}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Falls <link
|
||||
linkend="language.function.html.select.date">{html_select_date}</link>
|
||||
in einem Template verwendet wird, hat der Programmierer die
|
||||
Möglichkeit den Wert wieder in ein Timestamp-Format zu
|
||||
ändern. Dies kann zum Beispiel wie folgt gemacht werden:
|
||||
</para>
|
||||
<example>
|
||||
<title>Formular Datum-Elemente nach Timestamp konvertieren</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
// hierbei wird davon ausgegangen, dass Ihre Formular Elemente wie folgt benannt sind
|
||||
// startDate_Day, startDate_Month, startDate_Year
|
||||
|
||||
$startDate = makeTimeStamp($startDate_Year,$startDate_Month,$startDate_Day);
|
||||
|
||||
function makeTimeStamp($year="",$month="",$day="")
|
||||
{
|
||||
if(empty($year)) {
|
||||
$year = strftime("%Y");
|
||||
}
|
||||
if(empty($month)) {
|
||||
$month = strftime("%m");
|
||||
}
|
||||
if(empty($day)) {
|
||||
$day = strftime("%d");
|
||||
}
|
||||
return mktime(0, 0, 0, $month, $day, $year);
|
||||
}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
Siehe auch
|
||||
<link linkend="language.function.html.select.date">{html_select_date}</link>,
|
||||
<link linkend="language.function.html.select.time">{html_select_time}</link>,
|
||||
<link linkend="language.modifier.date.format">date_format</link>
|
||||
und <link linkend="language.variables.smarty.now">$smarty.now</link>,
|
||||
</para>
|
||||
</sect1>
|
||||
<sect1 id="tips.wap">
|
||||
<title>WAP/WML</title>
|
||||
<para>
|
||||
WAP/WML Templates verlangen, dass ein Content-Type Header im
|
||||
Template angegeben wird. Der einfachste Weg um dies zu tun, wäre,
|
||||
eine Funktion zu schreiben, welche den Header ausgibt. Falls sie
|
||||
den Caching Mechanismus verwenden, sollten Sie auf das
|
||||
'insert'-Tag zurückgreifen ('insert'-Tags werden nicht gecached),
|
||||
um ein optimales Ergebnis zu erzielen. Achten Sie darauf, dass vor
|
||||
der Ausgabe des Headers keine Daten an den Client gesendet werden,
|
||||
da die gesendeten Header-Daten ansonsten von Client verworfen
|
||||
werden.
|
||||
</para>
|
||||
<example>
|
||||
<title>Die verwendung von 'insert' um einen WML Content-Type header zu senden</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
// stellen Sie sicher, dass Apache mit .wml Dateien umgehen kann!
|
||||
// schreiben Sie folgende Funktion in Ihrer Applikation, oder in Smarty.addons.php
|
||||
function insert_header($params)
|
||||
{
|
||||
// folgende Funktion erwartet ein $inhalt argument
|
||||
if (empty($params['inhalt'])) {
|
||||
return;
|
||||
}
|
||||
header($params['inhalt']);
|
||||
return;
|
||||
}
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ihr Template <emphasis>muss</emphasis> danach wie folgt beginnen:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{insert name=header inhalt="Content-Type: text/vnd.wap.wml"}
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
|
||||
|
||||
<!-- neues wml deck -->
|
||||
<wml>
|
||||
<!-- erste karte -->
|
||||
<card>
|
||||
<do type="accept">
|
||||
<go href="#zwei"/>
|
||||
</do>
|
||||
<p>
|
||||
Welcome to WAP with Smarty!
|
||||
Willkommen bei WAP mit Smarty!
|
||||
OK klicken um weiterzugehen...
|
||||
</p>
|
||||
</card>
|
||||
<!-- zweite karte -->
|
||||
<card id="zwei">
|
||||
<p>
|
||||
Einfach, oder?
|
||||
</p>
|
||||
</card>
|
||||
</wml>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<sect1 id="tips.componentized.templates">
|
||||
<title>Template/Script Komponenten</title>
|
||||
<para>
|
||||
Normalerweise werden Variablen dem Template wie folgt zugewiesen:
|
||||
In Ihrer PHP-Applikation werden die Variablen zusammengestellt
|
||||
(zum Beispiel mit Datenbankabfragen). Danach kreieren Sie eine
|
||||
Instanz von Smarty, weisen die Variablen mit <link
|
||||
linkend="api.assign">assign()</link> zu und geben das Template mit
|
||||
<link linkend="api.display">display()</link> aus. Wenn wir also
|
||||
zum Beispiel einen Börsenticker in unserem Template haben, stellen
|
||||
wir die Kursinformationen in unserer Anwendung zusammen, weisen
|
||||
Sie dem Template zu und geben es aus. Wäre es jedoch nicht nett
|
||||
diesen Börsenticker einfach in ein Template einer anderen
|
||||
Applikation einbinden zu können ohne deren Programmcode zu ändern?
|
||||
</para>
|
||||
<para>
|
||||
Sie können PHP-Code mit {php}{/php} in Ihre Templates einbetten.
|
||||
So können Sie Templates erstellen, welche die Datenstrukturen zur
|
||||
Anweisung der eigenen Variablen enthalten. Durch die Bindung von
|
||||
Template und Logik entsteht so eine eigenständig lauffähige
|
||||
Komponente.
|
||||
</para>
|
||||
<example>
|
||||
<title>Template/Script Komponenten</title>
|
||||
<para>
|
||||
<filename>function.load_ticker.php</filename> -
|
||||
Diese Datei gehört ins <link
|
||||
linkend="variable.plugins.dir">$plugins directory</link>
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
// setup our function for fetching stock data
|
||||
function fetch_ticker($symbol)
|
||||
{
|
||||
// put logic here that fetches $ticker_info
|
||||
// from some ticker resource
|
||||
return $ticker_info;
|
||||
}
|
||||
|
||||
function smarty_function_load_ticker($params, $smarty)
|
||||
{
|
||||
// call the function
|
||||
$ticker_info = fetch_ticker($params['symbol']);
|
||||
|
||||
// assign template variable
|
||||
$smarty->assign($params['assign'], $ticker_info);
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
<filename>index.tpl</filename>
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{load_ticker symbol="YHOO" assign="ticker"}
|
||||
|
||||
Stock Name: {$ticker.name} Stock Price: {$ticker.price}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<sect1 id="tips.obfuscating.email">
|
||||
<title>Verschleierung von E-mail Adressen</title>
|
||||
<para>
|
||||
Haben Sie sich auch schon gewundert, wie Ihre E-mail Adresse auf
|
||||
so viele Spam-Mailinglisten kommt? Ein Weg, wie Spammer E-mail
|
||||
Adressen sammeln, ist über Webseiten. Um dieses Problem zu
|
||||
bekämpfen, können sie den 'mailto'-Plugin verwenden. Er ändert
|
||||
die Zeichenfolge mit Javascript so, dass sie im HTML Quellcode
|
||||
nicht lesbar ist, jedoch von jedem Browser wieder zusammengesetzt
|
||||
werden kann. Den <link
|
||||
linkend="language.function.mailto">{mailto}</link>-Plugin gibt es
|
||||
im Smarty-Repository auf http://smarty.php.net. Laden sie den
|
||||
Plugin herunter und speichern Sie ihn im 'plugins' Verzeichnis.
|
||||
</para>
|
||||
<example>
|
||||
<title>Beispiel von verschleierung von E-mail Adressen</title>
|
||||
<programlisting>
|
||||
{* in index.tpl *}
|
||||
|
||||
Anfragen bitte an
|
||||
{mailto address=$EmailAddress encode="javascript" subject="Hallo"}
|
||||
senden
|
||||
</programlisting>
|
||||
</example>
|
||||
<note>
|
||||
<title>Technische Details</title>
|
||||
<para>
|
||||
Die Codierung mit Javascript ist nicht sehr sicher, da ein
|
||||
möglicher Spammer die Decodierung in sein Sammelprogramm
|
||||
einbauen könnte. Es wird jedoch damit gerechnet, dass, da
|
||||
Aufwand und Ertrag sich nicht decken, dies nicht oft der Fall
|
||||
ist.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
Siehe auch <link linkend="language.modifier.escape">escape</link>
|
||||
und <link linkend="language.function.mailto">{mailto}</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
</chapter>
|
||||
<!-- 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
|
||||
-->
|
77
trunk/docs/de/appendixes/troubleshooting.xml
Normal file
77
trunk/docs/de/appendixes/troubleshooting.xml
Normal file
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: andreas Status: ready -->
|
||||
<chapter id="troubleshooting">
|
||||
<title>Problemlösung</title>
|
||||
<para></para>
|
||||
<sect1 id="smarty.php.errors">
|
||||
<title>Smarty/PHP Fehler</title>
|
||||
<para>
|
||||
Smarty kann verschiedene Fehler-Typen, wie fehlende Tag-Attribute
|
||||
oder syntaktisch falsche Variablen-Namen abfangen. Wenn dies
|
||||
geschieht, wird Ihnen eine Fehlermeldung ausgegeben. Beispiel:
|
||||
</para>
|
||||
<example>
|
||||
<title>Smarty Fehler</title>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Warning: Smarty: [in index.tpl line 4]: syntax error: unknown tag - '%blah'
|
||||
in /path/to/smarty/Smarty.class.php on line 1041
|
||||
|
||||
Fatal error: Smarty: [in index.tpl line 28]: syntax error: missing section name
|
||||
in /path/to/smarty/Smarty.class.php on line 1041</programlisting>
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<para>
|
||||
In der ersten Zeile zeigt Smarty den Template-Namen, die
|
||||
Zeilennummer und den Fehler an. Darauf folgt die betroffene Zeile
|
||||
in der Smarty Klasse welche den Fehler erzeugt hat.
|
||||
</para>
|
||||
<para>
|
||||
Es gibt gewisse Fehlerkonditionen, die Smarty nicht abfangen kann (bsp: fehlende End-Tags). Diese Fehler
|
||||
resultieren jedoch normalerweise in einem PHP-'compile-time' Fehler.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>PHP Syntaxfehler</title>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Parse error: parse error in /path/to/smarty/templates_c/index.tpl.php on line 75</programlisting>
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<para>
|
||||
Wenn ein PHP Syntaxfehler auftritt, wird Ihnen die Zeilennummer
|
||||
des betroffenen PHP Skriptes ausgegeben, nicht die des
|
||||
Templates. Normalerweise können Sie jedoch das Template
|
||||
anschauen um den Fehler zu lokalisieren. Schauen sie insbesondere
|
||||
auf Folgendes: fehlende End-Tags in einer {if}{/if} Anweisung oder
|
||||
in einer {section}{/section} und die Logik eines {if}
|
||||
Blocks. Falls Sie den Fehler so nicht finden, können Sie auch
|
||||
das kompilierte Skript öffnen und zu der betreffenden
|
||||
Zeilennummer springen um herauszufinden welcher Teil des Templates
|
||||
den Fehler enthält.
|
||||
</para>
|
||||
</sect1>
|
||||
</chapter>
|
||||
<!-- 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
|
||||
-->
|
47
trunk/docs/de/bookinfo.xml
Executable file
47
trunk/docs/de/bookinfo.xml
Executable file
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.9 Maintainer: andreas Status: ready -->
|
||||
<bookinfo id="bookinfo">
|
||||
<title>Smarty - die kompilierende PHP Template-Engine</title>
|
||||
<authorgroup id="authors">
|
||||
<author>
|
||||
<firstname>Monte</firstname><surname>Ohrt <monte at ohrt dot com></surname>
|
||||
</author>
|
||||
<author>
|
||||
<firstname>Andrei</firstname><surname>Zmievski <andrei@php.net></surname>
|
||||
</author>
|
||||
</authorgroup>
|
||||
<authorgroup id="translators">
|
||||
<author>
|
||||
<firstname>Andreas</firstname><surname>Halter <smarty@andreashalter.ch> (Deutsche Übersetzung)</surname>
|
||||
</author>
|
||||
<author>
|
||||
<firstname>Thomas</firstname><surname>Schulz <ths@4bconsult.de> (Review der deutschen Übersetzung)</surname>
|
||||
</author>
|
||||
</authorgroup>
|
||||
<pubdate>&build-date;</pubdate>
|
||||
<copyright>
|
||||
<year>2001-2005</year>
|
||||
<holder>New Digital Group, Inc.</holder>
|
||||
</copyright>
|
||||
</bookinfo>
|
||||
<!-- 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
|
||||
-->
|
73
trunk/docs/de/designers/chapter-debugging-console.xml
Normal file
73
trunk/docs/de/designers/chapter-debugging-console.xml
Normal file
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.7 Maintainer: andreas Status: ready -->
|
||||
<chapter id="chapter.debugging.console">
|
||||
<title>Debugging Konsole</title>
|
||||
<para>
|
||||
Smarty wird mit einer eingebauten Debugging Konsole
|
||||
ausgeliefert. Diese Konsole informiert über die im aufgerufenen
|
||||
Template <link
|
||||
linkend="language.function.include">eingebundenen</link> Templates,
|
||||
die <link linkend="api.assign">zugewiesenen</link> Variablen und die
|
||||
<link
|
||||
linkend="language.config.variables">Konfigurations-Variablen</link>.
|
||||
Die Formatierung der Konsole wird über das Template <link
|
||||
linkend="variable.debug.tpl">debug.tpl</link> gesteuert. Um
|
||||
debugging zu aktivieren, setzten Sie <link
|
||||
linkend="variable.debugging">$debugging</link> auf 'true' und (falls
|
||||
nötig) übergeben in <link
|
||||
linkend="variable.debug.tpl">$debug_tpl</link> den Pfad zum
|
||||
Debugtemplate (normalerweise <link
|
||||
linkend="constant.smarty.dir">SMARTY_DIR</link>debug.tpl). Wenn Sie
|
||||
danach eine Seite laden, sollte ein Javascript-Fenster geöffnet
|
||||
werden in welchem Sie alle Informationen zur aufgerufenen Seite
|
||||
finden. Falls Sie die Variablen eines bestimmten Templates ausgeben
|
||||
wollen, können Sie dazu die Funktion <link
|
||||
linkend="language.function.debug">{debug}</link> verwenden. Um
|
||||
debugging auszuschalten, können Sie <link
|
||||
linkend="variable.debugging">$debugging</link> auf 'false' setzen.
|
||||
Sie können debugging auch temporär aktivieren, in dem Sie der
|
||||
aufgerufenen URL SMARTY_DEBUG mit übergeben, dies muss jedoch
|
||||
zuerst mit <link
|
||||
linkend="variable.debugging.ctrl">$debugging_ctrl</link> aktiviert
|
||||
werden.
|
||||
</para>
|
||||
<note>
|
||||
<title>Technische Bemerkung</title>
|
||||
<para>
|
||||
Die Debugging Konsole funktioniert nicht für Daten die via <link
|
||||
linkend="api.fetch">fetch()</link> geladen wurden, sondern nur
|
||||
für Daten die via <link linkend="api.display">display()</link>
|
||||
ausgegeben werden. Die Konsole besteht aus ein paar Zeilen
|
||||
Javascript welche am Ende jeder Seite eingefügt werden. Wenn
|
||||
Sie Javascript nicht mögen, können Sie die Ausgabe in
|
||||
'debug.tpl' selbst definieren. Debug-Ausgaben werden nicht gecached
|
||||
und Informationen zu 'debug.tpl' selbst werden nicht ausgegeben.
|
||||
</para>
|
||||
</note>
|
||||
<note>
|
||||
<para>
|
||||
Die Ladezeiten werden in Sekunden, oder Bruchteilen davon, angegeben.
|
||||
</para>
|
||||
</note>
|
||||
</chapter>
|
||||
<!-- 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
|
||||
-->
|
110
trunk/docs/de/designers/config-files.xml
Normal file
110
trunk/docs/de/designers/config-files.xml
Normal file
@@ -0,0 +1,110 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.7 Maintainer: andreas Status: ready -->
|
||||
<chapter id="config.files">
|
||||
<title>Konfigurationsdateien</title>
|
||||
<para>
|
||||
Konfigurationsdateien sind ein praktischer Weg um Template-Variablen
|
||||
aus einer gemeinsamen Datei zu lesen. Ein Beispiel sind die
|
||||
Template-Farben. Wenn Sie die Farben einer Applikation anpassen
|
||||
wollen, müssen Sie normalerweise alle Templates durcharbeiten,
|
||||
und die entsprechenden Werte ändern. Mit einer
|
||||
Konfigurationsdatei können Sie alle Definitionen in einer
|
||||
einzigen Datei vornehmen, und somit auch einfach ändern.
|
||||
</para>
|
||||
<example>
|
||||
<title>Beispiel der Konfigurationsdatei-Syntax</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
# global variables
|
||||
pageTitle = "Main Menu"
|
||||
bodyBgColor = #000000
|
||||
tableBgColor = #000000
|
||||
rowBgColor = #00ff00
|
||||
|
||||
[Customer]
|
||||
pageTitle = "Customer Info"
|
||||
|
||||
[Login]
|
||||
pageTitle = "Login"
|
||||
focus = "username"
|
||||
Intro = """Diese Zeile erstreckt sich über
|
||||
mehrere Zeilen, und muss deswegen
|
||||
mit dreifachen Anführungszeichen
|
||||
umschlossen werden."""
|
||||
|
||||
# hidden section
|
||||
[.Database]
|
||||
host=my.example.com
|
||||
db=ADDRESSBOOK
|
||||
user=php-user
|
||||
pass=foobar
|
||||
]]></programlisting>
|
||||
</example>
|
||||
<para>
|
||||
<link linkend="language.config.variables">Die Werte in einer
|
||||
Konfigurationsdatei</link> können in einfachen/doppelten
|
||||
Anführungszeichen notiert werden. Falls Sie einen Wert haben der
|
||||
sich über mehrere Zeilen ausbreitet muss dieser Wert in
|
||||
dreifachen Anführungszeichen (""") eingebettet werden. Die
|
||||
Kommentar-Syntax kann frei gewählt werden, solange sie nicht der
|
||||
normalen Syntax entsprechen. Wir empfehlen die Verwendung von
|
||||
<literal>#</literal> (Raute) am Anfang jeder Kommentar-Zeile.
|
||||
</para>
|
||||
<para>
|
||||
Dieses Beispiel hat 2 'sections'. 'section'-Namen werden von
|
||||
[]-Zeichen umschlossen und können alle Zeichen ausser
|
||||
<literal>[</literal> und <literal>]</literal> enthalten. Die vier
|
||||
Variablen welche am Anfang der Datei definiert werden sind globale
|
||||
Variablen. Diese Variablen werden immer geladen. Wenn eine
|
||||
definierte 'section' geladen wird, werden also die globalen
|
||||
Variablen ebenfalls eingelesen. Wenn eine Variable sowohl global als
|
||||
auch in einer 'section' vorkommt, wird die 'section'-Variable
|
||||
verwendet. Wenn zwei Variablen in der gleichen 'section' den selben
|
||||
Namen aufweisen wird die Letztere verwendet, es sei denn <link
|
||||
linkend="variable.config.overwrite">$config_overwrite</link> ist
|
||||
deaktiviert ('false').
|
||||
</para>
|
||||
<para>
|
||||
Konfigurationsdateien werden mit <link
|
||||
linkend="language.function.config.load"><command>config_load</command></link>
|
||||
geladen.
|
||||
</para>
|
||||
<para>
|
||||
Sie können Variablen oder auch ganze 'sections' verstecken indem
|
||||
Sie dem Namen ein '.' voranstellen. Dies ist besonders wertvoll wenn
|
||||
Ihre Applikation sensitive Informationen aus der Konfigurationsdatei
|
||||
liest welche von der Template-Engine nicht verwendet werden. Falls
|
||||
eine Drittpartei eine Änderung an der Konfigurationsdatei
|
||||
vornimmt können Sie so sicherstellen, dass die sensitiven Daten
|
||||
nicht in deren Template geladen werden können.
|
||||
</para>
|
||||
<para>
|
||||
Siehe auch: <link
|
||||
linkend="language.function.config.load">{config_load}</link>, <link
|
||||
linkend="variable.config.overwrite">$config_overwrite</link>, <link
|
||||
linkend="api.get.config.vars">get_config_vars()</link>, <link
|
||||
linkend="api.clear.config">clear_config()</link> und <link
|
||||
linkend="api.config.load">config_load()</link>
|
||||
</para>
|
||||
</chapter>
|
||||
<!-- 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
|
||||
-->
|
46
trunk/docs/de/designers/language-basic-syntax.xml
Normal file
46
trunk/docs/de/designers/language-basic-syntax.xml
Normal file
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: andreas Status: ready -->
|
||||
<chapter id="language.basic.syntax">
|
||||
<title>Grundlegende Syntax</title>
|
||||
<para>
|
||||
Alle Smarty Template-Tags werden mit Trennzeichen umschlossen. Normalerweise
|
||||
sind dies: <literal>{</literal> und <literal>}</literal>, sie können aber
|
||||
auch <link linkend="variable.left.delimiter">verändert</link> werden.
|
||||
</para>
|
||||
<para>
|
||||
Für die folgenden Beispiele wird davon ausgegangen, dass Sie die
|
||||
Standard-Trennzeichen verwenden. Smarty erachtet alle Inhalte ausserhalb
|
||||
der Trennzeichen als statisch und unveränderbar. Sobald Smarty
|
||||
auf Template-Tags stösst, versucht es diese zu interpretieren und die
|
||||
entsprechenden Ausgaben an deren Stelle einzufügen.
|
||||
</para>
|
||||
|
||||
&designers.language-basic-syntax.language-syntax-comments;
|
||||
&designers.language-basic-syntax.language-syntax-variables;
|
||||
&designers.language-basic-syntax.language-syntax-functions;
|
||||
&designers.language-basic-syntax.language-syntax-attributes;
|
||||
&designers.language-basic-syntax.language-syntax-quotes;
|
||||
&designers.language-basic-syntax.language-math;
|
||||
&designers.language-basic-syntax.language-escaping;
|
||||
</chapter>
|
||||
<!-- 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
|
||||
-->
|
@@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.7 Maintainer: messju Status: ready -->
|
||||
<sect1 id="language.escaping">
|
||||
<title>Smarty Parsing umgehen</title>
|
||||
<para>
|
||||
Manchmal ist es wünschenswert, dass Smarty Teile eines
|
||||
Templates nicht parst. Dies ist zum Beispiel der Fall, wenn
|
||||
Javascript oder CSS im Template eingebettet werden. Da diese
|
||||
Sprachen selbst { und } nutzen, erkennt Smarty diese als Start-
|
||||
beziehungsweise End-Tags.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Der einfachste Weg, dieses Problem zu umgehen, ist das Auslagern des
|
||||
betreffenden Javascript oder CSS Codes in eigene Dateien.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Um solche Inhalte trotzdem im gleichen Template einzubetten, können
|
||||
Sie <link linkend="language.function.literal">{literal}
|
||||
.. {/literal}</link> Blöcke verwenden. Die aktuell benutzten
|
||||
Trennzeichen können Sie mit <link
|
||||
linkend="language.function.ldelim">{ldelim}</link>, <link
|
||||
linkend="language.function.ldelim">{rdelim}</link>, <link
|
||||
linkend="language.variables.smarty.ldelim">{$smarty.ldelim}</link>
|
||||
und <link linkend="language.variables.smarty.ldelim">{$smarty.rdelim}</link>
|
||||
ausgeben.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Manchmal ist es auch einfacher, die Trennzeichen selbst zu ändern:
|
||||
<link linkend="variable.left.delimiter">$left_delimiter</link> und
|
||||
<link linkend="variable.right.delimiter">$right_delimiter</link>
|
||||
definieren diese.
|
||||
</para>
|
||||
<example>
|
||||
<title>Beispiel wie die Trennzeichen angepasst werden</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->left_delimiter = '<!--{';
|
||||
$smarty->right_delimiter = '}-->';
|
||||
$smarty->assign('foo', 'bar');
|
||||
$smarty->assign('name', 'Albert');
|
||||
$smarty->display('example.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
example.tpl würde somit wie folgt aussehen:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
Willkommen bei Smarty, <!--{$name}-->!
|
||||
<script language="javascript">
|
||||
var foo = <!--{$foo}-->;
|
||||
function dosomething() {
|
||||
alert("foo is " + foo);
|
||||
}
|
||||
dosomething();
|
||||
</script>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Siehe auch: <link linkend="language.modifier.escape">Escape Modifikator</link>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.math">
|
||||
<title>Math</title>
|
||||
<para>
|
||||
Mathematische Operationen können direkt auf Variablen verwendet werden.
|
||||
</para>
|
||||
<example>
|
||||
<title>Mathematik Beispiele</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$foo+1}
|
||||
|
||||
{$foo*$bar}
|
||||
|
||||
{* kompliziertere Beispiele *}
|
||||
|
||||
{$foo->bar-$bar[1]*$baz->foo->bar()-3*7}
|
||||
|
||||
{if ($foo+$bar.test%$baz*134232+10+$b+10)}
|
||||
|
||||
{$foo|truncate:"`$fooTruncCount/$barTruncFactor-1`"}
|
||||
|
||||
{assign var="foo" value="`$foo+$bar`"}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
Siehe auch die <link linkend="language.function.math">{math}-Funktion</link>
|
||||
für komplexere Berechnungen.
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: messju Status: ready -->
|
||||
<sect1 id="language.syntax.attributes">
|
||||
<title>Attribute / Parameter</title>
|
||||
<para>
|
||||
Die meisten Funktionen nehmen Parameter entgegen, die das Verhalten
|
||||
der Funktion definieren beziehungsweise beeinflussen. Parameter
|
||||
für Smarty <link
|
||||
linkend="language.syntax.functions">Funktionen</link> sind HTML
|
||||
Attributen sehr ähnlich. Statische Werte müssen nicht in
|
||||
Anführungszeichen gesetzt werden, für literale
|
||||
Zeichenketten (literal strings) wird dies jedoch empfohlen.
|
||||
</para>
|
||||
<para>
|
||||
Bestimmte Parameter verlangen logische Werte (true / false). Diese
|
||||
können auch ohne Anführungszeichen angegeben werden:
|
||||
<literal>true</literal>, <literal>on</literal> und
|
||||
<literal>yes</literal> - oder <literal>false</literal>,
|
||||
<literal>off</literal> und <literal>no</literal>.
|
||||
</para>
|
||||
<example>
|
||||
<title>Funktions-Parameter Syntax</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{include file='header.tpl'}
|
||||
|
||||
{include file='header.tpl' attrib_name='attrib value'}
|
||||
|
||||
{include file=$includeFile}
|
||||
|
||||
{include file=#includeFile#}
|
||||
|
||||
{html_select_date display_days=yes}
|
||||
|
||||
{mailto address='smarty@example.com'}
|
||||
|
||||
<select name=firma>
|
||||
{html_options values=$vals selected=$selected output=$output}
|
||||
</select>
|
||||
]]>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.syntax.comments">
|
||||
<title>Kommentare</title>
|
||||
<para>
|
||||
|
||||
Kommentare werden von Asterisks umschlossen, und mit <link
|
||||
linkend="variable.left.delimiter">Trennzeichen</link> umgeben.
|
||||
Beispiel: {* das ist ein Kommentar *} Smarty-Kommentare werden in
|
||||
der Ausgabe nicht dargestellt und vor allem dazu verwendet, die
|
||||
Templates verständlicher aufzubauen. Smarty Kommentare werden
|
||||
sind in der engültigen Ausgabe NICHT dargestellt. (im Gegensatz zu
|
||||
<!-- HTML Kommentaren -->). Sie sind nützlich um in den
|
||||
Templates interne Anmerkungen zu hinterlassen.
|
||||
</para>
|
||||
<example>
|
||||
<title>Kommentare</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
<body>
|
||||
{* Dies ist ein einzeiliger Kommentar *}
|
||||
|
||||
{* dies ist ein mehrzeiliger
|
||||
Kommentar, der nicht zum
|
||||
Browser gesandt wird.
|
||||
*}
|
||||
</body>
|
||||
|
||||
{* einbinden des Header-Templates *}
|
||||
{include file="header.tpl"}
|
||||
|
||||
{* Entwicklernotiz: $includeFile wurde in 'foo.php' zugewiesen *}
|
||||
{include file=$includeFile}
|
||||
|
||||
{include file=#includeFile#}
|
||||
|
||||
{* Ausgabe der drop-down Liste *}
|
||||
{* Dieser <select> Block ist überflüssig *}
|
||||
{*
|
||||
<select name=firma>
|
||||
{html_options options=$vals selected=$selected}
|
||||
</select>
|
||||
*}
|
||||
]]>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.syntax.functions">
|
||||
<title>Funktionen</title>
|
||||
<para>
|
||||
Jedes Smarty-Tag gibt entweder eine <link
|
||||
linkend="language.variables">Variable</link> aus oder ruft eine
|
||||
Funktion auf. Funktionen werden aufgerufen indem der Funktionsname
|
||||
und die <link linkend="language.syntax.attributes">Parameter</link>
|
||||
mit Trennzeichen umschlossen werden. Beispiel: {funcname attr1="val"
|
||||
attr2="val"}.
|
||||
</para>
|
||||
<example>
|
||||
<title>Funktions-Syntax</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{config_load file="colors.conf"}
|
||||
|
||||
{include file="header.tpl"}
|
||||
|
||||
{if $highlight_name}
|
||||
Welcome, <font color="{#fontColor#}">{$name}!</font>
|
||||
{else}
|
||||
Welcome, {$name}!
|
||||
{/if}
|
||||
|
||||
{include file="footer.tpl"}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Sowohl der Aufruf von <link
|
||||
linkend="language.builtin.functions">eingebauten</link>, als auch
|
||||
der von e<link linkend="language.custom.functions">igenen</link>
|
||||
Funktionen folgt der gleichen Syntax.
|
||||
</para>
|
||||
<para>
|
||||
Eingebaute Funktionen erlauben einige <emphasis
|
||||
role="bold">Basis</emphasis>-Operationen wie <link
|
||||
linkend="language.function.if">if</link>, <link
|
||||
linkend="language.function.section">section</link> und <link
|
||||
linkend="language.function.strip">strip</link>. Diese Funktionen
|
||||
können nicht verändert werden.
|
||||
</para>
|
||||
<para>
|
||||
Individuelle Funktionen die die Fähigkeiten von Smarty erweitern
|
||||
werden als Plugins implementiert. Diese Funktionen können von Ihnen
|
||||
angepasst werden, oder Sie können selbst neue Plugins
|
||||
hinzufügen. <link
|
||||
linkend="language.function.html.options">{html_options}</link> und
|
||||
<link
|
||||
linkend="language.function.html.select.date">{html_select_date}</link>
|
||||
sind Beispiele solcher Funktionen.
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.syntax.quotes">
|
||||
<title>Variablen mit Doppelten Anführungszeichen</title>
|
||||
<para>
|
||||
Smarty erkennt <link linkend="api.assign">zugewiesene</link> <link
|
||||
linkend="language.syntax.variables">Variablen</link> mit doppelten
|
||||
Anführungszeichen solange die Variablen nur Zahlen, Buchstaben,
|
||||
Understriche oder Klammern [] enthalten. Mit allen anderen Zeichen
|
||||
wie Punkt, Objekt Referenzen, etc muss die Vairable mit Backticks
|
||||
(``) umschlossen sein.
|
||||
</para>
|
||||
<example>
|
||||
<title>Syntax von eingebetteten Anfürungszeichen</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
SYNTAX BEISPIELE:
|
||||
{func var="test $foo test"} <-- sieht $foo
|
||||
{func var="test $foo_bar test"} <-- sieht $foo_bar
|
||||
{func var="test $foo[0] test"} <-- sieht $foo[0]
|
||||
{func var="test $foo[bar] test"} <-- sieht $foo[bar]
|
||||
{func var="test $foo.bar test"} <-- sieht $foo (nicht $foo.bar)
|
||||
{func var="test `$foo.bar` test"} <-- sieht $foo.bar
|
||||
{func var="test `$foo.bar` test"|escape} <-- Modifikatoren ausserhalb der Anführungsz.!
|
||||
|
||||
PRAKTISCHE BEISPIELE:
|
||||
{include file="subdir/$tpl_name.tpl"} <-- ersetzt $tpl_name durch wert
|
||||
{cycle values="one,two,`$smarty.config.myval`"} <-- muss Backticks enthalten</programlisting>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Siehe auch <link linkend="language.modifier.escape">escape (Maskieren)</link>.
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,75 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.7 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.syntax.variables">
|
||||
<title>Variablen</title>
|
||||
<para>
|
||||
Templatevariablennamen beginnen mit einem $dollar-Zeichen. Sie
|
||||
können Ziffer, Buchstaben und Unterstriche ('_') enthalten, sehr
|
||||
ähnlich den <ulink
|
||||
url="&url.php-manual;language.variables">Variablen in PHP</ulink>.
|
||||
Numerische Arrayindizes können referenziert werden und auch
|
||||
Nichtnumerische. Zugriff auf Objekteigenschaften und -methoden ist
|
||||
auch möglich.
|
||||
<link
|
||||
linkend="language.config.variables">Konfigurationsvariablen</link>
|
||||
sind einer Ausname was die Dollarzeichen-Syntax angeht. Diese werden
|
||||
durch umgebende #Doppelkreuze# oder über die Varible <link
|
||||
linkend="language.variables.smarty.config">$smarty.config</link>
|
||||
referenziert.
|
||||
</para>
|
||||
<example>
|
||||
<title>Variablen</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$foo} <-- Zeigt einfache Variable an (kein Array oder Objekt)
|
||||
{$foo[4]} <-- Zeigt 5. Element von einem Array an, deren Schlussel bei 0 beginnen
|
||||
{$foo.bar} <-- Zeigt das Element zum Schlüssel "bar" des Arrays an (wie PHPs $foo['bar'])
|
||||
{$foo.$bar} <-- Zeigt das Element eines variablen Schlüssels an (wie PHPs $foo[$bar])
|
||||
{$foo->bar} <-- Zeigt eine Eigenschaft "bar" des Objekts $foo an
|
||||
{$foo->bar()} <-- Zeigt den Rückgabewert der Objectmethode "bar" an
|
||||
{#foo#} <-- Zeift die Konfigurationsvariable "foo" an
|
||||
{$smarty.config.foo} <-- Synonym für {#foo#}
|
||||
{$foo[bar]} <-- Syntax zum zugriff auf Element in einer Section-Schleife, siehe {section}
|
||||
{assign var=foo value="baa"}{$foo} <-- Gibt "baa" aus, siehe {assign}
|
||||
|
||||
Viele weitere Kombinationen sind erlaubt
|
||||
|
||||
{$foo.bar.baz}
|
||||
{$foo.$bar.$baz}
|
||||
{$foo[4].baz}
|
||||
{$foo[4].$baz}
|
||||
{$foo.bar.baz[4]}
|
||||
{$foo->bar($baz,2,$bar)} <-- Parameter übergeben
|
||||
{"foo"} <-- Statische (konstante) Werte sind auch erlaubt
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Siehe auch: <link linkend="language.variables.smarty">Die reservierte
|
||||
{$smarty} Variable</link> und <link
|
||||
linkend="language.config.variables">Verwendung von Variablen aus
|
||||
Konfigurationsdateien</link>.
|
||||
</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
|
||||
-->
|
43
trunk/docs/de/designers/language-builtin-functions.xml
Normal file
43
trunk/docs/de/designers/language-builtin-functions.xml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: andreas Status: ready -->
|
||||
<chapter id="language.builtin.functions">
|
||||
<title>Eingebaute Funktionen</title>
|
||||
<para>
|
||||
Smarty enthält eine Reihe eingebauter Funktionen. Eingebaute Funktionen
|
||||
sind integral für die Template-Sprache. Sie können sie weder
|
||||
verändern noch eigene Funktionen unter selbem Namen erstellen.
|
||||
</para>
|
||||
&designers.language-builtin-functions.language-function-capture;
|
||||
&designers.language-builtin-functions.language-function-config-load;
|
||||
&designers.language-builtin-functions.language-function-foreach;
|
||||
&designers.language-builtin-functions.language-function-if;
|
||||
&designers.language-builtin-functions.language-function-include;
|
||||
&designers.language-builtin-functions.language-function-include-php;
|
||||
&designers.language-builtin-functions.language-function-insert;
|
||||
&designers.language-builtin-functions.language-function-ldelim;
|
||||
&designers.language-builtin-functions.language-function-literal;
|
||||
&designers.language-builtin-functions.language-function-php;
|
||||
&designers.language-builtin-functions.language-function-section;
|
||||
&designers.language-builtin-functions.language-function-strip;
|
||||
</chapter>
|
||||
<!-- 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
|
||||
-->
|
@@ -0,0 +1,129 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.10 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.capture">
|
||||
<title>{capture} (Ausgabe abfangen)</title>
|
||||
<para>
|
||||
{capture} wird verwendet, um die Template-Ausgabe abzufangen und in
|
||||
einer Variable zu speichern. Der Inhalt zwischen {capture
|
||||
name="foo"} und {/capture} wird unter der im 'name' Attribut
|
||||
angegebenen Capture-Variablen abgelegt und kann über <link
|
||||
linkend="language.variables.smarty.capture">$smarty.capture.foo</link>
|
||||
angesprochen werden. Falls kein 'name'-Attribut übergeben wurde,
|
||||
wird der Inhalt in 'default' (also $smarty.capture.default)
|
||||
abgelegt. Jede {capture} Sektion muss mit {/capture} beendet
|
||||
werden. {capture}-Blöcke können verschachtelt sein.
|
||||
</para>
|
||||
<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>Attribut Name</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Benötigt</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>name</entry>
|
||||
<entry>string</entry>
|
||||
<entry>no</entry>
|
||||
<entry><emphasis>default</emphasis></entry>
|
||||
<entry>Der Name des abgefangenen Blocks</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Der Name der Variable welcher der Wert zugewiesen werden soll.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<caution>
|
||||
<para>
|
||||
Seien Sie vorsichtig, wenn sie die Ausgabe von <link
|
||||
linkend="language.function.insert">{insert}</link> abfangen
|
||||
wollen. Sie sollten die Ausgabe nicht abfangen, wenn Caching
|
||||
eingeschaltet ist und Sie einen <link
|
||||
linkend="language.function.insert">{insert}</link> Befehl
|
||||
verwenden, um Ausgaben vom Caching auszuschliessen.
|
||||
</para>
|
||||
</caution>
|
||||
<para>
|
||||
<example>
|
||||
<title>Template-Inhalte abfangen</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
|
||||
{* Tabellenzeile nur ausgeben, wenn Inhalt vorhanden *}
|
||||
{capture name=banner}
|
||||
{include file='get_banner.tpl'}
|
||||
{/capture}
|
||||
{if $smarty.capture.banner ne ""}
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
{$smarty.capture.banner}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{/if}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Template-Inhalte abfangen</title>
|
||||
<para>
|
||||
Hier ist ein Beispiel das das Zusammenspiel mit der Funktion <link
|
||||
linkend="language.function.popup">{popup}</link> demonstriert.
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{capture name=some_content assign=popText}
|
||||
.... some content ....
|
||||
{/capture}
|
||||
|
||||
<a href="#" {popup caption='Help' text=$popText}>help</a>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
Siehe auch:
|
||||
<link
|
||||
linkend="language.variables.smarty.capture">$smarty.capture</link>,
|
||||
<link linkend="language.function.eval">{eval}</link>,
|
||||
<link linkend="language.function.fetch">{fetch}</link>,
|
||||
<link linkend="api.fetch">fetch()</link>
|
||||
and <link linkend="language.function.assign">{assign}</link>.
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,180 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.11 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.config.load">
|
||||
<title>{config_load} (Konfiguration laden)</title>
|
||||
<para>
|
||||
Diese Funktion wird verwendet, um <link
|
||||
linkend="language.config.variables">Variablen aus einer
|
||||
Konfigurationsdatei</link> in das Template zu laden. Sehen sie
|
||||
<link linkend="config.files">Config Files
|
||||
(Konfigurationsdateien)</link> für weitere Informationen.
|
||||
</para>
|
||||
<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>Attribut Name</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>file</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Ja</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Definiert den Namen der einzubindenden Datei.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>section</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Definiert den Namen des zu ladenden Abschnitts.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>scope</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>local</emphasis></entry>
|
||||
<entry>
|
||||
Definiert den Geltungsbereich der zu ladenden Variablen.
|
||||
Erlaubte Werte sind 'local','parent' und 'global'. 'local'
|
||||
bedeutet, dass die Variablen in den Context des lokalen Template
|
||||
geladen werden. 'parent' bedeutet, dass die Variablen sowohl in
|
||||
den lokalen Context, als auch in den Context des aufrufenden
|
||||
Templates eingebunden werden. 'global' bedeutet, dass die
|
||||
Variablen von allen Templates zugänglich sind.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>global</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>No</emphasis></entry>
|
||||
<entry>
|
||||
Definiert, ob die Variablen von allen Templates aus zugänglich
|
||||
sind. WICHTIG: Dieses Attribut wird von 'scope' abgelöst und
|
||||
sollte nicht mehr verwendet werden. Falls 'scope' übergeben
|
||||
wurde, wird 'global' ignoriert.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<example>
|
||||
<title>Funktion {config_load}</title>
|
||||
<para>
|
||||
beispiel.conf
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
#Dies ist ein Konfigurationsdateikommentar
|
||||
|
||||
# globale Variablen
|
||||
seitenTitel = "Hauptmenü"
|
||||
bodyHintergrundFarbe = #000000
|
||||
tabelleHintergrundFarbe = #000000
|
||||
reiheHintergrundFarbe = #00ff00
|
||||
|
||||
# Kundenvariablen
|
||||
[Kunden]
|
||||
seitenTitel = "Kundeninfo"
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>and the template</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{config_load file='example.conf'}
|
||||
|
||||
<html>
|
||||
<title>{#seitenTitel#}</title>
|
||||
<body bgcolor="{#bodyHintergrundFarbe#}">
|
||||
<table border="{#tabelleRahmenBreite#}" bgcolor="{#tabelleHintergrundFarbe#}">
|
||||
<tr bgcolor="{#reiheHintergrundFarbe#}">
|
||||
<td>Vornamen</td>
|
||||
<td>Nachnamen</td>
|
||||
<td>Adresse</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
<link linkend="config.files">Konfigurationsdateien</link> können
|
||||
Abschnitte enthalten. Um Variablen aus einem Abschnitt zu laden,
|
||||
können Sie das Attribut <emphasis>section</emphasis> übergeben.
|
||||
</para>
|
||||
<para>
|
||||
Bemerkung: <emphasis>Konfigurationdatei-Abschnitte
|
||||
(sections)</emphasis> und die eingebaute Template Funktion namens
|
||||
<link linkend="language.function.section">section</link> haben ausser
|
||||
dem Namen nichts gemeinsam.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Funktion {config_load} mit Abschnitten</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{config_load file="beispiel.conf" section="Kunde"}
|
||||
<html>
|
||||
<title>{#seitenTitel#}</title>
|
||||
<body bgcolor="{#bodyHintergrundFarbe#}">
|
||||
<table border="{#tabelleRahmenBreite#}" bgcolor="{#tabelleHintergrundFarbe#}">
|
||||
<tr bgcolor="{#reiheHintergrundFarbe#}">
|
||||
<td>Vornamen</td>
|
||||
<td>Nachnamen</td>
|
||||
<td>Adresse</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Siehe <link
|
||||
linkend="variable.config.overwrite">$config_overwrite</link>
|
||||
bezüglich Arrays von Konfigurationsvariablen.
|
||||
</para>
|
||||
<para>
|
||||
Siehe auch <link
|
||||
linkend="config.files">Konfigurationsdateien</link>, <link
|
||||
linkend="language.config.variables">Variablen aus
|
||||
Konfigurationsdateien</link>, <link
|
||||
linkend="variable.config.dir">$config_dir</link>, <link
|
||||
linkend="api.get.config.vars">get_config_vars()</link> und <link
|
||||
linkend="api.config.load">config_load()</link>.
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,235 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.8 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.foreach">
|
||||
<title>{foreach}, {foreachelse}</title>
|
||||
<para>
|
||||
Die <emphasis>foreach</emphasis> Schleife ist eine Alternative zu
|
||||
<link
|
||||
linkend="language.function.section"><emphasis>section</emphasis></link>.
|
||||
<emphasis>foreach</emphasis> wird verwendet, um ein assoziatives
|
||||
Array zu durchlaufen. Die Syntax von
|
||||
<emphasis>foreach</emphasis>-Schleifen ist viel einfacher als die
|
||||
von <emphasis>section</emphasis>. <emphasis>{foreach}</emphasis>
|
||||
Tags müssen mit <emphasis>{/foreach}</emphasis> tags kombiniert
|
||||
werden. Erforderliche Parameter sind: <emphasis>from</emphasis> und
|
||||
<emphasis>item</emphasis>. Der Name der {foreach}-Schleife kann
|
||||
frei vergeben werden und sowohl Buchstaben, Zahlen als auch
|
||||
Unterstriche enthalten. <emphasis>foreach</emphasis>-Schleifen
|
||||
können verschachtelt werden, dabei ist zu beachten, dass sich die
|
||||
definierten Namen voneinander unterscheiden. Die
|
||||
<emphasis>from</emphasis> Variable (normalerweise ein assoziatives
|
||||
Array) definiert die Anzahl der von <emphasis>foreach</emphasis> zu
|
||||
durchlaufenen Iterationen. <emphasis>foreachelse</emphasis> wird
|
||||
ausgeführt wenn keine Werte in der <emphasis>from</emphasis>
|
||||
Variable übergeben wurden.
|
||||
</para>
|
||||
<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>Attribut Name</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>from</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Ja</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Name des zu durchlaufenden Array.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>item</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Ja</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Name für das aktuelle Element.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>key</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Name für den aktuellen Schlüssel.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>name</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Name der 'foreach'-Schleife, für die Abfrage der 'foreach'-Eigenschaften.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<example>
|
||||
<title>{foreach} - item</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$arr = array( 1001,1002,1003);
|
||||
$smarty->assign('custid', $arr);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
<?php
|
||||
{* dieses Beispiel gibt alle Werte aus dem $KundenId Array aus *}
|
||||
{foreach from=$KundenId item=aktuelle_id}
|
||||
id: {$aktuelle_id}<br>
|
||||
{/foreach}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Das obige Beispiel erzeugt folgende Ausgabe:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
id: 1000<br>
|
||||
id: 1001<br>
|
||||
id: 1002<br>
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>{foreach} - item und key</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
// Der Schlüssel enthält den Schlüssel des jeweils iterierten Wertes
|
||||
// die Zuweisung sieht wie folgt aus:
|
||||
<?php
|
||||
$smarty->assign('kontakte', array(
|
||||
array('phone' => '1',
|
||||
'fax' => '2',
|
||||
'cell' => '3'),
|
||||
array('phone' => '555-4444',
|
||||
'fax' => '555-3333',
|
||||
'cell' => '760-1234')
|
||||
));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{foreach name=aussen item=kontakt from=$kontakte}
|
||||
<hr />
|
||||
{foreach key=schluessel item=wert from=$kontakt}
|
||||
{$schluessel}: {$wert}<br>
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
</programlisting>
|
||||
<para>
|
||||
Das obige Beispiel erzeugt folgende Ausgabe:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
<hr />
|
||||
phone: 1<br>
|
||||
fax: 2<br>
|
||||
cell: 3<br>
|
||||
<hr />
|
||||
phone: 555-4444<br>
|
||||
fax: 555-3333<br>
|
||||
cell: 760-1234<br>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>{foreach} - Beispiel mit Datenbankzugriff (z.B. PEAR oder ADODB)</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$sql = 'SELECT contact_id, name, nick FROM contacts ORDER BY contact';
|
||||
$smarty->assign('kontakte', $db->getAssoc($sql));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{foreach key=cid item=con from=$kontakte}
|
||||
<a href="kontact.php?contact_id={$cid}">{$con.name} - {$con.nick}</a><br />
|
||||
{/foreach}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
Foreach-Loops haben auch eigene Variablen welche die Foreach
|
||||
Eigenschaften enthalten. Diese werden wie folgt ausgewiesen:
|
||||
{$smarty.foreach.foreachname.varname}. foreachname ist der Name der
|
||||
als <emphasis>name</emphasis> Attribut von Foreach übergeben wurden.
|
||||
</para>
|
||||
|
||||
<sect2 id="foreach.property.iteration">
|
||||
<title>iteration</title>
|
||||
<para>
|
||||
gibt die aktuelle iteration aus
|
||||
</para>
|
||||
<para>
|
||||
iteration beginnt immer mit 1 und wird danach bei jedem durchgang um 1 inkrementiert.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="foreach.property.first">
|
||||
<title>first</title>
|
||||
<para>
|
||||
<emphasis>first</emphasis> ist TRUE wenn die aktuelle Iteration die erste ist
|
||||
</para>
|
||||
</sect2>
|
||||
<sect2 id="foreach.property.last">
|
||||
<title>last</title>
|
||||
<para>
|
||||
<emphasis>last</emphasis> ist TRUE wenn die aktuelle Iteration die letzte ist
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="foreach.property.show">
|
||||
<title>show</title>
|
||||
<para>
|
||||
<emphasis>show</emphasis> wird als Parameter von foreach verwedet
|
||||
und ist ein boolscher Wert, TRUE oder FALSE. Auf FALSE wird nichts
|
||||
ausgegeben und wenn foreachelse gefunden wird, dieser angezeigt.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="foreach.property.total">
|
||||
<title>total</title>
|
||||
<para>
|
||||
<emphasis>total</emphasis> gibt die Anzahl Iterationen des Foreach
|
||||
Loops aus und kann in- oder nach- Foreach Blöcken verwendet werden.
|
||||
</para>
|
||||
</sect2>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,253 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.8 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.if">
|
||||
<title>{if},{elseif},{else}</title>
|
||||
<para>
|
||||
<emphasis>{if}</emphasis>-Statements in Smarty erlauben die selbe
|
||||
Flexibilität wie in PHP, bis auf ein paar Erweiterungen für die
|
||||
Template-Engine. Jedes <emphasis>{if}</emphasis> muss mit einem
|
||||
<emphasis>{/if}</emphasis> kombiniert
|
||||
sein. <emphasis>{else}</emphasis> und <emphasis>{elseif}</emphasis>
|
||||
sind ebenfalls erlaubt. Alle PHP Vergleichsoperatoren und Funktionen, wie
|
||||
<emphasis>||</emphasis>, <emphasis>or</emphasis>,
|
||||
<emphasis>&&</emphasis>, <emphasis>and</emphasis>,
|
||||
<emphasis>is_array()</emphasis>, etc. sind erlaubt.
|
||||
</para>
|
||||
<para>
|
||||
Wenn <link linkend="variable.security">$security</link> angeschaltet
|
||||
wurde, dann müssen alle verwendeten PHP-Funktionen im
|
||||
<emphasis>IF_FUNCS</emphasis>-Array in dem <link
|
||||
linkend="variable.security.settings">$security_settings</link>-Array
|
||||
deklariert werden.
|
||||
</para>
|
||||
<para>
|
||||
Hier eine Liste der erlaubten Operatoren. Bedingungsoperatoren
|
||||
müssen von umgebenden Elementen mit Leerzeichen abgetrennt werden.
|
||||
PHP-Äquivalente sind, sofern vorhanden, angeben.
|
||||
</para>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="Operator" align="center" />
|
||||
<colspec colname="Alternativen" align="center" />
|
||||
<colspec colname="Syntax Beispiel" />
|
||||
<colspec colname="Bedeutung" />
|
||||
<colspec colname="PHP Äquivalent" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Operator</entry>
|
||||
<entry>Alternativen</entry>
|
||||
<entry>Syntax Beispiel</entry>
|
||||
<entry>Bedeutung</entry>
|
||||
<entry>PHP Äquivalent</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>==</entry>
|
||||
<entry>eq</entry>
|
||||
<entry>$a eq $b</entry>
|
||||
<entry>ist gleich</entry>
|
||||
<entry>==</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>!=</entry>
|
||||
<entry>ne, neq</entry>
|
||||
<entry>$a neq $b</entry>
|
||||
<entry>ist ungleich</entry>
|
||||
<entry>!=</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>></entry>
|
||||
<entry>gt</entry>
|
||||
<entry>$a gt $b</entry>
|
||||
<entry>größer als</entry>
|
||||
<entry>></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><</entry>
|
||||
<entry>lt</entry>
|
||||
<entry>$a lt $b</entry>
|
||||
<entry>kleiner als</entry>
|
||||
<entry><</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>>=</entry>
|
||||
<entry>gte, ge</entry>
|
||||
<entry>$a ge $b</entry>
|
||||
<entry>größer oder gleich</entry>
|
||||
<entry>>=</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><=</entry>
|
||||
<entry>lte, le</entry>
|
||||
<entry>$a le $b</entry>
|
||||
<entry>kleiner oder gleich</entry>
|
||||
<entry><=</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>===</entry>
|
||||
<entry></entry>
|
||||
<entry>$a === 0</entry>
|
||||
<entry>identisch</entry>
|
||||
<entry>===</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>!</entry>
|
||||
<entry>not</entry>
|
||||
<entry>not $a</entry>
|
||||
<entry>Negation</entry>
|
||||
<entry>!</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>%</entry>
|
||||
<entry>mod</entry>
|
||||
<entry>$a mod $b</entry>
|
||||
<entry>Modulo</entry>
|
||||
<entry>%</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>is [not] div by</entry>
|
||||
<entry></entry>
|
||||
<entry>$a is not div by 4</entry>
|
||||
<entry>Ist [nicht] teilbar durch</entry>
|
||||
<entry>$a % $b == 0</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>is [not] even</entry>
|
||||
<entry></entry>
|
||||
<entry>$a is not even</entry>
|
||||
<entry>ist [k]eine gerade Zahl</entry>
|
||||
<entry>$a % 2 == 0</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>is [not] even by</entry>
|
||||
<entry></entry>
|
||||
<entry>$a is [not] even by $b</entry>
|
||||
<entry>[k]eine gerade Gruppierung</entry>
|
||||
<entry>($a / $b) % 2 == 0</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>is [not] odd</entry>
|
||||
<entry></entry>
|
||||
<entry>$a is not odd</entry>
|
||||
<entry>ist [k]eine ungerade Zahl</entry>
|
||||
<entry>$a % 2 != 0</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>is [not] odd by</entry>
|
||||
<entry></entry>
|
||||
<entry>$a is not odd by $b</entry>
|
||||
<entry>[k]eine ungerade Gruppierung</entry>
|
||||
<entry>($a / $b) % 2 != 0</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<example>
|
||||
<title>if Anweisung</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* ein Beispiel mit 'eq' (gleich) *}
|
||||
{if $name eq "Fred"}
|
||||
Willkommen der Herr.
|
||||
{elseif $name eq "Wilma"}
|
||||
Willkommen die Dame.
|
||||
{else}
|
||||
Willkommen, was auch immer Du sein magst.
|
||||
{/if}
|
||||
|
||||
{* ein Beispiel mit 'or'-Logik *}
|
||||
{if $name eq "Fred" or $name eq "Wilma"}
|
||||
...
|
||||
{/if}
|
||||
|
||||
{* das selbe *}
|
||||
{if $name == "Fred" || $name == "Wilma"}
|
||||
...
|
||||
{/if}
|
||||
|
||||
{*
|
||||
die foldende Syntax ist nicht korrekt, da die Elemente welche die
|
||||
Bedingung umfassen nicht mit Leerzeichen abgetrennt sind
|
||||
*}
|
||||
{if $name=="Fred" || $name=="Wilma"}
|
||||
...
|
||||
{/if}
|
||||
|
||||
|
||||
{* Klammern sind erlaubt *}
|
||||
{if ( $anzahl < 0 or $anzahl > 1000 ) and $menge >= #minMengeAmt#}
|
||||
...
|
||||
{/if}
|
||||
|
||||
|
||||
{* einbetten von php Funktionsaufrufen ('gt' steht für 'grösser als') *}
|
||||
{if count($var) gt 0}
|
||||
...
|
||||
{/if}
|
||||
|
||||
{* Auf "ist array" überprüfen. *}
|
||||
{if is_array($foo) }
|
||||
.....
|
||||
{/if}
|
||||
|
||||
{* Auf "ist nicht null" überprüfen. *}
|
||||
{if isset($foo) }
|
||||
.....
|
||||
{/if}
|
||||
|
||||
|
||||
|
||||
{* testen ob eine Zahl gerade (even) oder ungerade (odd) ist *}
|
||||
{if $var is even}
|
||||
...
|
||||
{/if}
|
||||
{if $var is odd}
|
||||
...
|
||||
{/if}
|
||||
{if $var is not odd}
|
||||
...
|
||||
{/if}
|
||||
|
||||
|
||||
{* testen ob eine Zahl durch 4 teilbar ist (div by) *}
|
||||
{if $var is div by 4}
|
||||
...
|
||||
{/if}
|
||||
|
||||
|
||||
{* testen ob eine Variable gerade ist, gruppiert nach 2
|
||||
0=gerade, 1=gerade, 2=ungerade, 3=ungerade, 4=gerade, 5=gerade, etc *}
|
||||
{if $var is even by 2}
|
||||
...
|
||||
{/if}
|
||||
|
||||
{* 0=gerade, 1=gerade, 2=gerade, 3=ungerade, 4=ungerade, 5=ungerade, etc *}
|
||||
{if $var is even by 3}
|
||||
...
|
||||
{/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
|
||||
-->
|
@@ -0,0 +1,138 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.9 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.include.php">
|
||||
<title>include_php (PHP-Code einbinden)</title>
|
||||
<para>
|
||||
Die Verwendung von {include_php} wird nicht mehr empfohlen, die
|
||||
gleiche funktionalität kann auch mit <link
|
||||
linkend="tips.componentized.templates">Template/Script
|
||||
Komponenten</link> erreicht werden.
|
||||
</para>
|
||||
<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>Attribut Name</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>file</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Ja</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Der Name der einzubindenden PHP-Datei.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>once</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>true</emphasis></entry>
|
||||
<entry>Definiert ob die Datei mehrmals geladen werden soll, falls sie mehrmals eingebunden wird.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Der Name der Variable, der die Ausgabe von include_php zugewiesen wird.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Falls <link linkend="variable.security">Sicherheit</link> aktiviert
|
||||
ist, muss das einzubindende Skript im <link
|
||||
linkend="variable.trusted.dir">$trusted_dir</link> Pfad
|
||||
liegen. {include_php} muss das Attribut 'file' übergeben werden, das
|
||||
den Pfad - entweder relativ zu <link
|
||||
linkend="variable.trusted.dir">$trusted_dir</link> oder absolut -
|
||||
zum Skript enthält.
|
||||
</para>
|
||||
<para>
|
||||
Normalerweise wird ein PHP-Skript nur einmal pro Aufruf geladen,
|
||||
selbst wenn es mehrfach eingebunden wird. Sie können dieses
|
||||
Verhalten durch die Verwendung des <emphasis>once</emphasis>
|
||||
Attributs steuern. Wenn Sie 'once' auf 'false' setzen, wird die
|
||||
Datei immer wenn sie eingebunden wird auch neu geladen.
|
||||
</para>
|
||||
<para>
|
||||
Optional kann das <emphasis>assign</emphasis> Attribut übergeben
|
||||
werden. Die Ausgabe von <emphasis>include_php</emphasis> wird dann
|
||||
nicht direkt eingefügt, sondern in der durch assign benannten
|
||||
Template-Variable abgelegt.
|
||||
</para>
|
||||
<para>
|
||||
Das Objekt '$smarty' kann in dem eingebundenen PHP-Script über
|
||||
'$this' angesprochen werden.
|
||||
</para>
|
||||
<example>
|
||||
<title>Funktion include_php</title>
|
||||
<para>lade_nav.php</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
// lade die Variablen aus einer MySQL-Datenbank und weise sie dem Template zu
|
||||
require_once("MySQL.class.php");
|
||||
$sql = new MySQL;
|
||||
$sql->query("select * from site_nav_sections order by name",SQL_ALL);
|
||||
$this->assign($sections,$sql->record);
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Bei folgendem index.tpl:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* absoluter Pfad, oder relativ zu '$trusted_dir' *}
|
||||
{include_php file="/pfad/zu/lade_nav.php"}
|
||||
|
||||
{foreach item=$aktuelle_section from=$sections}
|
||||
<a href="{$aktuelle_section.url}">{$aktuelle_section.name}</a><br>
|
||||
{/foreach}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Siehe auch <link
|
||||
linkend="language.function.include">{include}</link>, <link
|
||||
linkend="language.function.php">{php}</link>, <link
|
||||
linkend="language.function.capture">{capture}</link>, <link
|
||||
linkend="template.resources">Template Ressourcen</link> and <link
|
||||
linkend="tips.componentized.templates">Template/Script
|
||||
Komponenten</link>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,163 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.10 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.include">
|
||||
<title>include (einbinden)</title>
|
||||
<para>
|
||||
{include}-Tags werden verwendet, um andere Templates in das aktuelle
|
||||
Template einzubinden. Alle Variablen des aktuellen Templates sind
|
||||
auch im eingebundenen Template verfügbar. Das {include}-Tag muss ein
|
||||
'file' Attribut mit dem Pfad zum einzubindenden Template enthalten.
|
||||
</para>
|
||||
<para>
|
||||
Optional kann mit dem <emphasis>assign</emphasis> Attribut definiert
|
||||
werden, in welcher Variable die Ausgabe des mit
|
||||
<emphasis>include</emphasis> eingebundenen Templates abgelegt werden
|
||||
soll statt sie auszugeben.
|
||||
</para>
|
||||
<para>
|
||||
Die Werte aller zugewiesenen Variablen werden wiederhergestellt, sobald
|
||||
ein eingebundenes Template wieder verlassen wurde. Das bedeutet, dass in
|
||||
einem eingebundenen Template alle Variablen des einbindenden Template
|
||||
verwendet und verändert werden können, diese Änderungen aber verloren sind,
|
||||
sobald das {include} abgearbeitet wurde.
|
||||
</para>
|
||||
<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>Attribut Name</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>file</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Ja</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Name der Template-Datei, die eingebunden werden soll.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Variable, welcher der eingebundene Inhalt zugewiesen werden soll.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>[var ...]</entry>
|
||||
<entry>[var typ]</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Variablen welche dem Template lokal übergeben werden sollen.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<example>
|
||||
<title>function include (einbinden)</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
<html>
|
||||
<head>
|
||||
<title>{$title}</title>
|
||||
</head>
|
||||
<body>
|
||||
{include file='page_header.tpl'}
|
||||
|
||||
{* hier kommt der body des Templates *}
|
||||
{include file="$tpl_name.tpl"} <-- $tpl_name wird durch eine Wert ersetzt
|
||||
|
||||
{include file='page_footer.tpl'}
|
||||
</body>
|
||||
</html>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Sie können dem einzubindenden Template Variablen als Attribute
|
||||
übergeben. Alle explizit übergebenen Variablen sind nur im
|
||||
Anwendungsbereich (scope) dieses Template
|
||||
verfügbar. Attribut-Variablen überschreiben aktuelle
|
||||
Template-Variablen, falls sie den gleichen Namen haben.
|
||||
</para>
|
||||
<example>
|
||||
<title>include-Funktion und Variablen Übergabe</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{include file='header.tpl' title='Hauptmenu' table_bgcolor='#c0c0c0'}
|
||||
|
||||
{* hier kommt der body des Templates *}
|
||||
|
||||
{include file='footer.tpl' logo='http://my.domain.com/logo.gif'}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Benutzen sie die Syntax von <link
|
||||
linkend="template.resources">template resources</link>, um Templates
|
||||
ausserhalb des '$template_dir' einzubinden:
|
||||
</para>
|
||||
<example>
|
||||
<title>Beispiele für Template-Ressourcen bei der 'include'-Funktion</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* absoluter Dateipfad *}
|
||||
{include file='/usr/local/include/templates/header.tpl'}
|
||||
|
||||
{* absoluter Dateipfad (gleich) *}
|
||||
{include file='file:/usr/local/include/templates/header.tpl'}
|
||||
|
||||
{* absoluter Dateipfad unter Windows ("file:"-Prefix MUSS übergeben werden) *}
|
||||
{include file='file:C:/www/pub/templates/header.tpl'}
|
||||
|
||||
{* einbinden aus Template-Ressource namens 'db' *}
|
||||
{include file='db:header.tpl'}
|
||||
|
||||
{* einbinden eines Variablen Templates - z.B. $module = 'contacts' *}
|
||||
{include file="$module.tpl"}
|
||||
{*
|
||||
Dies hier Funktioniert nicht, da Variablen innerhalb einfacher
|
||||
Anführungszeichen nicht interpoliert werden.
|
||||
*}
|
||||
{include file='$module.tpl'}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Siehe auch
|
||||
<link linkend="language.function.include.php">{include_php}</link>,
|
||||
<link linkend="language.function.php">{php}</link>,
|
||||
<link linkend="template.resources">Template Ressourcen</link> und
|
||||
<link linkend="tips.componentized.templates">Template/Skript Komponenten</link>.
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,146 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.insert">
|
||||
<title>insert (einfügen)</title>
|
||||
<para>
|
||||
{insert}-Tags funktionieren ähnlich den <link
|
||||
linkend="language.function.include">{include}</link>-Tags, werden
|
||||
aber nicht gecached, falls <link linkend="caching">caching</link>
|
||||
eingeschaltet ist. Sie werden bei jedem Aufruf des Templates
|
||||
ausgeführt.
|
||||
</para>
|
||||
<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>Attribut Name</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>name</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Ja</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Der Name der Insert-Funktion</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Name der Template-Variable, in der die Ausgabe der 'insert'-Funktion optional abgelegt wird.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>script</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Name des PHP-Skriptes, das vor Aufruf der 'insert'-Funktion eingebunden werden soll.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>[var ...]</entry>
|
||||
<entry>[var typ]</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Variablen die der 'insert'-Funktion übergeben werden sollen.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Stellen Sie sich vor, sie hätten ein Template mit einem
|
||||
Werbebanner. Dieser Banner kann verschiedene Arten von Inhalten
|
||||
haben: Bilder, HTML, Flash, etc. Deshalb können wir nicht einfach
|
||||
einen statischen Link verwenden und müssen vermeiden, dass dieser
|
||||
Inhalt gecached wird. Hier kommt das {insert}-Tag ins Spiel. Das
|
||||
Template kennt die Variablen '#banner_location_id#' und '#site_id#'
|
||||
(zum Beispiel aus einer <link
|
||||
linkend="config.files">Konfigurationsdatei</link>) und soll eine
|
||||
Funktion aufrufen, die den Inhalt des Banners liefert.
|
||||
</para>
|
||||
<example>
|
||||
<title>Funktion 'insert'</title>
|
||||
<programlisting>
|
||||
{* erzeugen des Banners *}
|
||||
{insert name="getBanner" lid=#banner_location_id# sid=#site_id#}
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
In diesem Beispiel verwenden wir die Funktion 'getBanner' und
|
||||
übergeben die Parameter '#banner_location_id#' und '#site_id#'.
|
||||
Smarty wird daraufhin in Ihrer Applikatiopn nach einer Funktion
|
||||
namens 'getBanner' suchen und diese mit den Parametern
|
||||
'#banner_location_id#' und '#site_id#' aufrufen. Allen
|
||||
'insert'-Funktionen in Ihrer Applikation muss 'insert_'
|
||||
vorangestellt werden, um Konflikte im Namensraum zu vermeiden. Ihre
|
||||
'insert_getBanner()'-Funktion sollte etwas mit den übergebenen
|
||||
Parametern unternehmen und das Resultat zurückgeben. Dieses
|
||||
Resultat wird an der Stelle des 'insert'-Tags in Ihrem Template
|
||||
ausgegeben. In diesem Beispiel würde Smarty folgende Funktion
|
||||
aufrufen: insert_getBanner(array("lid" => "12345","sid" => "67890"))
|
||||
und die erhaltenen Resultate an Stelle des 'insert'-Tags ausgeben.
|
||||
</para>
|
||||
<para>
|
||||
Falls Sie das 'assign'-Attribut übergeben, wird die Ausgabe des
|
||||
'insert'-Tags in dieser Variablen abgelegt. Bemerkung: dies ist
|
||||
nicht sinnvoll, wenn <link linkend="variable.caching">Caching</link>
|
||||
eingeschaltet ist.
|
||||
</para>
|
||||
<para>
|
||||
Falls Sie das 'script'-Attribut übergeben, wird das angegebene
|
||||
PHP-Skript vor der Ausführung der {insert}-Funktion eingebunden.
|
||||
Dies ist nützlich, um die {insert}-Funktion erst in diesem Skript zu
|
||||
definieren. Der Pfad kann absolut oder relativ zu <link
|
||||
linkend="variable.trusted.dir">$trusted_dir</link> angegeben werden.
|
||||
Wenn Sicherheit eingeschaltet ist, muss das Skript in <link
|
||||
linkend="variable.trusted.dir">$trusted_dir</link> liegen.
|
||||
</para>
|
||||
<para>
|
||||
Als zweites Argument wird der {insert}-Funktion das Smarty-Objekt
|
||||
selbst übergeben. Damit kann dort auf die Informationen im
|
||||
Smarty-Objekt zugegriffen werden.
|
||||
</para>
|
||||
<note>
|
||||
<title>Technische Bemerkung</title>
|
||||
<para>
|
||||
Es gibt die Möglichkeit, Teile des Templates nicht zu cachen. Wenn
|
||||
Sie <link linkend="caching">caching</link> eingeschaltet haben,
|
||||
werden {insert}-Tags nicht gecached. Sie werden jedesmal
|
||||
ausgeführt, wenn die Seite erstellt wird - selbst innerhalb
|
||||
gecachter Seiten. Dies funktioniert gut für Dinge wie Werbung
|
||||
(Banner), Abstimmungen, Wetterberichte, Such-Resultate,
|
||||
Benutzer-Feedback-Ecke, etc.
|
||||
</para>
|
||||
</note>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.9 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.ldelim">
|
||||
<title>ldelim,rdelim (Ausgabe der Trennzeichen)</title>
|
||||
<para>
|
||||
ldelim und rdelim werden verwendet, um die Trennzeichen auszugeben -
|
||||
in unserem Fall "{" oder "}" - ohne dass Smarty versucht, sie zu
|
||||
interpretieren. Um text im Template vor dem Interpretieren zu
|
||||
schützen kann auch <link
|
||||
linkend="language.function.literal">{literal}{/literal}</link>
|
||||
verwendet werden. Siehe auch <link
|
||||
linkend="language.variables.smarty.ldelim">{$smarty.ldelim}</link>.
|
||||
</para>
|
||||
<example>
|
||||
<title>ldelim, rdelim</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* gibt die konfigurierten Trennzeichen des Templates aus *}
|
||||
|
||||
{ldelim}funktionsname{rdelim} Funktionen sehen in Smarty so aus!
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Das obige Beispiel ergibt als Ausgabe:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
{funktionsname} Funktionen sehen in Smarty so aus!</programlisting>
|
||||
]]>
|
||||
</screen>
|
||||
<para>
|
||||
Ein weiteres Beispiel (diesmal mit javascript)
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
<script language="JavaScript">
|
||||
function foo() {ldelim}
|
||||
... code ...
|
||||
{rdelim}
|
||||
</script>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ausgabe:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
<script language="JavaScript">
|
||||
function foo() {
|
||||
.... code ...
|
||||
}
|
||||
</script>
|
||||
]]>
|
||||
</screen>
|
||||
|
||||
</example>
|
||||
<para>
|
||||
Siehe auch <link linkend="language.escaping">Smarty Parsing umgehen</link>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.9 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.literal">
|
||||
<title>literal</title>
|
||||
<para>
|
||||
{literal}-Tags erlauben es, einen Block wörtlich auszugeben,
|
||||
d.h. von der Interpretation durch Smarty auszuschliessen. Dies ist
|
||||
vor allem für Javascript- oder andere Blöcke nützlich, die
|
||||
geschwungene Klammern verwenden. Alles was zwischen den
|
||||
{literal}{/literal} Tags steht, wird direkt angezeigt. Wenn in
|
||||
einem {literal}-Block temlate-Tags verwendet werden sollen, is es
|
||||
manchmal sinnvoller <link
|
||||
linkend="language.function.ldelim">{ldelim}{rdelim}</link> statt
|
||||
{literal} zu verwenden.
|
||||
</para>
|
||||
<example>
|
||||
<title>literal-Tags</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{literal}
|
||||
<script language=javascript>
|
||||
<!--
|
||||
function isblank(field) {
|
||||
if (field.value == '') {
|
||||
return false;
|
||||
} else {
|
||||
document.loginform.submit();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
{/literal}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Siehe auch <link linkend="language.escaping">Smarty Parsing
|
||||
umgehen</link>.
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,75 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.7 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.php">
|
||||
<title>php</title>
|
||||
<para>
|
||||
{php}-Tags erlauben es, PHP-Code direkt in das Template
|
||||
einzubetten. Der Inhalt wird nicht 'escaped', egal wie <link
|
||||
linkend="variable.php.handling">$php_handling</link> konfiguriert
|
||||
ist. Dieses Tag ist nur für erfahrene Benutzer gedacht und wird
|
||||
auch von diesen normalerweise nicht benötigt.
|
||||
</para>
|
||||
<example>
|
||||
<title>{php}-Tags</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{php}
|
||||
// php Skript direkt von Template einbinden
|
||||
include('/pfad/zu/zeige_weather.php');
|
||||
{/php}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<note>
|
||||
<title>Technical Note</title>
|
||||
<para>
|
||||
Um auf PHP-Variablen in {php}-Blöcken zugreifen zu können, kann es
|
||||
nötig sein, die Variable als <ulink
|
||||
url="&url.php-manual;global">global</ulink> zu deklarieren. Der
|
||||
{php}-Blöck läuft nämlich nicht in einem globalen Kontext, sondern
|
||||
im Kontext der method des laufenden $smarty-Objektes.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>{php} mit Verwendung von global</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
{php}
|
||||
global $foo, $bar;
|
||||
if($foo == $bar){
|
||||
// tue irgendwas
|
||||
}
|
||||
{/php}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Siehe auch <link
|
||||
linkend="variable.php.handling">$php_handling</link>, <link
|
||||
linkend="language.function.include.php">{include_php}</link>, <link
|
||||
linkend="language.function.include">{include}</link> und <link
|
||||
linkend="tips.componentized.templates">Template/Script
|
||||
Komponenten</link>.
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,782 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.14 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.section">
|
||||
<title>section,sectionelse</title>
|
||||
<para>
|
||||
Template-{sections} werden verwendet, um durch <emphasis
|
||||
role="bold">Arrays</emphasis> zu iterieren (ähnlich wie <link
|
||||
linkend="language.function.foreach">{foreach}</link>). Jedes
|
||||
<emphasis>section</emphasis>-Tag muss mit einem
|
||||
<emphasis>/section</emphasis>-Tag kombiniert
|
||||
werden. <emphasis>name</emphasis> und <emphasis>loop</emphasis> sind
|
||||
erforderliche Parameter. Der Name der 'section' kann frei gewählt
|
||||
werden, muss jedoch aus Buchstaben, Zahlen oder Unterstrichen
|
||||
bestehen. {sections} können verschachtelt werden. Dabei ist zu
|
||||
beachten, dass sich ihre Namen unterscheiden. Aus der
|
||||
'loop'-Variable (normalerweise ein Array von Werten) resultiert die
|
||||
Anzahl der Iterationen, die durchlaufen werden. Wenn ein Wert aus
|
||||
der 'loop'-Variable innerhalb der {section} ausgegeben werden soll,
|
||||
muss der 'section-name' umschlossen mit [] angefügt werden.
|
||||
<emphasis>sectionelse</emphasis> wird ausgeführt, wenn keine Werte
|
||||
in der 'loop'-Variable enthalten sind.
|
||||
</para>
|
||||
<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>Attribut Name</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>name</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Ja</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Der Name der 'section'</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>loop</entry>
|
||||
<entry>[$variable_name]</entry>
|
||||
<entry>Ja</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Der Name des Zählers für die Iterationen.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>start</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>0</emphasis></entry>
|
||||
<entry>
|
||||
Definiert die Startposition. Falls ein negativer Wert übergeben
|
||||
wird, berechnet sich die Startposition ausgehend vom Ende des
|
||||
Arrays. Wenn zum Beispiel 7 Werte in einem Array enthalten sind
|
||||
und die Startposition -2 ist, ist die berechnete Startposition
|
||||
5. Unerlaubte Werte (Werte ausserhalb der Grösse des Arrays)
|
||||
werden automatisch auf den nächstmöglichen Wert gesetzt.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>step</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>1</emphasis></entry>
|
||||
<entry>
|
||||
Definiert die Schrittweite mit welcher das Array durchlaufen
|
||||
wird. 'step=2' iteriert durch 0, 2, 4, etc. Wenn ein negativer
|
||||
Wert übergeben wurde, wird das Array rückwärts durchlaufen.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>max</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Maximale Anzahl an Iterationen, die Durchlaufen werden.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>show</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>true</emphasis></entry>
|
||||
<entry>Definiert ob diese 'section' angezeigt werden soll oder nicht.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<example>
|
||||
<title>section</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$data = array(1000,1001,1002);
|
||||
$smarty->assign('custid',$data);
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* dieses Beispiel gibt alle Werte des $KundenId Arrays aus *}
|
||||
{section name=kunde loop=$KundenId}
|
||||
id: {$KundenId[kunde]}<br />
|
||||
{/section}
|
||||
{* alle Werte in umgekehrter Reihenfolge ausgeben: *}
|
||||
{section name=kunde loop=$KundenId step=-1}
|
||||
id: {$KundenId[kunde]}<br />
|
||||
{/section}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ausgabe des obigen Beispiels:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
id: 1000<br />
|
||||
id: 1001<br />
|
||||
id: 1002<br />
|
||||
<hr />
|
||||
id: 1002<br />
|
||||
id: 1001<br />
|
||||
id: 1000<br />
|
||||
]]>
|
||||
</screen>
|
||||
|
||||
<para>
|
||||
Ein weiteres Beispiel, diesmal ohne ein zugewiesenes Array.
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{section name=foo start=10 loop=20 step=2}
|
||||
{$smarty.section.foo.index}
|
||||
{/section}
|
||||
<hr />
|
||||
{section name=bar loop=21 max=6 step=-2}
|
||||
{$smarty.section.bar.index}
|
||||
{/section}
|
||||
]]>
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
Ausgabe des obigen Beispiels:
|
||||
</para>
|
||||
|
||||
<screen>
|
||||
<![CDATA[
|
||||
10 12 14 16 18
|
||||
<hr />
|
||||
20 18 16 14 12 10
|
||||
]]>
|
||||
</screen>
|
||||
|
||||
</example>
|
||||
|
||||
|
||||
|
||||
<example>
|
||||
<title>section loop Variable</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* die 'loop'-Variable definiert nur die Anzahl der Iterationen,
|
||||
Sie können in dieser 'section' auf jeden Wert des Templates
|
||||
zugreifen. Dieses Beispiel geht davon aus, dass $KundenId, $Namen und
|
||||
$Adressen Arrays sind, welche die selbe Anzahl Werte enthalten *}
|
||||
{section name=kunde loop=$KundenId}
|
||||
id: {$KundenId[kunde]}<br>
|
||||
name: {$Namen[kunde]}<br>
|
||||
address: {$Adressen[kunde]}<br>
|
||||
<p>
|
||||
{/section}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ausgabe des obigen Beispiels:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
|
||||
id: 1000<br>
|
||||
name: Peter Müller <br>
|
||||
adresse: 253 N 45th<br>
|
||||
<p>
|
||||
id: 1001<br>
|
||||
name: Fritz Muster<br>
|
||||
adresse:: 417 Mulberry ln<br>
|
||||
<p>
|
||||
id: 1002<br>
|
||||
name: Hans Meier<br>
|
||||
adresse:: 5605 apple st<br>
|
||||
<p>
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<example>
|
||||
<title>section names</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{*
|
||||
die 'name'-Variable definiert den Namen der verwendet werden soll,
|
||||
um Daten aus dieser 'section' zu referenzieren
|
||||
*}
|
||||
{section name=meinedaten loop=$KundenId}
|
||||
<p>
|
||||
id: {$KundenId[meinedaten]}<br>
|
||||
name: {$Namen[meinedaten]}<br>
|
||||
address: {$Adressen[meinedaten]}
|
||||
</p>
|
||||
{/section}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>nested sections (verschachtelte 'sections')</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$id = array(1001,1002,1003);
|
||||
$smarty->assign('custid',$id);
|
||||
|
||||
$fullnames = array('John Smith','Jack Jones','Jane Munson');
|
||||
$smarty->assign('name',$fullnames);
|
||||
|
||||
$addr = array('253 N 45th', '417 Mulberry ln', '5605 apple st');
|
||||
$smarty->assign('address',$addr);
|
||||
|
||||
$types = array(
|
||||
array( 'home phone', 'cell phone', 'e-mail'),
|
||||
array( 'home phone', 'web'),
|
||||
array( 'cell phone')
|
||||
);
|
||||
$smarty->assign('contact_type', $types);
|
||||
|
||||
$info = array(
|
||||
array('555-555-5555', '666-555-5555', 'john@myexample.com'),
|
||||
array( '123-456-4', 'www.example.com'),
|
||||
array( '0457878')
|
||||
);
|
||||
$smarty->assign('contact_info', $info);
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{*
|
||||
Sections können unbegrenzt tief verschachtelt werden. Mit
|
||||
verschachtelten 'sections' können Sie auf komplexe Datenstrukturen
|
||||
zugreifen (wie zum Beispiel multidimensionale Arrays). Im folgenden
|
||||
Beispiel ist $contact_type[customer] ein Array mit Kontakttypen des
|
||||
aktuellen Kunden.
|
||||
*}
|
||||
{section name=customer loop=$custid}
|
||||
<hr />
|
||||
id: {$custid[customer]}<br />
|
||||
name: {$name[customer]}<br />
|
||||
address: {$address[customer]}<br />
|
||||
{section name=contact loop=$contact_type[customer]}
|
||||
{$contact_type[customer][contact]}: {$contact_info[customer][contact]}<br />
|
||||
{/section}
|
||||
{/section}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ausgabe des obigen Beispiels:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
<hr />
|
||||
id: 1000<br />
|
||||
name: John Smith<br />
|
||||
address: 253 N 45th<br />
|
||||
home phone: 555-555-5555<br />
|
||||
cell phone: 666-555-5555<br />
|
||||
e-mail: john@myexample.com<br />
|
||||
<hr />
|
||||
id: 1001<br />
|
||||
name: Jack Jones<br />
|
||||
address: 417 Mulberry ln<br />
|
||||
home phone: 123-456-4<br />
|
||||
web: www.example.com<br />
|
||||
<hr />
|
||||
id: 1002<br />
|
||||
name: Jane Munson<br />
|
||||
address: 5605 apple st<br />
|
||||
cell phone: 0457878<br />
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>sections und assoziative Arrays</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$data = array(
|
||||
array('name' => 'John Smith', 'home' => '555-555-5555',
|
||||
'cell' => '666-555-5555', 'email' => 'john@myexample.com'),
|
||||
array('name' => 'Jack Jones', 'home' => '777-555-5555',
|
||||
'cell' => '888-555-5555', 'email' => 'jack@myexample.com'),
|
||||
array('name' => 'Jane Munson', 'home' => '000-555-5555',
|
||||
'cell' => '123456', 'email' => 'jane@myexample.com')
|
||||
);
|
||||
$smarty->assign('contacts',$data);
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{*
|
||||
Dies ist ein Beispiel wie man einen assoziativen Array in einer
|
||||
'section' ausgeben kann.
|
||||
*}
|
||||
{section name=customer loop=$contacts}
|
||||
<p>
|
||||
name: {$contacts[customer].name}<br />
|
||||
home: {$contacts[customer].home}<br />
|
||||
cell: {$contacts[customer].cell}<br />
|
||||
e-mail: {$contacts[customer].email}
|
||||
</p>
|
||||
{/section}
|
||||
|
||||
{* Anm. d. übersetzers: Oft ist die Anwendung von 'foreach' kürzer. *}
|
||||
|
||||
{foreach item=customer from=$contacts}
|
||||
<p>
|
||||
name: {$customer.name}<br />
|
||||
home: {$customer.home}<br />
|
||||
cell: {$customer.cell}<br />
|
||||
e-mail: {$customer.email}
|
||||
</p>
|
||||
{/foreach}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ausgabe des obigen Beispiels:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
<p>
|
||||
name: John Smith<br />
|
||||
home: 555-555-5555<br />
|
||||
cell: 555-555-5555<br />
|
||||
e-mail: john@mydomain.com
|
||||
</p>
|
||||
<p>
|
||||
name: Jack Jones<br />
|
||||
home phone: 555-555-5555<br />
|
||||
cell phone: 555-555-5555<br />
|
||||
e-mail: jack@mydomain.com
|
||||
<p>
|
||||
name: Jane Munson<br />
|
||||
home phone: 555-555-5555<br />
|
||||
cell phone: 555-555-5555<br />
|
||||
e-mail: jane@mydomain.com
|
||||
</p>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<example>
|
||||
<title>sectionelse</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{*
|
||||
sectionelse wird aufgerufen, wenn keine $custid Werte vorhanden sind
|
||||
*}
|
||||
{section name=customer loop=$custid}
|
||||
|
||||
id: {$custid[customer]}<br>
|
||||
{sectionelse}
|
||||
keine Werte in $custid gefunden
|
||||
{/section}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Die Eigenschaften der 'section' werden in besonderen Variablen
|
||||
abgelegt. Diese sind wie folgt aufgebaut: <link
|
||||
linkend="language.variables.smarty.loops">{$smarty.section.sectionname.varname}</link>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Bermerkung: Seit Smarty 1.5.0 hat sich die Syntax der 'section'
|
||||
Eigenschaften von {%sectionname.varname%} zu
|
||||
{$smarty.section.sectionname.varname} geändert. Die alte Syntax
|
||||
wird noch immer unterstützt, die Dokumentation erwähnt jedoch nur
|
||||
noch die neue Schreibweise.
|
||||
</para>
|
||||
</note>
|
||||
<sect2 id="section.property.index">
|
||||
<title>index</title>
|
||||
<para>
|
||||
'index' wird verwendet, um den aktuellen Schleifen-Index
|
||||
anzuzeigen. Er startet bei 0 (beziehungsweise der definierten
|
||||
Startposition) und inkrementiert in 1-er Schritten (beziehungsweise
|
||||
der definierten Schrittgrösse).
|
||||
</para>
|
||||
<note>
|
||||
<title>Technische Bemerkung</title>
|
||||
<para>
|
||||
Wenn 'step' und 'start' nicht übergeben werden, verhält sich der
|
||||
Wert wie die 'section'-Eigenschaft 'iteration', ausser dass er bei
|
||||
0 anstatt 1 beginnt.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>'section'-Eigenschaft 'index'</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{section name=customer loop=$custid}
|
||||
{$smarty.section.customer.index} id: {$custid[customer]}<br />
|
||||
{/section}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ausgabe des obigen Beispiels:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
0 id: 1000<br />
|
||||
1 id: 1001<br />
|
||||
2 id: 1002<br />
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.index.prev">
|
||||
<title>index_prev</title>
|
||||
<para>
|
||||
'index_prev' wird verwendet um den vorhergehenden Schleifen-Index
|
||||
auszugeben. Bei der ersten Iteration ist dieser Wert -1.
|
||||
</para>
|
||||
<example>
|
||||
<title>section'-Eigenschaft 'index_prev'</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{section name=customer loop=$custid}
|
||||
{$smarty.section.customer.index} id: {$custid[customer]}<br>
|
||||
{* zur Information, $custid[customer.index] und $custid[customer] bedeuten das selbe *}
|
||||
{if $custid[customer.index_prev] ne $custid[customer.index]}
|
||||
Die Kundennummer hat sich geändert.<br>
|
||||
{/if}
|
||||
{/section}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ausgabe des obigen Beispiels:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
0 id: 1000<br>
|
||||
Die Kundennummer hat sich geändert.<br>
|
||||
1 id: 1001<br>
|
||||
Die Kundennummer hat sich geändert.<br>
|
||||
2 id: 1002<br>
|
||||
Die Kundennummer hat sich geändert.<br>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.index.next">
|
||||
<title>index_next</title>
|
||||
<para>
|
||||
'index_next' wird verwendet um den nächsten 'loop'-Index
|
||||
auszugeben. Bei der letzten Iteration ist dieser Wert um 1 grösser
|
||||
als der aktuelle 'loop'-Index (inklusive dem definierten 'step'
|
||||
Wert).
|
||||
</para>
|
||||
<example>
|
||||
<title>section'-Eigenschaft 'index_next'</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{section name=customer loop=$custid}
|
||||
{$smarty.section.customer.index} id: {$custid[customer]}<br>
|
||||
{* zur Information, $custid[customer.index] und $custid[customer] bedeuten das selbe *}
|
||||
{if $custid[customer.index_next] ne $custid[customer.index]}
|
||||
Die Kundennummer wird sich ändern.<br>
|
||||
{/if}
|
||||
{/section}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ausgabe des obigen Beispiels:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
0 id: 1000<br>
|
||||
Die Kundennummer wird sich ändern.<br>
|
||||
1 id: 1001<br>
|
||||
Die Kundennummer wird sich ändern.<br>
|
||||
2 id: 1002<br>
|
||||
Die Kundennummer wird sich ändern.<br>
|
||||
]]Š
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.iteration">
|
||||
<title>iteration</title>
|
||||
<para>
|
||||
'iteration' wird verwendet um die aktuelle Iteration auszugeben.
|
||||
</para>
|
||||
<para>
|
||||
Bemerkung: Die Eigenschaften 'start', 'step' und 'max'
|
||||
beeinflussen 'iteration' nicht, die Eigenschaft 'index' jedoch
|
||||
schon. 'iteration' startet im gegensatz zu 'index' bei 1. 'rownum'
|
||||
ist ein Alias für 'iteration' und arbeitet identisch.
|
||||
</para>
|
||||
<example>
|
||||
<title>'section'-Eigenschaft 'iteration'</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{section name=customer loop=$custid start=5 step=2}
|
||||
aktuelle loop iteration: {$smarty.section.customer.iteration}<br>
|
||||
{$smarty.section.customer.index} id: {$custid[customer]}<br>
|
||||
{* zur Information, $custid[customer.index] und $custid[customer] bedeuten das gleiche *}
|
||||
{if $custid[customer.index_next] ne $custid[customer.index]}
|
||||
Die Kundennummer wird sich ändern.<br>
|
||||
{/if}
|
||||
{/section}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ausgabe des obigen Beispiels:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
aktuelle loop iteration: 1
|
||||
5 id: 1000<br>
|
||||
Die Kundennummer wird sich ändern.<br>
|
||||
aktuelle loop iteration: 2
|
||||
7 id: 1001<br>
|
||||
Die Kundennummer wird sich ändern.<br>
|
||||
aktuelle loop iteration: 3
|
||||
9 id: 1002<br>
|
||||
Die Kundennummer wird sich ändern.<br>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.first">
|
||||
<title>first</title>
|
||||
<para>
|
||||
'first' ist 'true', wenn die aktuelle Iteration die erste dieser
|
||||
'section' ist.
|
||||
</para>
|
||||
<example>
|
||||
<title>'section'-Eigenschaft 'first'</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{section name=customer loop=$custid}
|
||||
{if $smarty.section.customer.first}
|
||||
<table>
|
||||
{/if}
|
||||
|
||||
<tr><td>{$smarty.section.customer.index} id:
|
||||
{$custid[customer]}</td></tr>
|
||||
|
||||
{if $smarty.section.customer.last}
|
||||
</table>
|
||||
{/if}
|
||||
{/section}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ausgabe des obigen Beispiels:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
<table>
|
||||
<tr><td>0 id: 1000</td></tr>
|
||||
<tr><td>1 id: 1001</td></tr>
|
||||
<tr><td>2 id: 1002</td></tr>
|
||||
</table>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.last">
|
||||
<title>last</title>
|
||||
<para>
|
||||
'last' ist 'true' wenn die aktuelle Iteration die letzte dieser
|
||||
'section' ist.
|
||||
</para>
|
||||
<example>
|
||||
<title>'section'-Eigenschaft 'last'</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{section name=customer loop=$custid}
|
||||
{if $smarty.section.customer.first}
|
||||
<table>
|
||||
{/if}
|
||||
|
||||
<tr><td>{$smarty.section.customer.index} id:
|
||||
{$custid[customer]}</td></tr>
|
||||
|
||||
{if $smarty.section.customer.last}
|
||||
</table>
|
||||
{/if}
|
||||
{/section}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ausgabe des obigen Beispiels:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
<table>
|
||||
<tr><td>0 id: 1000</td></tr>
|
||||
<tr><td>1 id: 1001</td></tr>
|
||||
<tr><td>2 id: 1002</td></tr>
|
||||
</table>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.rownum">
|
||||
<title>rownum</title>
|
||||
<para>
|
||||
'rownum' wird verwendet um die aktuelle Iteration (startend bei 1)
|
||||
auszugeben. 'rownum' ist ein Alias für 'iteration' und arbeitet
|
||||
identisch.
|
||||
</para>
|
||||
<example>
|
||||
<title>'section'-Eigenschaft 'rownum'</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{section name=customer loop=$custid}
|
||||
{$smarty.section.customer.rownum} id: {$custid[customer]}<br />
|
||||
{/section}
|
||||
</programlisting>
|
||||
<para>
|
||||
Ausgabe des obigen Beispiels:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
1 id: 1000<br />
|
||||
2 id: 1001<br />
|
||||
3 id: 1002<br />
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.loop">
|
||||
<title>loop</title>
|
||||
<para>
|
||||
'loop' wird verwendet, um die Nummer letzte Iteration der 'section'
|
||||
auszugeben. Dieser Wert kann inner- und ausserhalb der 'section'
|
||||
verwendet werden.
|
||||
</para>
|
||||
<example>
|
||||
<title>'section'-Eigenschaft 'loop'</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{section name=customer loop=$custid}
|
||||
{$smarty.section.customer.index} id: {$custid[customer]}<br />
|
||||
{/section}
|
||||
|
||||
Es wurden {$smarty.section.customer.loop} Kunden angezeigt.
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ausgabe des obigen Beispiels:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
0 id: 1000<br />
|
||||
1 id: 1001<br />
|
||||
2 id: 1002<br />
|
||||
|
||||
Es wurden 3 Kunden angezeigt.
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.show">
|
||||
<title>show</title>
|
||||
<para>
|
||||
<emphasis>show</emphasis> kann die Werte 'true' oder 'false' haben.
|
||||
Falls der Wert 'true' ist, wird die 'section' angezeigt. Falls der
|
||||
Wert 'false' ist, wird die 'section' - ausser dem 'sectionelse' -
|
||||
nicht ausgegeben.
|
||||
</para>
|
||||
<example>
|
||||
<title>'section'-Eigenschaft 'show'</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{section name=customer loop=$custid show=$show_customer_info}
|
||||
{$smarty.section.customer.rownum} id: {$custid[customer]}<br />
|
||||
{/section}
|
||||
|
||||
{if $smarty.section.customer.show}
|
||||
die 'section' wurde angezeigt
|
||||
{else}
|
||||
die 'section' wurde nicht angezeigt
|
||||
{/if}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ausgabe des obigen Beispiels:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
1 id: 1000<br />
|
||||
2 id: 1001<br />
|
||||
3 id: 1002<br />
|
||||
|
||||
die 'section' wurde angezeigt
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.total">
|
||||
<title>total</title>
|
||||
<para>
|
||||
Wird verwendet um die Anzahl der durchlaufenen Iterationen einer
|
||||
'section' auszugeben. Kann innerhalb oder ausserhalb der 'section'
|
||||
verwendet werden.
|
||||
</para>
|
||||
<example>
|
||||
<title>'section'-Eigenschaft 'total'</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{section name=customer loop=$custid step=2}
|
||||
{$smarty.section.customer.index} id: {$custid[customer]}<br>
|
||||
{/section}
|
||||
|
||||
Es wurden {$smarty.section.customer.total} Kunden angezeigt.
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ausgabe des obigen Beispiels:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
0 id: 1000<br>
|
||||
2 id: 1001<br>
|
||||
4 id: 1002<br>
|
||||
|
||||
Es wurden 3 Kunden angezeigt.
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.8 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.strip">
|
||||
<title>strip</title>
|
||||
<para>
|
||||
Webdesigner haben oft das Problem, dass Leerzeichen und
|
||||
Zeilenumbrüche die Ausgabe des erzeugten HTML im Browser
|
||||
beeinflussen. Oft werden deshalb alle Tags aufeinanderfolgend im
|
||||
Template notiert, was aber zu einer schlechten Lesbarkeit führt.
|
||||
</para>
|
||||
<para>
|
||||
Aus dem Inhalt zwischen den {strip}{/strip}-Tags werden alle
|
||||
Leerzeichen und Zeilenumbrüche entfernt. So können Sie Ihre
|
||||
Templates lesbar halten, ohne sich Sorgen um die Leerzeichen zu
|
||||
machen.
|
||||
</para>
|
||||
<note>
|
||||
<title>Technische Bemerkung</title>
|
||||
<para>
|
||||
{strip}{/strip} ändert nicht den Inhalt einer Template-Variablen.
|
||||
Dafür gibt es den <link linkend="language.modifier.strip">strip
|
||||
Modifikator</link>.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>strip tags</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* der folgende Inhalt wird in einer Zeile ausgegeben *}
|
||||
{strip}
|
||||
<table border=0>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{$url}">
|
||||
<font color="red">Das ist ein Test.</font>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{/strip}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ausgebe des obigen Beispiels:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
<table border=0><tr><td><a href="http://my.domain.com"><font color="red">Das ist ein Test.</font></a></td></tr></table>
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<para>
|
||||
Achtung: im obigen Beispiel beginnen und enden alle Zeilen mit
|
||||
HTML-Tags. Falls Sie Abschnitte haben, die nur Text enthalten,
|
||||
werden diese ebenfalls zusammengeschlossen. Das kann zu
|
||||
unerwünschten Resultaten führen.
|
||||
</para>
|
||||
<para>
|
||||
Siehe auch <link linkend="language.modifier.strip">strip-Modifikator
|
||||
(Zeichenkette strippen)</link>
|
||||
</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
|
||||
-->
|
72
trunk/docs/de/designers/language-combining-modifiers.xml
Normal file
72
trunk/docs/de/designers/language-combining-modifiers.xml
Normal file
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: andreas Status: ready -->
|
||||
<chapter id="language.combining.modifiers">
|
||||
<title>Kombinieren von Modifikatoren</title>
|
||||
<para>
|
||||
Sie können auf eine Variable so viele Modifikatoren anwenden
|
||||
wie Sie möchten. Die Modifkatoren werden in der Reihenfolge
|
||||
angewandt, in der sie notiert wurden - von links nach rechts.
|
||||
Kombinierte Modifikatoren müssen mit einem
|
||||
<literal>|</literal>-Zeichen (pipe) getrennt werden.
|
||||
</para>
|
||||
<example>
|
||||
<title>Kombinieren von Modifikatoren</title>
|
||||
<programlisting role="php" >
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty->assign('articleTitle',
|
||||
'Einem Stadtrat in Salem in Pennsylvania (USA) droht eine
|
||||
zweijährige Haftstrafe, da eine von ihm gehaltene Rede sechs
|
||||
Minuten länger dauerte, als erlaubt. Die Redezeit ist auf maximal
|
||||
fünf Minuten begrenzt.');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Wobei das Template dann folgendes entält:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|upper|spacify}
|
||||
{$articleTitle|lower|spacify|truncate}
|
||||
{$articleTitle|lower|truncate:30|spacify}
|
||||
{$articleTitle|lower|spacify|truncate:30:". . ."}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
AUSGABE:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Einem Stadtrat in Salem in Pennsylvania (USA) droht eine (usw.)
|
||||
EINEM STADTRAT IN SALEM IN PENNSYLVANIA (USA) DROHT EINE (usw.)
|
||||
e i n e m s t a d t r a t i n s a l e m i n...
|
||||
e i n e m s t a d t r a t i n s a l e m i n . . .
|
||||
e i n e m s t a d t r. . .]]>
|
||||
</screen>
|
||||
</example>
|
||||
</chapter>
|
||||
<!-- 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
|
||||
-->
|
49
trunk/docs/de/designers/language-custom-functions.xml
Normal file
49
trunk/docs/de/designers/language-custom-functions.xml
Normal file
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: andreas Status: ready -->
|
||||
<chapter id="language.custom.functions">
|
||||
<title>Eigene Funktionen</title>
|
||||
<para>
|
||||
Smarty wird mit verschiedenen massgeschneiderten Funktionen geliefert, welche Sie in
|
||||
Ihren Templates verwenden können.
|
||||
</para>
|
||||
&designers.language-custom-functions.language-function-assign;
|
||||
&designers.language-custom-functions.language-function-counter;
|
||||
&designers.language-custom-functions.language-function-cycle;
|
||||
&designers.language-custom-functions.language-function-debug;
|
||||
&designers.language-custom-functions.language-function-eval;
|
||||
&designers.language-custom-functions.language-function-fetch;
|
||||
&designers.language-custom-functions.language-function-html-checkboxes;
|
||||
&designers.language-custom-functions.language-function-html-image;
|
||||
&designers.language-custom-functions.language-function-html-options;
|
||||
&designers.language-custom-functions.language-function-html-radios;
|
||||
|
||||
&designers.language-custom-functions.language-function-html-select-date;
|
||||
&designers.language-custom-functions.language-function-html-select-time;
|
||||
&designers.language-custom-functions.language-function-html-table;
|
||||
&designers.language-custom-functions.language-function-mailto;
|
||||
&designers.language-custom-functions.language-function-math;
|
||||
&designers.language-custom-functions.language-function-popup;
|
||||
&designers.language-custom-functions.language-function-popup-init;
|
||||
&designers.language-custom-functions.language-function-textformat;
|
||||
</chapter>
|
||||
<!-- 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
|
||||
-->
|
@@ -0,0 +1,140 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.assign">
|
||||
<title>{assign} (zuweisen)</title>
|
||||
<para>
|
||||
{assign} wird verwendet um einer Template-Variable <emphasis
|
||||
role="bold">innerhalb eines Templates</emphasis> einen Wert
|
||||
zuzuweisen.
|
||||
</para>
|
||||
<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>Attribut Name</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>var</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Ja</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Der Name der zuzuweisenden Variable.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>value</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Ja</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Der zuzuweisende Wert.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<example>
|
||||
<title>{assign} (zuweisen)</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{assign var="name" value="Bob"}
|
||||
|
||||
Der Wert von $name ist {$name}.
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ausgabe des obiges Beispiels:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Der Wert von $name ist Bob.</programlisting>
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<example>
|
||||
<title>Zugriff auf mit {assign} zugwiesene Variablen von PHP aus.</title>
|
||||
<para>
|
||||
Um auf zugewiesene Variablen von php aus zuzugreifen nimmt man
|
||||
<link linkend="api.get.template.vars">get_template_vars()</link>.
|
||||
Die zugewiesenen variablen sind jedoch nur wärhend bzw. nach der
|
||||
Ausgabe des Template verfügbar.
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* index.tpl *}
|
||||
{assign var="foo" value="Smarty"}
|
||||
]]>
|
||||
</programlisting>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
// Keine Ausgabe, das das Template noch nicht ausgegeben wurde:
|
||||
echo $smarty->get_template_vars('foo');
|
||||
|
||||
// das Template in eine ungenutzte Variable ausgeben
|
||||
$nix = $smarty->fetch('index.tpl');
|
||||
|
||||
// Gibt 'smarty' aus, da die {assign} anweisung im Template ausgeführt
|
||||
// wurde
|
||||
echo $smarty->get_template_vars('foo');
|
||||
|
||||
$smarty->assign('foo','Even smarter');
|
||||
|
||||
// Ausgabe 'Even smarter'
|
||||
echo $smarty->get_template_vars('foo');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Folgende Funktionen haben <emphasis>optionale</emphasis>
|
||||
assign-Attribute:
|
||||
</para>
|
||||
<para>
|
||||
<link linkend="language.function.capture">{capture}</link>,
|
||||
<link linkend="language.function.include">{include}</link>,
|
||||
<link linkend="language.function.include.php">{include_php}</link>,
|
||||
<link linkend="language.function.insert">{insert}</link>,
|
||||
<link linkend="language.function.counter">{counter}</link>,
|
||||
<link linkend="language.function.cycle">{cycle}</link>,
|
||||
<link linkend="language.function.eval">{eval}</link>,
|
||||
<link linkend="language.function.fetch">{fetch}</link>,
|
||||
<link linkend="language.function.math">{math}</link>,
|
||||
<link linkend="language.function.textformat">{textformat}</link>
|
||||
</para>
|
||||
<para>
|
||||
Siehe auch <link linkend="api.assign">assign()</link> und <link
|
||||
linkend="api.get.template.vars">get_template_vars()</link>.
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.5 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.counter">
|
||||
<title>{counter} (Zähler)</title>
|
||||
<para>
|
||||
{counter} wird verwendet um eine Zahlenreihe auszugeben. Sie können
|
||||
den Initialwert bestimmen, den Zählinterval, die Richtung in der
|
||||
gezählt werden soll und ob der Wert ausgegeben wird. Sie können
|
||||
mehrere Zähler gleichzeitig laufen lassen, in dem Sie ihnen
|
||||
einmalige Namen geben. Wenn Sie keinen Wert für 'name' übergeben,
|
||||
wird 'default' verwendet.
|
||||
</para>
|
||||
<para>
|
||||
Wenn Sie das spezielle 'assign'-Attribut verwenden, wird die Ausgabe
|
||||
des Zählers dieser Template-Variable zugewiesen anstatt ausgegeben
|
||||
zu werden.
|
||||
</para>
|
||||
<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>Attribut Name</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>name</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>default</emphasis></entry>
|
||||
<entry>Der Name des Zählers.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>start</entry>
|
||||
<entry>number</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>1</emphasis></entry>
|
||||
<entry>Der Initialwert.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>skip</entry>
|
||||
<entry>number</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>1</emphasis></entry>
|
||||
<entry>Der Interval.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>direction</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>up</emphasis></entry>
|
||||
<entry>Die Richtung (up/down).</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>print</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>true</emphasis></entry>
|
||||
<entry>Definiert ob der Wert ausgegeben werden soll.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Die Template-Variable welcher der Wert zugewiesen werden soll.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<example>
|
||||
<title>{counter} (Zähler)</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* zähler initialisieren *}
|
||||
{counter start=0 skip=2}<br />
|
||||
{counter}<br />
|
||||
{counter}<br />
|
||||
{counter}<br />
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
AUSGABE:
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,150 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.cycle">
|
||||
<title>{cycle} (Zyklus)</title>
|
||||
<para>
|
||||
{cycle} wird verwendet um durch ein Set von Werten zu zirkulieren.
|
||||
Dies vereinfacht die Handhabung von zwei oder mehr Farben in einer
|
||||
Tabelle, oder um einen Array zu durchlaufen.
|
||||
</para>
|
||||
<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>Attribut Name</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>name</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>default</emphasis></entry>
|
||||
<entry>Der Name des Zyklus.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>values</entry>
|
||||
<entry>mixed</entry>
|
||||
<entry>Ja</entry>
|
||||
<entry><emphasis>N/A</emphasis></entry>
|
||||
<entry>
|
||||
Die Werte durch die zirkuliert werden soll, entweder als Komma
|
||||
separierte Liste (siehe 'delimiter'-Attribut), oder als Array.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>print</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>true</emphasis></entry>
|
||||
<entry>Definiert ob die Werte ausgegeben werden sollen oder
|
||||
nicht.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>advance</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>true</emphasis></entry>
|
||||
<entry>Definiert ob der nächste Wert automatisch angesprungen
|
||||
werden soll.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>delimiter</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>,</emphasis></entry>
|
||||
<entry>Das zu verwendende Trennzeichen.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Der Name der Template-Variable welcher die Ausgabe
|
||||
zugewiesen werden soll.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>reset</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>false</emphasis></entry>
|
||||
<entry>Der Zyklus wird auf den ersten Wert zurückgesetzt.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Sie können durch mehrere Sets gleichzeitig iterieren, indem Sie den
|
||||
Sets einmalige Namen geben.
|
||||
</para>
|
||||
<para>
|
||||
Um den aktuellen Wert nicht auszugeben, kann das 'print' Attribut
|
||||
auf 'false' gesetzt werden. Dies könnte sinnvoll sein, wenn man
|
||||
einen einzelnen Wert überspringen möchte.
|
||||
</para>
|
||||
<para>
|
||||
Das 'advance'-Attribut wird verwendet um einen Wert zu wiederholen.
|
||||
Wenn auf 'false' gesetzt, wird bei der nächsten Iteration der selbe
|
||||
Wert erneut ausgegeben.
|
||||
</para>
|
||||
<para>
|
||||
Wenn sie das spezielle 'assign'-Attribut übergeben, wird die Ausgabe
|
||||
der {cycle}-Funktion in dieser Template-Variable abgelegt, anstatt
|
||||
ausgegeben zu werden.
|
||||
</para>
|
||||
<example>
|
||||
<title>{cycle} (Zyklus)</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
|
||||
-->
|
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: andreas Status: ready -->
|
||||
<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>Attribut Name</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>output</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>javascript</emphasis></entry>
|
||||
<entry>Ausgabe-Typ, entweder HTML oder Javascript.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
{debug} zeigt die 'debugging'-Konsole auf der Seite an. <link
|
||||
linkend="chapter.debugging.console">$debug</link> hat darauf keinen
|
||||
Einfluss. Da die Ausgabe zur Laufzeit geschieht, können die
|
||||
Template-Namen hier nicht ausgegeben werden. Sie erhalten jedoch
|
||||
eine Liste aller mit <link linkend="api.assign">assigned</link>
|
||||
zugewiesenen Variablen und deren Werten.
|
||||
</para>
|
||||
<para>
|
||||
Siehe auch <link linkend="chapter.debugging.console">Debugging Konsole</link>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,128 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.eval">
|
||||
<title>{eval} (auswerten)</title>
|
||||
<para>
|
||||
{eval} wird verwendet um eine Variable als Template
|
||||
auszuwerten. Dies kann verwendet werden um Template-Tags/Variablen
|
||||
in einer Variable oder einer Konfigurationsdatei abzulegen.
|
||||
</para>
|
||||
<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>Attribut Name</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>var</entry>
|
||||
<entry>mixed</entry>
|
||||
<entry>Ja</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Variable oder Zeichenkette die ausgewertet werden soll.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Die Template-Variable welcher die Ausgabe zugewiesen werden soll.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Wenn Sie das spezielle 'assign'-Attribut übergeben, wird die Ausgabe
|
||||
von 'eval' in dieser Template-Variable gespeichert und nicht
|
||||
ausgegeben.
|
||||
</para>
|
||||
<note>
|
||||
<title>Technische Bemerkung</title>
|
||||
<para>
|
||||
Evaluierte Variablen werden gleich wie Template-Variablen verwendet
|
||||
und folgen den selben Maskierungs- und Sicherheits-Features.
|
||||
</para>
|
||||
</note>
|
||||
<note>
|
||||
<title>Technische Bemerkung</title>
|
||||
<para>
|
||||
Evaluierte Variablen werden bei jedem Aufruf neu ausgewertet. Die
|
||||
kompilierten Versionen werden dabei nicht abgelegt! Falls sie caching
|
||||
eingeschaltet haben, wird die Ausgabe jedoch mit dem Rest des
|
||||
Templates gecached.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>eval (auswerten)</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
setup.conf
|
||||
----------
|
||||
|
||||
emphstart = <b>
|
||||
emphend = </b>
|
||||
title = Willkommen auf {$company}'s home page!
|
||||
ErrorCity = Bitte geben Sie einen {#emphstart#}Stadtnamen{#emphend#} ein.
|
||||
ErrorState = Bitte geben Sie einen {#emphstart#}Provinznamen{#emphend#} ein.
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
index.tpl:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{config_load file="setup.conf"}
|
||||
|
||||
{eval var=$foo}
|
||||
{eval var=#title#}
|
||||
{eval var=#ErrorCity#}
|
||||
{eval var=#ErrorState# assign="state_error"}
|
||||
{$state_error}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ausgabe des obigen Beispiels:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Dies ist der Inhalt von foo:
|
||||
|
||||
Willkommen auf Pub & Grill's home page!
|
||||
Bitte geben Sie einen <b>Stadtnamen</b> ein.
|
||||
Bitte geben Sie einen <b>Provinznamen</b> ein.
|
||||
|
||||
]]>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.9 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.fetch">
|
||||
<title>{fetch}</title>
|
||||
<para>
|
||||
{fetch} wird verwendet um lokale oder via HTTP beziehungsweise FTP
|
||||
verfügbare Inhalte auszugeben. Wenn der Dateiname mit 'http://'
|
||||
anfängt, wird die angegebene Webseite geladen und angezeigt. Wenn
|
||||
der Dateiname mit 'ftp://' anfängt wird die Datei vom FTP-Server
|
||||
geladen und angezeigt. Für lokale Dateien muss der absolute Pfad,
|
||||
oder ein Pfad relativ zum ausgeführten Skript übergeben werden.
|
||||
</para>
|
||||
<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>Attribut Name</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>file</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Ja</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Die Datei, FTP oder HTTP Seite die geliefert werden soll.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Die Template-Variable welcher die Ausgabe zugewiesen werden soll.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Wenn Sie das spezielle 'assign'-Attribut übergeben, wird die Ausgabe
|
||||
der {fetch}-Funktion dieser Template-Variable zugewiesen, anstatt
|
||||
ausgegeben zu werden (seit Smarty 1.5.0).
|
||||
</para>
|
||||
<note>
|
||||
<title>Technische Bemerkung</title>
|
||||
<para>
|
||||
HTTP-Redirects werden nicht unterstützt, stellen Sie sicher, dass
|
||||
die aufgerufene URL falls nötig durch ein '/'-Zeichen (slash)
|
||||
beendet wird.
|
||||
</para>
|
||||
</note>
|
||||
<note>
|
||||
<title>Technische Bemerkung</title>
|
||||
<para>
|
||||
Wenn Sicherheit eingeschaltet ist, und Dateien vom lokalen System
|
||||
geladen werden sollen, ist dies nur für Dateien erlaubt welche sich
|
||||
in einem definierten sicheren Verzeichnis befinden.
|
||||
(<link linkend="variable.secure.dir">$secure_dir</link>)
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>fetch</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* einbinden von javascript *}
|
||||
{fetch file="/export/httpd/www.domain.com/docs/navbar.js"}
|
||||
|
||||
{* Wetter Informationen aus einer anderen Webseite bei uns anzeigen *}
|
||||
{fetch file="http://www.myweather.com/68502/"}
|
||||
|
||||
{* News Datei via FTP auslesen *}
|
||||
{fetch file="ftp://user:password@ftp.domain.com/path/to/currentheadlines.txt"}
|
||||
|
||||
{* die Ausgabe einer Template variable zuweisen *}
|
||||
{fetch file="http://www.myweather.com/68502/" assign="weather"}
|
||||
{if $weather ne ""}
|
||||
<b>{$weather}</b>
|
||||
{/if}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Siehe auch <link
|
||||
linkend="language.function.capture">{capture}</link>, <link
|
||||
linkend="language.function.eval">{eval}</link> und <link
|
||||
linkend="api.fetch">fetch()</link>.
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.11 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.html.checkboxes">
|
||||
<title>{html_checkboxes} (Ausgabe von HTML-Checkbox Tag)</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>Attribut Name</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>name</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>checkbox</emphasis></entry>
|
||||
<entry>Name der checkbox Liste</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>values</entry>
|
||||
<entry>array</entry>
|
||||
<entry>ja, ausser wenn das option Attribut verwendet wird</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>ein Array mit Werten für die checkboxes</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>output</entry>
|
||||
<entry>array</entry>
|
||||
<entry>ja, ausser wenn das option Attribut verwendet wird</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>ein Array mit Werten für checkbox Knöpfe</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>selected</entry>
|
||||
<entry>string/array</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>das/die ausgewählten checkbox Elemente</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>options</entry>
|
||||
<entry>assoziatives array</entry>
|
||||
<entry>Ja, ausser values/output wird verwendet</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>ein assoziatives Array mit Werten und Ausgaben</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>separator</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>Zeichenkette die zwischen den checkbox Elementen eingefügt werden soll</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>labels</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>true</emphasis></entry>
|
||||
<entry>fügt der Ausgabe <label>-Tags hinzu</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
html_checkboxes ist eine <link
|
||||
linkend="language.custom.functions">Funktion</link> die aus den
|
||||
übergebenen Daten html checkbox Elemente erstellt und kümmert sich
|
||||
darum welche Elemente ausgewählt sind. Erforderliche Attribute sind
|
||||
Wert/Ausgabe oder Options. Die Ausgabe ist XHTML kompatibel
|
||||
</para>
|
||||
<para>
|
||||
Alle Parameter die nicht in der Liste erwähnt werden, werden ausgegeben.
|
||||
</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);
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Wobei index.tpl wie folgt aussieht:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{html_checkboxes name="id" values=$cust_ids selected=$customer_id output=$cust_names separator="<br />"}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Oder mit folgendem PHP-Code:
|
||||
</para>
|
||||
<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>
|
||||
Wobei index.tpl wie folgt aussieht:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{html_checkboxes name="id" options=$cust_checkboxes selected=$customer_id separator="<br />"}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Das Ergebnis beider Listings:
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,157 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.7 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.html.image">
|
||||
<title>html_image (Ausgabe von HTML-IMG Tag)</title>
|
||||
<para>
|
||||
{html_image} ist eine <link
|
||||
linkend="language.custom.functions">eigene Funktion</link> die ein
|
||||
HTML Tag für ein Bild erzeugt. Die Höhe und Breite der Ausgabe wird
|
||||
automatisch aus der Bilddatei berechnet wenn die Werte nicht
|
||||
übergeben werden.
|
||||
</para>
|
||||
|
||||
<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>Attribut Name</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>file</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Ja</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Name/Pfad zum Bild</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>height</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>Normale Höhe des Bildes</emphasis></entry>
|
||||
<entry>Höhe des Bildes</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>width</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>Normale Breite des Bildes</emphasis></entry>
|
||||
<entry>Breite des Bildes</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>basedir</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>DOCUMENT_ROOT</emphasis></entry>
|
||||
<entry>Basisverzeichnis für relative Pfadangaben</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>alt</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>""</emphasis></entry>
|
||||
<entry>Alternative Beschreibung des Bildes</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>href</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Link für das Bild</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>path_prefix</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Präfix für den Pfad zum Bild</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
|
||||
<para>
|
||||
basedir ist der Basispfad der für die Verlinkung verwendet werden
|
||||
soll. Wenn kein Wert übergeben wird, wird die <link
|
||||
linkend="language.variables.smarty">Umgebungsvariable</link>
|
||||
DOCUMENT_ROOT verwendet. Wenn <link
|
||||
linkend="variable.security">Sicherheit</link> eingeschaltet ist,
|
||||
muss das Bild in einem sicheren Verzeichnis liegen.
|
||||
</para>
|
||||
<para>
|
||||
<parameter>href</parameter> ist das href Attribut für das
|
||||
Image-Tag. Wenn dieser Wert übergeben wird, wird um das Bild ein
|
||||
<a href="LINKVALUE"><a> Tag erzeugt.
|
||||
</para>
|
||||
<para>
|
||||
<parameter>path_prefix</parameter> ist ein optionaler Präfix der dem
|
||||
Bildpfad vorangestellt wird. Die ist nützlich wenn zum Beispiel für
|
||||
den Bildpfad ein anderer Servername verwendet werden soll.
|
||||
</para>
|
||||
<para>
|
||||
Alle weiteren Parameter werden als Name/Wert Paare (Attribute) im
|
||||
<img>-Tag ausgegeben.
|
||||
</para>
|
||||
<note>
|
||||
<title>Technische Bemerkung</title>
|
||||
<para>
|
||||
{html_image} greift auf das Dateisystem zu um Höhe und Breite zu
|
||||
errechnen. Wenn Sie <link linkend="caching">caching</link> nicht
|
||||
verwenden sollten Sie normalerweise auf diese Funktion aus
|
||||
performance Gründen verzichten.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>html_image</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
Wobei index.tpl wie folgt aussieht:
|
||||
-----------------------------------
|
||||
{html_image file="pumpkin.jpg"}
|
||||
{html_image file="/path/from/docroot/pumpkin.jpg"}
|
||||
{html_image file="../path/relative/to/currdir/pumpkin.jpg"}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Mögliche Ausgabe:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
<img src="pumpkin.jpg" alt="" width="44" height="68" />
|
||||
<img src="/path/from/docroot/pumpkin.jpg" alt="" width="44" height="68" />
|
||||
<img src="../path/relative/to/currdir/pumpkin.jpg" alt="" 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
|
||||
-->
|
@@ -0,0 +1,210 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.12 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.html.options">
|
||||
<title>html_options (Ausgabe von HTML-Options)</title>
|
||||
<para>
|
||||
{html_options} wird verwendet um HTML-Options Listen mit den
|
||||
übergebenen Daten zu erzeugen. Die <link
|
||||
linkend="language.custom.functions">Funktion</link> kümmert sich
|
||||
ebenfalls um das setzen des ausgewählten Standardwertes. Die
|
||||
Attribute 'values' und 'output' sind erforderlich, ausser man
|
||||
verwendet das Attribut 'options'.
|
||||
</para>
|
||||
|
||||
<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>Attribut Name</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>values</entry>
|
||||
<entry>array</entry>
|
||||
<entry>Ja, ausser 'options'-Attribut wird verwendet.</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Array mit Werten für die dropdown-Liste.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>output</entry>
|
||||
<entry>array</entry>
|
||||
<entry>Ja, ausser 'options'-Attribut wird verwendet.</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Arrays mit Namen für die dropdown-Liste.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>selected</entry>
|
||||
<entry>string/array</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>Das ausgewählte Array Element.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>options</entry>
|
||||
<entry>associative array</entry>
|
||||
<entry>Ja, ausser wenn das 'values'- und das 'output'-Attribut verwendet werden.</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Assoziatives Array mit Werten die ausgegeben werden sollen.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
|
||||
<para>
|
||||
Wenn ein Wert als Array erkannt wird, wird er als HTML-OPTGROUP
|
||||
ausgegeben und die Werte werden in Gruppen dargestellt. Rekursion
|
||||
wird unterstützt. Die Ausgabe ist XHTML kompatibel.
|
||||
</para>
|
||||
<para>
|
||||
Wenn das (optionale) Attribute <emphasis>name</emphasis> angegeben
|
||||
wurde, wird um die <option>-Liste von <select
|
||||
name="groupname"></select>-Tags umschlossen
|
||||
</para>
|
||||
<para>
|
||||
Alle Parameter die deren Namen nicht in der obigen Liste genannt
|
||||
wurde, werden dem <select>-Tag als Name/Wert-Paare
|
||||
hinzugefügt. Die Parameter werden ignoriert, wenn kein
|
||||
<emphasis>name</emphasis>-Attribute angegeben wurde.
|
||||
</para>
|
||||
<example>
|
||||
<title>html_options</title>
|
||||
<para>
|
||||
<emphasis role="bold">Beispiel 1:</emphasis>
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$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);
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Wobei das Template wie folgt aussieht:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
<select name="customer_id">
|
||||
{html_options values=$cust_ids output=$cust_names selected=$customer_id}
|
||||
</select>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
<emphasis role="bold">Beispiel 2:</emphasis>
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty->assign('cust_options', array(
|
||||
1000 => 'Joe Schmoe',
|
||||
1001 => 'Jack Smith',
|
||||
1002 => 'Jane Johnson',
|
||||
1003 => 'Charlie Brown')
|
||||
);
|
||||
$smarty->assign('customer_id', 1001);
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Wobei das Template wie folgt aussieht:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{html_options name=customer_id options=$cust_options selected=$customer_id}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Beide Beispiele ergeben folgende Ausgabe:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
<select name="customer_id" size="4">
|
||||
<option label="Joe Schmoe" value="1000">Joe Schmoe</option>
|
||||
<option label="Jack Smith" value="1001" selected="selected">Jack Smith</option>
|
||||
<option label="Jane Johnson" value="1002">Jane Johnson</option>
|
||||
<option label="Charlie Brown" value="1003">Charlie Brown</option>
|
||||
</select>
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<para>
|
||||
Siehe auch <link
|
||||
linkend="language.function.html.checkboxes">{html_checkboxes}</link>
|
||||
und <link
|
||||
linkend="language.function.html.radios">{html_radios}</link>
|
||||
</para>
|
||||
<example>
|
||||
<title>{html_options} - Beispiel mit Datenbank (z.B. PEAR oder ADODB):</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$sql = 'select type_id, types from types order by type';
|
||||
$smarty->assign('types',$db->getAssoc($sql));
|
||||
|
||||
$sql = 'select contact_id, name, email, type_id
|
||||
from contacts where contact_id='.$contact_id;
|
||||
$smarty->assign('contact',$db->getRow($sql));
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Wobei das Template wie folgt aussieht:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
<select name="type_id">
|
||||
<option value='null'>-- none --</option>
|
||||
{html_options name="type" options=$types selected=$contact.type_id}
|
||||
</select>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Siehe auch <link
|
||||
linkend="language.function.html.checkboxes">{html_checkboxes}</link>
|
||||
und <link
|
||||
linkend="language.function.html.radios">{html_radios}</link>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,191 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.10 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.html.radios">
|
||||
<title>html_radios (Ausgabe von HTML-RADIO Tags)</title>
|
||||
<para>
|
||||
html_radio ist eine Funktion die aus den übergebenen Daten html
|
||||
radio Elemente erstellt und kümmert sich darum welche Elemente
|
||||
ausgewählt sind. Erforderliche Attribute sind Wert/Ausgabe
|
||||
oder Options. Die Ausgabe ist XHTML kompatibel
|
||||
</para>
|
||||
<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>Attribut Name</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>name</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>radio</emphasis></entry>
|
||||
<entry>Name der Radio Liste</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>values</entry>
|
||||
<entry>array</entry>
|
||||
<entry>Ja, ausser 'options'-Attribut wird verwendet.</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Array mit Werten für die dropdown-Liste.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>output</entry>
|
||||
<entry>array</entry>
|
||||
<entry>Ja, ausser 'options'-Attribut wird verwendet.</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Arrays mit Namen für die dropdown-Liste.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>selected</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>Das ausgewählte Array Element.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>options</entry>
|
||||
<entry>associative array</entry>
|
||||
<entry>Ja, ausser wenn das 'values'- und das 'output'-Attribut verwendet werden.</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Assoziatives Array mit Werten die ausgegeben werden sollen.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>separator</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>Die Zeichenkette die zwischen 2 Radioelemente eingefügt werden soll.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Alle weiteren Parameter werden als Name/Wert Paare (Attribute) in jedem der <input>-Tags ausgegeben.
|
||||
</para>
|
||||
<example>
|
||||
<title>html_radios</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty->assign('cust_ids', array(1000,1001,1002,1003));
|
||||
$smarty->assign('cust_names', array(
|
||||
'Joe Schmoe',
|
||||
'Jack Smith',
|
||||
'Jane Johnson',
|
||||
'Carlie Brown')
|
||||
);
|
||||
$smarty->assign('customer_id', 1001);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Mit folgendem index.tpl:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{html_radios values=$cust_ids checked=$customer_id output=$cust_names separator="<br />"}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>{html_radios} : Example 2</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty->assign('cust_radios', array(
|
||||
1000 => 'Joe Schmoe',
|
||||
1001 => 'Jack Smith',
|
||||
1002 => 'Jane Johnson',
|
||||
1003 => 'Charlie Brown'));
|
||||
$smarty->assign('customer_id', 1001);
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Mit folgendem index.tpl:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{html_radios name="id" options=$cust_radios selected=$customer_id separator="<br />"}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ausgabe beider Beispiele:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
<label for="id_1000">
|
||||
<input type="radio" name="id" value="1000" id="id_1000" />Joe Schmoe</label><br />
|
||||
<label for="id_1001"><input type="radio" name="id" value="1001" id="id_1001" checked="checked" />Jack Smith</label><br />
|
||||
<label for="id_1002"><input type="radio" name="id" value="1002" id="id_1002" />Jane Johnson</label><br />
|
||||
<label for="id_1003"><input type="radio" name="id" value="1003" id="id_1003" />Charlie Brown</label><br />
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<example>
|
||||
<title>{html_radios}-Datenbankbeispiel (z.B. mit PEAR oder ADODB):</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$sql = 'select type_id, types from types order by type';
|
||||
$smarty->assign('types',$db->getAssoc($sql));
|
||||
|
||||
$sql = 'select contact_id, name, email, type_id
|
||||
from contacts where contact_id='.$contact_id;
|
||||
$smarty->assign('contact',$db->getRow($sql));
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Mit folgendem index.tpl:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{html_radios name="type" options=$types selected=$contact.type_id separator="<br />"}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Siehe auch <link
|
||||
linkend="language.function.html.checkboxes">{html_checkboxes}</link>
|
||||
und <link
|
||||
linkend="language.function.html.options">{html_options}</link>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,322 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.html.select.date">
|
||||
<title>html_select_date (Ausgabe von Daten als 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>Attribut Name</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>prefix</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>Date_</entry>
|
||||
<entry>Prefix für die Namen.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>time</entry>
|
||||
<entry>timestamp/YYYY-MM-DD</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>Aktuelle Zeit als Unix-Timestamp, oder in YYYY-MM-DD format.</entry>
|
||||
<entry>Das zu verwendende Datum.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>start_year</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>aktuelles Jahr</entry>
|
||||
<entry>Das erste Jahr in der dropdown-Liste, entweder als Jahreszahl oder relativ zum aktuellen Jahr (+/- N).</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>end_year</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>Gegenteil von start_year</entry>
|
||||
<entry>Das letzte Jahr in der dropdown-Liste, entweder als Jahreszahl oder relativ zum aktuellen Jahr (+/- N).</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_days</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>true</entry>
|
||||
<entry>Definiert ob Tage ausgegeben sollen oder nicht.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_months</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>true</entry>
|
||||
<entry>Definiert ob Monate ausgegeben werden sollen oder nicht.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_years</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>true</entry>
|
||||
<entry>Definiert ob Jahre ausgegeben werden sollen oder nicht.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>month_format</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>%B</entry>
|
||||
<entry>Format in welchem der Monat ausgegeben werden soll. (strftime)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>day_format</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>%02d</entry>
|
||||
<entry>Definiert das Format in welchem der Tag ausgegeben werden soll. (sprintf)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>year_as_text</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>false</entry>
|
||||
<entry>Definiert ob das Jahr als Text ausgegeben werden soll oder nicht.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>reverse_years</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>false</entry>
|
||||
<entry>Definiert ob die Daten in verkehrter Reihenfolge ausgegeben werden sollen.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>field_array</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>null</entry>
|
||||
<entry>
|
||||
Wenn ein Namen übergeben wird, werden die Daten in der Form name[Day], name[Year], name[Month] an PHP zurückgegeben.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>day_size</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Fügt dem 'select'-Tag das Attribut 'size' hinzu.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>month_size</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Fügt dem 'select'-Tag das Attribut 'size' hinzu.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>year_size</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Fügt dem 'select'-Tag das Attribut 'size' hinzu.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>all_extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Fügt allen 'select'-Tags zusätzliche Attribute hinzu.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>day_extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Fügt 'select'-Tags zusätzliche Attribute hinzu.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>month_extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Fügt 'select'-Tags zusätzliche Attribute hinzu.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>year_extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Fügt 'select'-Tags zusätzliche Attribute hinzu.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>field_order</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>MDY</entry>
|
||||
<entry>Die Reihenfolge in der die Felder ausgegeben werden.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>field_separator</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>\n</entry>
|
||||
<entry>Zeichenkette die zwischen den Feldern ausgegeben werden soll.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>month_value_format</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>%m</entry>
|
||||
<entry>Format zur Ausgabe der Monats-Werte, Standardwert ist %m. (strftime)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>year_empty</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Definiert, einen Namen für das erste Element der Jahres Select-Box und dessen Wert "". Dies is hilfreich, wenn Sie eine Select-Box machen wollen, die die Zeichenkette "Bitte wählen Sie ein Jahr" als erstes Element enthält. Beachten Sie, dass Sie Werte wie "-MM-DD" als 'time' Attribut definieren können, um ein unselektiertes Jahr anzuzeigen.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>month_empty</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Definiert, einen Namen für das erste Element der Monats Select-Box und dessen Wert "". Dies is hilfreich, wenn Sie eine Select-Box machen wollen, die die Zeichenkette "Bitte wählen Sie einen Monat" als erstes Element enthält. Beachten Sie, dass Sie Werte wie "YYYY--DD" als 'time' Attribut definieren können, um einen unselektierten Monat anzuzeigen.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>day_empty</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Definiert, einen Namen für das erste Element der Tages Select-Box und dessen Wert "". Dies is hilfreich, wenn Sie eine Select-Box machen wollen, die die Zeichenkette "Bitte wählen Sie einen Tag" als erstes Element enthält. Beachten Sie, dass Sie Werte wie "YYYY-MM-" als 'time' Attribut definieren können, um einen unselektierten Tag anzuzeigen.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
'html_select_date' wird verwendet um Datums-Dropdown-Listen zu erzeugen,
|
||||
und kann einen oder alle der folgenden Werte darstellen: Jahr, Monat und Tag
|
||||
</para>
|
||||
<example>
|
||||
<title>html_select_date</title>
|
||||
<programlisting>
|
||||
{html_select_date}
|
||||
|
||||
|
||||
AUSGABE:
|
||||
|
||||
<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>December</option>
|
||||
</select>
|
||||
<select name="Date_Day">
|
||||
<option value="1">01</option>
|
||||
<option value="2">02</option>
|
||||
<option value="3">03</option>
|
||||
<option value="4">04</option>
|
||||
<option value="5">05</option>
|
||||
<option value="6">06</option>
|
||||
<option value="7">07</option>
|
||||
<option value="8">08</option>
|
||||
<option value="9">09</option>
|
||||
<option value="10">10</option>
|
||||
<option value="11">11</option>
|
||||
<option value="12">12</option>
|
||||
<option value="13" selected>13</option>
|
||||
<option value="14">14</option>
|
||||
<option value="15">15</option>
|
||||
<option value="16">16</option>
|
||||
<option value="17">17</option>
|
||||
<option value="18">18</option>
|
||||
<option value="19">19</option>
|
||||
<option value="20">20</option>
|
||||
<option value="21">21</option>
|
||||
<option value="22">22</option>
|
||||
<option value="23">23</option>
|
||||
<option value="24">24</option>
|
||||
<option value="25">25</option>
|
||||
<option value="26">26</option>
|
||||
<option value="27">27</option>
|
||||
<option value="28">28</option>
|
||||
<option value="29">29</option>
|
||||
<option value="30">30</option>
|
||||
<option value="31">31</option>
|
||||
</select>
|
||||
<select name="Date_Year">
|
||||
<option value="2001" selected>2001</option>
|
||||
</select></programlisting>
|
||||
</example>
|
||||
|
||||
|
||||
<example>
|
||||
<title>html_select_date</title>
|
||||
<programlisting>
|
||||
|
||||
|
||||
{* Start- und End-Jahr können relativ zum aktuellen Jahr definiert werden. *}
|
||||
{html_select_date prefix="StartDate" time=$time start_year="-5" end_year="+1" display_days=false}
|
||||
|
||||
AUSGABE: (aktuelles Jahr ist 2000)
|
||||
|
||||
<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>December</option>
|
||||
</select>
|
||||
<select name="StartDateYear">
|
||||
<option value="1999">1995</option>
|
||||
<option value="1999">1996</option>
|
||||
<option value="1999">1997</option>
|
||||
<option value="1999">1998</option>
|
||||
<option value="1999">1999</option>
|
||||
<option value="2000" selected>2000</option>
|
||||
<option value="2001">2001</option>
|
||||
</select></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
|
||||
-->
|
@@ -0,0 +1,324 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.html.select.time">
|
||||
<title>html_select_time (Ausgabe von Zeiten als 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>Attribut Name</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>prefix</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>Time_</entry>
|
||||
<entry>Prefix des Namens.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>time</entry>
|
||||
<entry>timestamp</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>Aktuelle Uhrzeit.</entry>
|
||||
<entry>Definiert die zu verwendende Uhrzeit.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_hours</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>true</entry>
|
||||
<entry>Definiert ob Stunden ausgegeben werden sollen.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_minutes</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>true</entry>
|
||||
<entry>Definiert ob Minuten ausgegeben werden sollen.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_seconds</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>true</entry>
|
||||
<entry>Definiert ob Sekunden ausgegeben werden sollen.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_meridian</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>true</entry>
|
||||
<entry>Definiert ob der Meridian (am/pm) ausgegeben werden soll.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>use_24_hours</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>true</entry>
|
||||
<entry>Definiert ob die Stunden in 24-Stunden Format angezeigt werden sollen oder nicht.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>minute_interval</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>1</entry>
|
||||
<entry>Definiert den Interval in der Minuten-Dropdown-Liste.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>second_interval</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>1</entry>
|
||||
<entry>Definiert den Interval in der Sekunden-Dropdown-Liste.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>field_array</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>n/a</entry>
|
||||
<entry>Gibt die Daten in einen Array dieses Namens aus.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>all_extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Fügt allen 'select'-Tags zusätzliche Attribute hinzu.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>hour_extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Fügt dem Stunden-'select'-Tag zusätzliche Attribute hinzu.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>minute_extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Fügt dem Minuten-'select'-Tag zusätzliche Attribute hinzu.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>second_extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Fügt dem Sekunden-'select'-Tag zusätzliche Attribute hinzu.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>meridian_extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Fügt dem Meridian-'select'-Tag zusätzliche Attribute hinzu.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
'html_select_time' wird verwendet um Zeit-Dropdown-Listen zu erzeugen.
|
||||
Die Funktion kann alle oder eines der folgenden Felder ausgeben: Stunde, Minute, Sekunde und Meridian.
|
||||
</para>
|
||||
<example>
|
||||
<title>html_select_time</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{html_select_time use_24_hours=true}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ausgabe:
|
||||
</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>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>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>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>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
|
||||
-->
|
@@ -0,0 +1,146 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.html.table">
|
||||
<title>html_table (Ausgabe von HTML-TABLE Tag)</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>Attribut Name</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standartwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>loop</entry>
|
||||
<entry>array</entry>
|
||||
<entry>Ja</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Array mit den Daten für den Loop</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>cols</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>3</emphasis></entry>
|
||||
<entry>Anzahl Spalten in einer Tabelle</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>table_attr</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>border="1"</emphasis></entry>
|
||||
<entry>Attribute für das Table-Tag</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>tr_attr</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>Attribute für das tr-Tag (Arrays werden durchlaufen)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>td_attr</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>Attribute für das tr-Tag (Arrays werden durchlaufen)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>trailpad</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>&nbsp;</emphasis></entry>
|
||||
<entry>Wert für leere Zellen</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>hdir</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>right</emphasis></entry>
|
||||
<entry>Richtung in der die Zeilen gerendered werden. Mögliche Werte: <emphasis>left</emphasis>/<emphasis>right</emphasis></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>vdir</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry><emphasis>down</emphasis></entry>
|
||||
<entry>Richtung in der die Spalten gerendered werden. Mögliche Werte: <emphasis>up</emphasis>/<emphasis>down</emphasis></entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
<emphasis>html_table</emphasis> ist eine eigene Funktion die einen Array als
|
||||
Tabelle ausgibt. Das <emphasis>cols</emphasis> Attribut definiert die Menge
|
||||
von Spalten die ausgegeben werden sollen. <emphasis>table_attr</emphasis>, <emphasis>tr_attr</emphasis>
|
||||
und <emphasis>td_attr</emphasis> definieren die Attribute für die HTML Tags. Wenn <emphasis>tr_attr</emphasis>
|
||||
oder <emphasis>td_attr</emphasis> Arrays sind, werden diese durchlaufen. <emphasis>trailpad</emphasis>
|
||||
wird in leere Zellen eingefügt.
|
||||
</para>
|
||||
<example>
|
||||
<title>html_table</title>
|
||||
<programlisting>
|
||||
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}
|
||||
|
||||
AUSGABE:
|
||||
|
||||
<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
|
||||
-->
|
@@ -0,0 +1,142 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: andreas Status: ready -->
|
||||
<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>Attribut Name</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Benötigt</entry>
|
||||
<entry>Standard</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>Adresse</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Ja</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Die EMail Adresse</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Text</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Der Text der angezeigt werden soll. Standardwert ist die EMail Adresse</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>encode</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>none</emphasis></entry>
|
||||
<entry>Wie die EMail Adresse verschlüsselt werden soll. Erlaubt sind 'none', 'hex' und 'javascript'.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>CC</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Komma separierte Liste der EMail Adressen, die eine Kopie der Nachricht erhalten sollen.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>BCC</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Komma separierte Liste der EMail Adressen, die eine blinde Kopie der Nachricht erhalten sollen.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Titel</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Titel der Nachricht.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Newsgroups</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Komma separierte Liste der Newsgroups, die eine Kopie der Nachricht erhalten sollen.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>FollowupTo</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Komma separierte Liste der Followup Adressen.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Zusätzliche Attribute, die sie dem Link geben wollen.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
mailto vereinfach den Einsatz von mailto-Links und verschlüsselt die Links. Verschlüsselte Links können von WebSpiders schlechter ausgelesen werden.
|
||||
</para>
|
||||
<note>
|
||||
<title>Technische Bemerkung</title>
|
||||
<para>
|
||||
Javascript ist wahrscheinlich die beste Methode, die Daten für WebSpider unzugänglich zu machen.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>mailto</title>
|
||||
<programlisting>
|
||||
{mailto address="me@domain.com"}
|
||||
{mailto address="me@domain.com" text="Der angezeigte Linktext"}
|
||||
{mailto address="me@domain.com" encode="javascript"}
|
||||
{mailto address="me@domain.com" encode="hex"}
|
||||
{mailto address="me@domain.com" subject="Hallo!"}
|
||||
{mailto address="me@domain.com" cc="you@domain.com,they@domain.com"}
|
||||
{mailto address="me@domain.com" extra='class="email"'}
|
||||
|
||||
OUTPUT:
|
||||
|
||||
<a href="mailto:me@domain.com" >me@domain.com</a>
|
||||
<a href="mailto:me@domain.com" >Der angezeigte Linktext</a>
|
||||
<script type="text/javascript" language="javascript">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'))</script>
|
||||
<a href="mailto:%6d%65@%64%6f%6d%61%69%6e.%63%6f%6d" >me@domain.com</a>
|
||||
<a href="mailto:me@domain.com?subject=Hallo%21" >me@domain.com</a>
|
||||
<a href="mailto:me@domain.com?cc=you@domain.com%2Cthey@domain.com" >me@domain.com</a>
|
||||
<a href="mailto:me@domain.com" class="email">me@domain.com</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
|
||||
-->
|
@@ -0,0 +1,152 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.math">
|
||||
<title>math (Mathematik)</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>Attribut Name</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>equation</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Ja</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Der auszuführende Vergleich.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>format</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Format der Ausgabe. (sprintf)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>var</entry>
|
||||
<entry>numeric</entry>
|
||||
<entry>Ja</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Wert der Vergleichsvariable.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Template-Variable welcher die Ausgabe zugewiesen werden soll.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>[var ...]</entry>
|
||||
<entry>numeric</entry>
|
||||
<entry>Yes</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Zusätzliche Werte.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
'math' ermöglicht es dem Designer, mathematische Gleichungen
|
||||
durchzuführen. Alle numerischen Template-Variablen
|
||||
können dazu verwendet werden und die Ausgabe wird an
|
||||
die Stelle des Tags geschrieben. Die Variablen werden
|
||||
der Funktion als Parameter übergeben, dabei kann es sich
|
||||
um statische oder um Template-Variablen handeln. Erlaubte Operatoren
|
||||
umfassen: +, -, /, *, abs, ceil, cos, exp, floor, log, log10, max,
|
||||
min, pi, pow, rand, round, sin, sqrt, srans und tan. Konsultieren Sie
|
||||
die PHP-Dokumentation für zusätzliche Informationen zu dieser
|
||||
Funktion.
|
||||
</para>
|
||||
<para>
|
||||
Falls Sie die spezielle 'assign' Variable übergeben, wird die
|
||||
Ausgabe der 'math'-Funktion der Template-Variablen mit dem selben
|
||||
Namen zugewiesen anstatt ausgegeben zu werden.
|
||||
</para>
|
||||
<note>
|
||||
<title>Technische Bemerkung</title>
|
||||
<para>
|
||||
Die 'math'-Funktion ist wegen ihres Gebrauchs der 'eval()'-Funktion
|
||||
äusserst Ressourcen intensiv. Mathematik direkt im PHP-Skript
|
||||
zu verwenden ist wesentlich performanter. Sie sollten daher
|
||||
- wann immer möglich - auf die Verwendung verzichten. Stellen
|
||||
Sie jedoch auf jeden Fall sicher, dass Sie keine 'math'-Tags in 'sections'
|
||||
oder anderen 'loop'-Konstrukten verwenden.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>math (Mathematik)</title>
|
||||
<programlisting>
|
||||
{* $height=4, $width=5 *}
|
||||
|
||||
{math equation="x + y" x=$height y=$width}
|
||||
|
||||
AUSGABE:
|
||||
|
||||
9
|
||||
|
||||
|
||||
{* $row_height = 10, $row_width = 20, #col_div# = 2, aus Template zugewiesen *}
|
||||
|
||||
{math equation="height * width / division"
|
||||
height=$row_height
|
||||
width=$row_width
|
||||
division=#col_div#}
|
||||
|
||||
AUSGABE:
|
||||
|
||||
100
|
||||
|
||||
|
||||
|
||||
{* Sie können auch Klammern verwenden *}
|
||||
|
||||
{math equation="(( x + y ) / z )" x=2 y=10 z=2}
|
||||
|
||||
AUSGABE:
|
||||
|
||||
6
|
||||
|
||||
|
||||
|
||||
{* Sie können als Ausgabeformat alle von sprintf unterstötzen Definitionen verwenden *}
|
||||
|
||||
{math equation="x + y" x=4.4444 y=5.0000 format="%.2f"}
|
||||
|
||||
AUSGABE:
|
||||
|
||||
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
|
||||
-->
|
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.popup.init">
|
||||
<title>popup_init (Popup Initialisieren)</title>
|
||||
<para>
|
||||
'popup' ist eine Integration von 'overLib', einer Javascript
|
||||
Library für 'popup'-Fenster. Dies kann verwendet werden um
|
||||
Zusatzinformationen als Context-Menu oder Tooltip auszugeben.
|
||||
'popup_init' muss am Anfang jedes Templates aufgerufen werden,
|
||||
falls Sie planen darin die <link linkend="language.function.popup">popup</link>-Funktion
|
||||
zu verwenden. Der Author von 'overLib' ist Erik Bosrup, und die
|
||||
Homepage ist unter http://www.bosrup.com/web/overlib/ erreichbar.
|
||||
</para>
|
||||
<para>
|
||||
Seit Smarty 2.1.2 wird 'overLib' NICHT mehr mitgeliefert. Laden
|
||||
Sie 'overLib' herunter und platzieren Sie es in Ihrer Document Root.
|
||||
Danach können Sie mit dem Attribut 'src' definieren an welcher
|
||||
Stelle die Datei liegt.
|
||||
</para>
|
||||
<example>
|
||||
<title>popup_init</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* popup_init must be called once at the top of the page *}
|
||||
{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
|
||||
-->
|
@@ -0,0 +1,412 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.popup">
|
||||
<title>popup (Popup-Inhalt definieren)</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>Attribut Name</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>text</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Ja</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Text/HTML der im Popup ausgegeben werden soll.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>trigger</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>onMouseOver</emphasis></entry>
|
||||
<entry>Definiert bei welchem Event das Popup aufgerufen werden soll. Erlaubte Werte sind: onMouseOver und onClick</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>sticky</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>false</emphasis></entry>
|
||||
<entry>Definiert ob das Popup geöffnet bleiben soll bis es manuell geschlossen wird.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>caption</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Definiert die Überschrift.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>fgcolor</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Hintergrundfarbe des Popups.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>bgcolor</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Rahmenfarbe des Popups.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>textcolor</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Farbe des Textes im Popup.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>capcolor</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Farbe der Popup-Überschrift.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>closecolor</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Die Farbe des 'close'-Textes.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>textfont</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Die Farbe des Textes.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>captionfont</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Die Schriftart für die Überschrift.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>closefont</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Die Schriftart für den 'close'-Text.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>textsize</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Die Schriftgrösse des Textes.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>captionsize</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Die Schriftgrösse der Überschrift.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>closesize</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Die Schriftgrösse des 'close'-Textes.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>width</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Die Breite der Popup-Box.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>height</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Die Höhe der Popup-Box.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>left</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>false</emphasis></entry>
|
||||
<entry>Öffnet die Popup-Box links von Mauszeiger.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>right</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>false</emphasis></entry>
|
||||
<entry>Öffnet die Popup-Box rechts von Mauszeiger.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>center</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>false</emphasis></entry>
|
||||
<entry>Öffnet die Popup-Box in der Mitte des Mauszeigers.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>above</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>false</emphasis></entry>
|
||||
<entry>Öffnet die Popup-Box oberhalb des Mauszeigers. Achtung: nur möglich wenn 'height' definiert ist.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>below</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>false</emphasis></entry>
|
||||
<entry>Öffnet die Popup-Box unterhalb des Mauszeigers.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>border</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Die Rahmenbreite der Popup-Box.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>offsetx</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Horizontale Distanz zum Mauszeiger bei der das Popup geöffnet bleibt.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>offsety</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Vertikale Distanz zum Mauszeiger bei der das Popup geöffnet bleibt.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>fgbackground</entry>
|
||||
<entry>url to image</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Das Hintergundbild.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>bgbackground</entry>
|
||||
<entry>url to image</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>
|
||||
Definiert das Bild welches verwendet werden soll um den Rahmen zu zeichnen.
|
||||
Achtung: Sie müssen 'bgcolor' auf '' setzen, da die Farbe sonst angezeigt wird.
|
||||
Achtung: Wenn sie einen 'close'-Link verwenden, wird Netscape (4.x) die Zellen
|
||||
mehrfach rendern, was zu einer falschen Anzeige führen kann.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>closetext</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Definiert den Text des 'close'-Links.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>noclose</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Zeigt den 'close'-Link nicht an.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>status</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Definiert den Text der in der Browser-Statuszeile ausgegeben wird.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>autostatus</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Gibt als Statusinformationen den Popup-Text aus. Achtung: Dies überschreibt die definierten Statuswerte.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>autostatuscap</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Zeigt in der Statusleiste den Wert der Popup-Überschrift an. Achtung: Dies überschreibt die definierten Statuswerte.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>inarray</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>
|
||||
Weist 'overLib' an, den Wert aus dem in 'overlib.js' definierten Array 'ol_text' zu lesen.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>caparray</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Weist 'overLib' an, die Überschrift aus dem in 'overlib.js' definierten Array 'ol_caps' zu lesen.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>capicon</entry>
|
||||
<entry>url</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Zeigt das übergebene Bild vor der Überschrift an.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>snapx</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Aliniert das Popup an einem horizontalen Gitter.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>snapy</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Aliniert das Popup an einem vertikalen Gitter.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>fixx</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Fixiert das Popup an der definierten horizontalen Position. Achtung: überschreibt alle anderen horizontalen Positionen.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>fixy</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Fixiert das Popup an der definierten vertikalen Position. Achtung: überschreibt alle anderen vertikalen Positionen.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>background</entry>
|
||||
<entry>url</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Definiert das Hintergrundbild welches anstelle des Tabellenhintergrundes verwendet werden soll.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>padx</entry>
|
||||
<entry>integer,integer</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Erzeugt horizontale Leerzeichen, um den Text platzieren zu können. Achtung: Dies ist eine 2-Parameter Funktion.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>pady</entry>
|
||||
<entry>integer,integer</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Erzeugt vertikale Leerzeichen, um den Text platzieren zu können. Achtung: Dies ist eine 2-Parameter Funktion.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>fullhtml</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Lässt Sie den HTML-Code betreffend einem Hintergrundbild komplett kontrollieren.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>frame</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Kontrolliert Popups in einem anderen Frame. Sehen sie die 'overLib'-Seite für zusätzliche Informationen zu dieser Funktion.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>timeout</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Führt die übergebene Javascript-Funktion aus, und verwendet deren Ausgabe als Text für das Popup.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>delay</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Macht, dass sich das Popup wie ein Tooltip verhält, und nach den definierten Millisekunden verschwindet.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>hauto</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Lässt 'overLib' automatisch definieren an welcher Seite (links/rechts) des Mauszeigers das Popup ausgegeben werden soll.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>vauto</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Lässt 'overLib' automatisch definieren an welcher Seite (oben/unten) des Mauszeigers das Popup ausgegeben werden soll.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
'popup' wird verwendet um Javascript-Popup-Fenster zu erzeugen.
|
||||
</para>
|
||||
<example>
|
||||
<title>popup</title>
|
||||
<programlisting>
|
||||
|
||||
{* 'popup_init' muss am Anfang jeder Seite aufgerufen werden die 'popup' verwendet *}
|
||||
{popup_init src="/javascripts/overlib.js"}
|
||||
|
||||
{* create a link with a popup window when you move your mouse over *}
|
||||
{* ein link mit einem Popup welches geöffnet wird wenn die Maus über dem Link ist. *}
|
||||
<A href="mypage.html" {popup text="This link takes you to my page!"}>mypage</A>
|
||||
|
||||
|
||||
{* Sie können in einem Popup text, html, links und weiteres verwenden *}
|
||||
<A href="mypage.html" {popup sticky=true caption="mypage contents"
|
||||
text="<UL><LI>links<LI>pages<LI>images</UL>" snapx=10 snapy=10}>mypage</A>
|
||||
|
||||
AUSGABE:
|
||||
|
||||
|
||||
(Für Beispiele können Sie sich die Smarty Homepage anschauen.)</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
|
||||
-->
|
@@ -0,0 +1,252 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.function.textformat">
|
||||
<title>textformat (Textformatierung)</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>Attribut Name</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>style</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>aktueller Stil</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>indent</entry>
|
||||
<entry>number</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>0</emphasis></entry>
|
||||
<entry>Anzahl Zeichen die für das einrücken von Zeilen verwendet werden.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>indent_first</entry>
|
||||
<entry>number</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>0</emphasis></entry>
|
||||
<entry>Anzahl Zeichen die für das Einrücken der ersten Zeile verwendet werden.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>indent_char</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>(single space)</emphasis></entry>
|
||||
<entry>Das Zeichen welches zum Einrücken verwendet werden soll.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>wrap</entry>
|
||||
<entry>number</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>80</emphasis></entry>
|
||||
<entry>Maximale Zeilenlänge bevor die Zeile umgebrochen wird.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>wrap_char</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>\n</emphasis></entry>
|
||||
<entry>Das für Zeilenumbrüche zu verwendende Zeichen.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>wrap_cut</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>false</emphasis></entry>
|
||||
<entry>Wenn auf 'true' gesetzt, wird die Zeile an der definierten Position abgeschnitten.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Die Template-Variable welcher die Ausgabe zugewiesen werden soll.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
'textformat' ist eine Funktion um Text zu formatieren. Die Funktion
|
||||
entfernt überflüssige Leerzeichen und formatiert Paragrafen
|
||||
indem sie die Zeilen einrückt und umbricht.
|
||||
</para>
|
||||
<para>
|
||||
Sie können entweder den aktuellen Stil verwenden, oder ihn anhand
|
||||
der Parameter selber definieren. Im Moment ist 'email' der einzig verfügbare Stil.
|
||||
</para>
|
||||
<example>
|
||||
<title>textformat (Text Formatierung)</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}
|
||||
|
||||
AUSGABE:
|
||||
|
||||
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}
|
||||
|
||||
AUSGABE:
|
||||
|
||||
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}
|
||||
|
||||
AUSGABE:
|
||||
|
||||
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}
|
||||
|
||||
AUSGABE:
|
||||
|
||||
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
|
||||
-->
|
120
trunk/docs/de/designers/language-modifiers.xml
Normal file
120
trunk/docs/de/designers/language-modifiers.xml
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.19 Maintainer: andreas Status: ready -->
|
||||
<chapter id="language.modifiers">
|
||||
<title>Variablen-Modifikatoren</title>
|
||||
<para>
|
||||
Variablen-Modifikatoren können auf alle Variablen angewendet
|
||||
werden, um deren Inhalt zu verändern. Dazu hängen sie einfach
|
||||
ein <literal>|</literal> (Pipe-Zeichen) und den Modifikatornamen an
|
||||
die entsprechende Variable an. Ein Modifikator über Parameter in
|
||||
seiner Arbeitsweise beinflusst werden. Diese Parameter werden dem
|
||||
Modifikatorname angehängt und mit <literal>:</literal> getrennt.
|
||||
</para>
|
||||
<example>
|
||||
<title>Modifikator Beispiel</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* Modifikator auf eine Variable anwenden *}
|
||||
{$titel|upper}
|
||||
{* Modifikator mit Parametern *}
|
||||
{$title|truncate:40:"..."}
|
||||
|
||||
{* Modifikator auf Funktionsparameter anwenden *}
|
||||
{html_table loop=$myvar|upper}
|
||||
{* mit Parametern *}
|
||||
{html_table loop=$myvar|truncate:40:"..."}
|
||||
|
||||
{* formatierung einer Zeichenkette *}
|
||||
{"foobar"|upper}
|
||||
|
||||
{* mit date_format das aktuelle Datum formatieren *}
|
||||
{"now"|date_format:"%Y/%m/%d"}
|
||||
|
||||
{* modifier auf eigene Funktion anwenden *}
|
||||
{mailto|upper address="me@domain.dom"}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Wenn Sie einen Modifikator auf ein Array anwenden, wird dieser auf
|
||||
jeden Wert angewandt. Um zu erreichen, dass der Modifkator auf den
|
||||
Array selbst angewendet wird, muss dem Modifikator ein
|
||||
<literal>@</literal> Zeichen vorangestellt werden. Beispiel:
|
||||
<literal>{$artikelTitel|@count}</literal> (gibt die Anzahl Elemente
|
||||
des Arrays $artikelTitel aus.)
|
||||
</para>
|
||||
<para>
|
||||
Modifikatoren können aus Ihrem <link
|
||||
linkend="variable.plugins.dir">$plugins_dir</link> automatisch
|
||||
geladen (sehen Sie dazu auch <link
|
||||
linkend="plugins.naming.conventions">Naming Conventions</link>) oder
|
||||
explizit registriert werden (<link
|
||||
linkend="api.register.modifier">register_modifier</link>).
|
||||
</para>
|
||||
<para>
|
||||
Zudem können alle PHP-Funktionen implizit als Modifikatoren
|
||||
verwendet werden. (Das Beispiel mit dem <literal>@count</literal>
|
||||
Modifier verwendet die Funktion 'count()' von PHP und keinen Smarty
|
||||
Modifikator) PHP Funktionen zu verwenden eröffnet zwei Probleme:
|
||||
erstens: manchmal ist die Parameter Reiehnfolge nicht
|
||||
erwünscht. (<literal>{"%2.f"|sprintf:$float}</literal> funktioniert
|
||||
zwar, sieht aber als
|
||||
<literal>{$float|string_format:"%2.f"}</literal> das durch Smarty
|
||||
geliefert wird, besser aus. Zweitens: wenn <link
|
||||
linkend="variable.security">$security</link> auf TRUE gesetzt ist,
|
||||
müssen alle verwendeten PHP Funktionen im <link
|
||||
linkend="variable.security.settings">
|
||||
$security_settings['MODIFIER_FUNCS']</link>-Array enthalten sein.
|
||||
</para>
|
||||
<para>
|
||||
Siehe auch <link
|
||||
linkend="api.register.modifier">register_modifier()</link>, <link
|
||||
linkend="api.register.function">register_function()</link>, <link
|
||||
linkend="plugins">Smarty durch Plugins erweitern</link> und <link
|
||||
linkend="plugins.modifiers">Variablen-Modifikatoren</link>.
|
||||
</para>
|
||||
|
||||
&designers.language-modifiers.language-modifier-capitalize;
|
||||
&designers.language-modifiers.language-modifier-cat;
|
||||
&designers.language-modifiers.language-modifier-count-characters;
|
||||
&designers.language-modifiers.language-modifier-count-paragraphs;
|
||||
&designers.language-modifiers.language-modifier-count-sentences;
|
||||
&designers.language-modifiers.language-modifier-count-words;
|
||||
&designers.language-modifiers.language-modifier-date-format;
|
||||
&designers.language-modifiers.language-modifier-default;
|
||||
&designers.language-modifiers.language-modifier-escape;
|
||||
&designers.language-modifiers.language-modifier-indent;
|
||||
&designers.language-modifiers.language-modifier-lower;
|
||||
&designers.language-modifiers.language-modifier-nl2br;
|
||||
&designers.language-modifiers.language-modifier-regex-replace;
|
||||
&designers.language-modifiers.language-modifier-replace;
|
||||
&designers.language-modifiers.language-modifier-spacify;
|
||||
&designers.language-modifiers.language-modifier-string-format;
|
||||
&designers.language-modifiers.language-modifier-strip;
|
||||
&designers.language-modifiers.language-modifier-strip-tags;
|
||||
&designers.language-modifiers.language-modifier-truncate;
|
||||
&designers.language-modifiers.language-modifier-upper;
|
||||
&designers.language-modifiers.language-modifier-wordwrap;
|
||||
|
||||
</chapter>
|
||||
<!-- 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
|
||||
-->
|
@@ -0,0 +1,94 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.modifier.capitalize">
|
||||
<title>capitalize (in Grossbuchstaben schreiben)</title>
|
||||
<para>
|
||||
Wird verwendet um den Anfangsbuchstaben aller Wörter in der
|
||||
Variable gross (upper case) zu schreiben.
|
||||
</para>
|
||||
<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>Parameter Position</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Benötigt</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>false</entry>
|
||||
<entry>Bestimmt ob Wörter die Ziffern enthalten auch in
|
||||
Großschreibung gewandelt werden</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<example>
|
||||
<title>capitalize (in Grossbuchstaben schreiben)</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty->assign('articleTitle', 'diebe haben in norwegen 20 tonnen streusalz entwendet.');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Wobei das Template wie folgt aussieht:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$artikelTitel}
|
||||
{$artikelTitel|capitalize}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
AUSGABE:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
diebe haben in norwegen 20 tonnen streusalz entwendet.
|
||||
Diebe Haben In Norwegen 20 Tonnen Streusalz Entwendet.</programlisting>
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<para>
|
||||
Siehe auch <link linkend="language.modifier.lower">lower (in
|
||||
Kleinbuchstaben schreiben)</link> <link
|
||||
linkend="language.modifier.upper">upper (in Grossbuchstaben
|
||||
umwandeln)</link>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.3 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.modifier.cat">
|
||||
<title>cat</title>
|
||||
<para>
|
||||
Dieser Wert wird der aktuellen Variable hinzugefügt.
|
||||
</para>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="cat" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Parameter Position</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Benötigt</entry>
|
||||
<entry>Standard</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>leer/empty</emphasis></entry>
|
||||
<entry>Wert der an die Variable angefügt werden soll.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<example>
|
||||
<title>cat</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty->assign('articleTitle', "Psychics predict world didn't end");
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Bei folgendem index.tpl:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle|cat:" yesterday."}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ausgabe:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Psychics predict world didn't end yesterday.
|
||||
]]>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.modifier.count.characters">
|
||||
<title>count_characters (Buchstaben zählen)</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>Parameter Position</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Benötigt</entry>
|
||||
<entry>Standard</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>false</entry>
|
||||
<entry>Definiert ob Leerzeichen mitgezählt werden sollen.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Wird verwendet um die Anzahl Buchstaben in einer Variable auszugeben.
|
||||
</para>
|
||||
<example>
|
||||
<title>count_characters (Buchstaben zählen)</title>
|
||||
<programlisting>
|
||||
|
||||
{$artikelTitel}
|
||||
{$artikelTitel|count_characters}
|
||||
{$artikelTitel|count_characters:true}
|
||||
|
||||
AUSGABE:
|
||||
|
||||
20% der US-Amerikaner finden ihr Land (die USA) nicht auf der Landkarte.
|
||||
61
|
||||
72
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.modifier.count.paragraphs">
|
||||
<title>count_paragraphs (Absätze zählen)</title>
|
||||
<para>
|
||||
Wird verwendet, um die Anzahl der Absätze in einer Variable zu ermitteln.
|
||||
</para>
|
||||
<example>
|
||||
<title>count_paragraphs (Paragrafen zählen)</title>
|
||||
<programlisting>
|
||||
|
||||
{$artikelTitel}
|
||||
{$artikelTitel|count_paragraphs}
|
||||
|
||||
AUSGABE:
|
||||
|
||||
Britische Spezialeinheiten sind aufgrund eines "Navigationsfehlers" nicht wie beabsichtigt in Gibraltar an Land gegangen, sondern an einem Badestrand, der zu Spanien gehört.
|
||||
|
||||
Ein spanischer Lokführer hat aus Protest gegen die Arbeitsbedingungen nach gearbeiteten acht Stunden einfach seinen Zug stehen lassen, in dem sich allerdings noch 132 Passagiere befanden.
|
||||
2</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
|
||||
-->
|
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.modifier.count.sentences">
|
||||
<title>count_sentences (Sätze zählen)</title>
|
||||
<para>
|
||||
Wird verwendet, um die Anzahl der Sätze in einer Variable zu ermitteln.
|
||||
</para>
|
||||
<example>
|
||||
<title>count_sentences (Sätze zählen)</title>
|
||||
<programlisting>
|
||||
|
||||
{$artikelTitel}
|
||||
{$artikelTitel|count_sentences}
|
||||
|
||||
AUSGABE:
|
||||
|
||||
Zwei Deutsche haben die sogenannte "Painstation" vorgestellt. Bei Fehlern im Spiel wird der Spieler durch Elektroschocks aus der Konsole bestraft. Wer länger aushält, hat gewonnen.
|
||||
3</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
|
||||
-->
|
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.modifier.count.words">
|
||||
<title>count_words (Wörter zählen)</title>
|
||||
<para>
|
||||
Wird verwendet, um die Anzahl Wörter in einer Variable zu ermiteln.
|
||||
</para>
|
||||
<example>
|
||||
<title>count_words (Wörter zählen)</title>
|
||||
<programlisting>
|
||||
|
||||
{$artikelTitel}
|
||||
{$artikelTitel|count_words}
|
||||
|
||||
AUSGABE:
|
||||
|
||||
Südafrika: Eine Polizistin fesselte - mangels mitgebrachter Handschellen - drei Flüchtige mit ihrer Strumpfhose.
|
||||
12</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
|
||||
-->
|
@@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.modifier.date.format">
|
||||
<title>date_format (Datums Formatierung)</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>Parameter Position</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>%b %e, %Y</entry>
|
||||
<entry>Das Format des ausgegebenen Datums.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>2</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>n/a</entry>
|
||||
<entry>Der Standardwert (Datum) wenn die Eingabe leer ist.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Formatiert Datum und Uhrzeit in das definierte 'strftime()'-Format.
|
||||
Daten können als Unix-Timestamps, MySQL-Timestamps
|
||||
und jeder Zeichenkette die aus 'Monat Tag Jahr' (von strtotime parsebar) besteht
|
||||
übergeben werden. Designer können 'date_format' verwenden,
|
||||
um vollständige Kontrolle über das Format des Datums zu erhalten.
|
||||
Falls das übergebene Datum leer ist und der zweite Parameter
|
||||
übergeben wurde, wird dieser formatiert und ausgegeben.
|
||||
</para>
|
||||
<example>
|
||||
<title>date_format (Datums Formatierung)</title>
|
||||
<programlisting>
|
||||
{$smarty.now|date_format}
|
||||
{$smarty.now|date_format:"%A, %B %e, %Y"}
|
||||
{$smarty.now|date_format:"%H:%M:%S"}
|
||||
|
||||
AUSGABE:
|
||||
|
||||
Feb 6, 2001
|
||||
Tuesday, February 6, 2001
|
||||
14:33:00</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>'date_format' Konvertierungs Spezifikation</title>
|
||||
<programlisting>
|
||||
%a - abgekürzter Name des Wochentages, abhängig von der gesetzten Umgebung
|
||||
|
||||
%A - ausgeschriebener Name des Wochentages, abhängig von der gesetzten Umgebung
|
||||
|
||||
%b - abgekürzter Name des Monats, abhängig von der gesetzten Umgebung
|
||||
|
||||
%B - ausgeschriebener Name des Monats, abhängig von der gesetzten Umgebung
|
||||
|
||||
%c - Wiedergabewerte für Datum und Zeit, abhängig von der gesetzten Umgebung
|
||||
|
||||
%C - Jahrhundert (Jahr geteilt durch 100, gekürzt auf Integer, Wertebereich 00 bis 99)
|
||||
|
||||
%d - Tag des Monats als Zahl (Bereich 00 bis 31)
|
||||
|
||||
%D - so wie %m/%d/%y
|
||||
|
||||
%e - Tag des Monats als Dezimal-Wert, einstelligen Werten wird ein Leerzeichen voran gestellt (Wertebereich Ž 0Ž bis Ž31Ž)
|
||||
|
||||
%g - wie %G, aber ohne Jahrhundert.
|
||||
|
||||
%G - Das vierstellige Jahr entsprechend der ISO Wochennummer (siehe %V). Das gleiche Format und der gleiche Wert wie bei %Y. Besonderheit: entspricht die ISO Wochennummer dem vorhergehenden oder folgenden Jahr, wird dieses Jahr verwendet.
|
||||
|
||||
%h - so wie %b
|
||||
|
||||
%H - Stunde als Zahl im 24-Stunden-Format (Bereich 00 bis 23)
|
||||
|
||||
%I - Stunde als Zahl im 12-Stunden-Format (Bereich 01 bis 12)
|
||||
|
||||
%j - Tag des Jahres als Zahl (Bereich 001 bis 366)
|
||||
|
||||
%m - Monat als Zahl (Bereich 01 bis 12)
|
||||
|
||||
%M - Minute als Dezimal-Wert
|
||||
|
||||
%n - neue Zeile
|
||||
|
||||
%p - entweder `am' oder `pm' (abhängig von der gesetzten Umgebung) oder die entsprechenden Zeichenketten der gesetzten Umgebung
|
||||
|
||||
%r - Zeit im Format a.m. oder p.m.
|
||||
|
||||
%R - Zeit in der 24-Stunden-Formatierung
|
||||
|
||||
%S - Sekunden als Dezimal-Wert
|
||||
|
||||
%t - Tabulator
|
||||
|
||||
%T - aktuelle Zeit, genau wie %H:%M:%S
|
||||
|
||||
%u - Tag der Woche als Dezimal-Wert [1,7], dabei ist 1 der Montag.
|
||||
|
||||
%U - Nummer der Woche des aktuellen Jahres als Dezimal-Wert, beginnend mit dem ersten Sonntag als erstem Tag der ersten Woche.
|
||||
|
||||
%V - Kalenderwoche (nach ISO 8601:1988) des aktuellen Jahres. Als Dezimal-Zahl mit dem Wertebereich 01 bis 53, wobei die Woche 01 die erste Woche mit mindestens 4 Tagen im aktuellen Jahr ist. Die Woche beginnt montags (nicht sonntags). (Benutzen Sie %G or %g für die Jahreskomponente, die der Wochennummer für den gegebenen Timestamp entspricht.)
|
||||
|
||||
%w - Wochentag als Dezimal-Wert, Sonntag ist 0
|
||||
|
||||
%W - Nummer der Woche des aktuellen Jahres, beginnend mit dem ersten Montag als erstem Tag der ersten Woche.
|
||||
|
||||
%x - bevorzugte Datumswiedergabe (ohne Zeit), abhängig von der gesetzten Umgebung.
|
||||
|
||||
%X - bevorzugte Zeitwiedergabe (ohne Datum), abhängig von der gesetzten Umgebung.
|
||||
|
||||
%y - Jahr als 2-stellige-Zahl (Bereich 00 bis 99)
|
||||
|
||||
%Y - Jahr als 4-stellige-Zahl inklusive des Jahrhunderts
|
||||
|
||||
%Z - Zeitzone, Name oder eine Abkürzung
|
||||
|
||||
%% - ein %-Zeichen
|
||||
|
||||
BEMERKUNG FÜR PROGRAMMIERER: 'date_format' ist ein wrapper für PHP's 'strftime()'-Funktion.
|
||||
Je nachdem auf welchem System ihr PHP kompiliert wurde, ist es durchaus möglich, dass nicht alle
|
||||
angegebenen Formatierungszeichen unterstützt werden. Beispielsweise stehen %e, %T, %R und %D
|
||||
(eventuell weitere) auf Windowssystemen nicht zur Verfügung.</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
|
||||
-->
|
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.modifier.default">
|
||||
<title>default (Standardwert)</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>Parameter Position</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>leer</emphasis></entry>
|
||||
<entry>Dieser Wert wird ausgegeben wenn die Variable leer ist.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Wird verwendet um den Standardwert einer Variable festzulegen.
|
||||
Falls die Variable leer ist oder nicht gesetzt wurde,
|
||||
wird dieser Standardwert ausgegeben.
|
||||
Default (Standardwert) hat 1 Parameter.
|
||||
</para>
|
||||
<example>
|
||||
<title>default (Standardwert)</title>
|
||||
<programlisting>
|
||||
{* gib "kein Titel" (ohne Anführungszeichen) aus, falls '$artikelTitel' leer ist *}
|
||||
{$artikelTitel|default:"kein Titel"}
|
||||
|
||||
AUSGABE:
|
||||
|
||||
kein Titel</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
|
||||
-->
|
@@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.5 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.modifier.escape">
|
||||
<title>escape (Maskieren)</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="6">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="possible" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Parameter Position</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Mögliche (erlaubte) Werte</entry>
|
||||
<entry>Standardwerte</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>html, htmlall, url, quotes, hex, hexentity, javascript</entry>
|
||||
<entry>html</entry>
|
||||
<entry>Definiert die zu verwendende Maskierung.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Wird verwendet um eine Variable mit HTML, URL oder
|
||||
einfachen Anführungszeichen, beziehungsweise Hex oder Hex-Entitäten
|
||||
zu maskieren. Hex und Hex-Entity kann verwendet werden um "mailto:"
|
||||
-Links so zu verändern, dass sie von Web-Spiders (E-Mail Sammlern)
|
||||
verborgen bleiben und dennoch les-/linkbar für Webbrowser bleiben.
|
||||
Als Standard, wird 'HTML'-Maskierung verwendet.
|
||||
</para>
|
||||
<example>
|
||||
<title>escape (Maskieren)</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
index.php:
|
||||
|
||||
$smarty->assign('TitreArticle', "'Zwei Unbekannte haben im Lidl in Monheim 24 Pakete Kaffee gestohlen.'");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Wobei im Template folgendes steht:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$artikelTitel}
|
||||
{$artikelTitel|escape}
|
||||
{$artikelTitel|escape:"html"} {* maskiert & " ' < > *}
|
||||
{$artikelTitel|escape:"htmlall"} {* maskiert ALLE html Entitäten *}
|
||||
{$artikelTitel|escape:"url"}
|
||||
{$artikelTitel|escape:"quotes"}
|
||||
<a href="mailto:{$EmailAdresse|escape:"hex"}">{$EmailAdresse|escape:"hexentity"}</a>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ausgabe:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
'Zwei Unbekannte haben im Lidl in Monheim 24 Pakete Kaffee gestohlen.'
|
||||
&#039;Zwei Unbekannte haben im Lidl in Monheim 24 Pakete Kaffee gestohlen.&#039;
|
||||
&#039;Zwei Unbekannte haben im Lidl in Monheim 24 Pakete Kaffee gestohlen.&#039;
|
||||
&#039;Zwei Unbekannte haben im Lidl in Monheim 24 Pakete Kaffee gestohlen.&#039;
|
||||
%27Zwei+Unbekannte+haben+im+Lidl+in+Monheim+24+Pakete+Kaffee+gestohlen.%27
|
||||
\'Zwei Unbekannte haben im Lidl in Monheim 24 Pakete Kaffee gestohlen.\'
|
||||
<a href="mailto:%62%6f%62%40%6d%65%2e%6e%65%74">&#x62;&#x6f;&#x62;&#x40;&#x6d;&#x65;&#x2e;&#x6e;&#x65;&#x74;</a>
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<para>
|
||||
Siehe auch <link linkend="language.escaping">Smarty Parsing umgehen</link>
|
||||
und <link linkend="tips.obfuscating.email">Verschleierung von E-mail Adressen</link>.
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,111 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.modifier.indent">
|
||||
<title>indent (Einrücken)</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>Parameter Position</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>4</entry>
|
||||
<entry>Definiert die Länge der Zeichenkette die verwendet werden soll um den Text einzurücken.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>2</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>(ein Leerschlag)</entry>
|
||||
<entry>Definiert das Zeichen, welches verwendet werden soll um den Text einzurücken.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Wird verwendet, um eine Zeichenkette auf jeder Zeile einzurücken.
|
||||
Optionaler Parameter ist die Anzahl der Zeichen,
|
||||
um die der Text eingerückt werden soll. Standardlänge ist 4.
|
||||
Als zweiten optionalen Parameter können sie ein Zeichen übergeben,
|
||||
das für die Einrückung verwendet werden soll (für Tabulatoren: '\t').
|
||||
</para>
|
||||
<example>
|
||||
<title>indent (Einrücken)</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
|
||||
{$articleTitle|indent}
|
||||
|
||||
{$articleTitle|indent:10}
|
||||
|
||||
{$articleTitle|indent:1:"\t"}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ausgabe:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Nach einer feuchtfröhlichen Nacht fand ein Brite sein Auto
|
||||
nicht mehr und meldete es als gestohlen. Ein Jahr später
|
||||
besuchte er den Ort wieder und erinnerte sich, dass er
|
||||
das Auto nur an einem anderen Ort abgestellt hatte -
|
||||
dort stand das Fahrzeug nach einem Jahr auch noch.
|
||||
|
||||
Nach einer feuchtfröhlichen Nacht fand ein Brite sein Auto
|
||||
nicht mehr und meldete es als gestohlen. Ein Jahr später
|
||||
besuchte er den Ort wieder und erinnerte sich, dass er
|
||||
das Auto nur an einem anderen Ort abgestellt hatte -
|
||||
dort stand das Fahrzeug nach einem Jahr auch noch.
|
||||
|
||||
Nach einer feuchtfröhlichen Nacht fand ein Brite sein Auto
|
||||
nicht mehr und meldete es als gestohlen. Ein Jahr später
|
||||
besuchte er den Ort wieder und erinnerte sich, dass er
|
||||
das Auto nur an einem anderen Ort abgestellt hatte -
|
||||
dort stand das Fahrzeug nach einem Jahr auch noch.
|
||||
|
||||
Nach einer feuchtfröhlichen Nacht fand ein Brite sein Auto
|
||||
nicht mehr und meldete es als gestohlen. Ein Jahr später
|
||||
besuchte er den Ort wieder und erinnerte sich, dass er
|
||||
das Auto nur an einem anderen Ort abgestellt hatte -
|
||||
dort stand das Fahrzeug nach einem Jahr auch noch.
|
||||
]]>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.modifier.lower">
|
||||
<title>lower (in Kleinbuchstaben schreiben)</title>
|
||||
<para>
|
||||
Wird verwendet um eine Zeichenkette in Kleinbuchstaben auszugeben.
|
||||
</para>
|
||||
<example>
|
||||
<title>lower (in Kleinbuchstaben schreiben)</title>
|
||||
<programlisting>
|
||||
{$artikelTitel}
|
||||
{$artikelTitel|lower}
|
||||
|
||||
AUSGABE:
|
||||
|
||||
In Kalifornien wurde ein Hund in das Wählerverzeichnis eingetragen.
|
||||
in kalifornien wurde ein hund in das wählerverzeichnis eingetragen.</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
|
||||
-->
|
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.modifier.nl2br">
|
||||
<title>nl2br</title>
|
||||
<para>
|
||||
Konvertiert alle Zeilenschaltungen in <br /> Tags. Genau wie die PHP Funktion nl2br.
|
||||
</para>
|
||||
<example>
|
||||
<title>nl2br</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', "Sonne oder Regen erwartet,\nnachts dunkel.");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Wobei index.tpl wie folgt aussieht:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle|nl2br}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ausgabe:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Sonne oder Regen erwartet,<br />nachts dunkel.
|
||||
]]>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.modifier.regex.replace">
|
||||
<title>regex_replace (Ersetzen mit regulären Ausdrücken)</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>Parameter Position</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Ja</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Definiert das zu ersetzende Suchmuster, als regulären Ausdruck.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>2</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Ja</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Definiert die ersetzende Zeichenkette.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Suchen/Ersetzen mit regulären Ausdrücken. Folgt der Syntax von PHP's preg_replace().
|
||||
</para>
|
||||
<example>
|
||||
<title>regex_replace (Ersetzen mit regulären Ausdrücken)</title>
|
||||
<programlisting>
|
||||
{* Ersetzt jeden Zeilenumbruch-Tabulator-Neuezeile, durch ein Leerzeichen. *}
|
||||
|
||||
{$artikelTitel}
|
||||
{$artikelTitel|regex_replace:"/[\r\t\n]/":" "}
|
||||
|
||||
AUSGABE:
|
||||
|
||||
Ein Bankangestellter in England zerkaut aus Stress
|
||||
bei der Arbeit wöchentlich 50 Kugelschreiber. Er ist deshalb in Behandlung.
|
||||
Ein Bankangestellter in England zerkaut aus Stress bei der Arbeit wöchentlich 50 Kugelschreiber. Er ist deshalb in Behandlung.</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
|
||||
-->
|
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.modifier.replace">
|
||||
<title>replace (Ersetzen)</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>Parameter Position</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Ja</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Die zu ersetzende Zeichenkette.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>2</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Ja</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Die ersetzende Zeichenkette.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Einfaches suchen/ersetzen in einer Variable.
|
||||
</para>
|
||||
<example>
|
||||
<title>replace (Ersetzen)</title>
|
||||
<programlisting>
|
||||
{$artikelTitel}
|
||||
{$artikelTitel|replace:"Fracht":"Lieferung"}
|
||||
{$artikelTitel|replace:" ":" "}
|
||||
|
||||
AUSGABE:
|
||||
|
||||
Ein Holsten-Laster hat in England seine komplette Fracht verloren, die nun von jedermann aufgesammelt werden kann.
|
||||
Ein Holsten-Laster hat in England seine komplette Lieferung verloren, die nun von jedermann aufgesammelt werden kann.
|
||||
Ein Holsten-Laster hat in England seine komplette Fracht verloren, die nun von jedermann aufgesammelt werden kann.
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.modifier.spacify">
|
||||
<title>spacify (Zeichenkette splitten)</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>Parameter Position</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry><emphasis>ein Leerzeichen</emphasis></entry>
|
||||
<entry>Definiert die zwischen allen Zeichen einzufügende Zeichenkette.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Fügt zwischen allen Zeichen einer Variablen ein Leerzeichen ein.
|
||||
Eine alternativ einzufügende Zeichenkette kann über
|
||||
den ersten Parameter definiert werden.
|
||||
</para>
|
||||
<example>
|
||||
<title>spacify (Zeichenkette splitten)</title>
|
||||
<programlisting>
|
||||
{$artikelTitel}
|
||||
{$artikelTitel|spacify}
|
||||
{$artikelTitel|spacify:"^^"}
|
||||
|
||||
AUSGABE:
|
||||
|
||||
Ein Mann flog 5000 km um sich die Haare schneiden zu lassen. Grund: Seine offensichtlich begnadete Friseuse zog von den Bermudas nach England und bis dato fand er keine Neue.
|
||||
E i n M a n n f l o g 5 0 0 0 k m u m s i c h d i e H a a r e s c h n e i d e n z u l a s s e n . G r u n d : S e i n e o f f e n s i c h t l i c h b e g n a d e t e F r i s e u s e z o g v o n d e n B e r m u d a s n a c h E n g l a n d u n d b i s d a t o f a n d e r k e i n e N e u e .
|
||||
E^^i^^n^^ ^^M^^a^^n^^n^^ ^^f^^l^^o^^g^^ ^^5^^0^^0^^0^^ ^^k^^m^^ ^^u^^m^^ ^^s^^i^^c^^h^^ ^^d^^i^^e^^ ^^H^^a^^a^^r^^e^^ ^^s^^c^^h^^n^^e^^i^^d^^e^^n^^ ^^z^^u^^ ^^l^^a^^s^^s^^e^^n^^.^^ ^^G^^r^^u^^n^^d^^:^^ ^^S^^e^^i^^n^^e^^ ^^o^^f^^f^^e^^n^^s^^i^^c^^h^^t^^l^^i^^c^^h^^ ^^b^^e^^g^^n^^a^^d^^e^^t^^e^^ ^^F^^r^^i^^s^^e^^u^^s^^e^^ ^^z^^o^^g^^ ^^v^^o^^n^^ ^^d^^e^^n^^ ^^B^^e^^r^^m^^u^^d^^a^^s^^ ^^n^^a^^c^^h^^ ^^E^^n^^g^^l^^a^^n^^d^^ ^^u^^n^^d^^ ^^b^^i^^s^^ ^^d^^a^^t^^o^^ ^^f^^a^^n^^d^^ ^^e^^r^^ ^^k^^e^^i^^n^^e^^ ^^N^^e^^u^^e^^.^^</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
|
||||
-->
|
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.modifier.string.format">
|
||||
<title>string_format (Zeichenkette formatieren)</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>Parameter Position</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erfoderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Ja</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Das zu verwendende Format (sprintf).</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Wird verwendet um eine Zeichenkette, wie zum Beispiel dezimale Werte, zu formatieren.
|
||||
Folgt der Formatierungs-Syntax von sprintf.
|
||||
</para>
|
||||
<example>
|
||||
<title>string_format (Zeichenkette formatieren)</title>
|
||||
<programlisting>
|
||||
{$wert}
|
||||
{$wert|string_format:"%.2f"}
|
||||
{$wert|string_format:"%d"}
|
||||
|
||||
AUSGABE:
|
||||
|
||||
23.5787446
|
||||
23.58
|
||||
24</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
|
||||
-->
|
@@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.modifier.strip.tags">
|
||||
<title>strip_tags</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>Parameter Position</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Benötigt</entry>
|
||||
<entry>Standard</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>bool</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>true</entry>
|
||||
<entry>Definiert ob Tags durch ' ' oder '' ersetzt werden sollen.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Entfernt alle Markup tags. - Eigentlich alles zwischen < und >.
|
||||
</para>
|
||||
<example>
|
||||
<title>strip_tags</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('articleTitle', "Da ein <font face="helvetica">betrunkener Mann</font> auf einem Flug ausfallend wurde, musste <b>das Flugzeug</b> auf einer kleinen Insel zwischenlanden und den Mann aussetzen.");
|
||||
$smarty->display('index.tpl');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
where index.tpl is:
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$articleTitle}
|
||||
{$articleTitle|strip_tags} {* same as {$articleTitle|strip_tags:true} *}
|
||||
{$articleTitle|strip_tags:false}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
This will output:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Da ein <font face="helvetica">betrunkener Mann</font> auf einem Flug ausfallend wurde, musste <b>das Flugzeug</b> auf einer kleinen Insel zwischenlanden und den Mann aussetzen.
|
||||
Da ein betrunkener Mann auf einem Flug ausfallend wurde, musste das Flugzeug auf einer kleinen Insel zwischenlanden und den Mann aussetzen.
|
||||
Da ein <font face="helvetica">betrunkener Mann</font> auf einem Flug ausfallend wurde, musste <b>das Flugzeug</b> auf einer kleinen Insel zwischenlanden und den Mann aussetzen.
|
||||
]]>
|
||||
</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
|
||||
-->
|
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.modifier.strip">
|
||||
<title>strip (Zeichenkette strippen)</title>
|
||||
<para>
|
||||
Ersetzt mehrfache Leerzeichen, Zeilenumbrüche und Tabulatoren durch ein Leerzeichen
|
||||
oder eine alternative Zeichenkette.
|
||||
</para>
|
||||
<note>
|
||||
<title>Achtung</title>
|
||||
<para>
|
||||
Falls Sie ganze Blöcke eines Templates 'strippen' möchten,
|
||||
verwenden Sie dazu <link linkend="language.function.strip">strip</link>.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>strip (Zeichenkette strippen)</title>
|
||||
<programlisting>
|
||||
{$artikelTitel}
|
||||
{$artikelTitel|strip}
|
||||
{$artikelTitel|strip:"&nbsp;"}
|
||||
|
||||
AUSGABE:
|
||||
|
||||
Ein 18 Jahre alter Pappkarton
|
||||
erzielte bei Ebay einen Erlös von
|
||||
536 Dollar. Es war der Karton, in dem der erste Apple verpackt war.
|
||||
Ein 18 Jahre alter Pappkarton erzielte bei Ebay einen Erlös von 536 Dollar. Es war der Karton, in dem der erste Apple verpackt war.
|
||||
Ein&nbsp;18&nbsp;Jahre&nbsp;alter&nbsp;Pappkarton&nbsp;erzielte&nbsp;bei&nbsp;Ebay&nbsp;einen&nbsp;Erlös&nbsp;von&nbsp;536&nbsp;Dollar.&nbsp;Es&nbsp;war&nbsp;der&nbsp;Karton,&nbsp;in&nbsp;dem&nbsp;der&nbsp;erste&nbsp;Apple&nbsp;verpackt&nbsp;war.</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
|
||||
-->
|
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.modifier.truncate">
|
||||
<title>truncate (kürzen)</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>Parameter Position</entry>
|
||||
<entry>Typ</entry>
|
||||
<entry>Erforderlich</entry>
|
||||
<entry>Standardwert</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>80</entry>
|
||||
<entry>Länge, auf die die Zeichenkette gekürzt werden soll.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>2</entry>
|
||||
<entry>string</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>...</entry>
|
||||
<entry> An die gekürzte Zeichenkette anzuhängende Zeichenkette.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>3</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Nein</entry>
|
||||
<entry>false</entry>
|
||||
<entry>Nur nach ganzen Worten (false) oder exakt an der definierten Stelle (true) kürzen.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Kürzt die Variable auf eine definierte Länge. Standardwert sind 80 Zeichen.
|
||||
Als optionaler zweiter Parameter kann eine Zeichenkette übergeben werden, welche
|
||||
der gekürzten Variable angehängt wird. Diese zusätzliche Zeichenkette
|
||||
wird bei der Berechnung der Länge berücksichtigt. Normalerweise wird
|
||||
'truncate' versuchen, die Zeichenkette zwischen zwei Wörtern umzubrechen. Um die
|
||||
Zeichenkette exakt an der definierten Position abzuscheiden,
|
||||
können sie als dritten Parameter 'true' übergeben.
|
||||
</para>
|
||||
<example>
|
||||
<title>truncate (kürzen)</title>
|
||||
<programlisting>
|
||||
{$artikelTitel}
|
||||
{$artikelTitel|truncate}
|
||||
{$artikelTitel|truncate:30}
|
||||
{$artikelTitel|truncate:30:""}
|
||||
{$artikelTitel|truncate:30:"---"}
|
||||
{$artikelTitel|truncate:30:"":true}
|
||||
{$artikelTitel|truncate:30:"...":true}
|
||||
|
||||
AUSGABE:
|
||||
|
||||
George W. Bush will die frei gewählten Mitglieder der ICANN ("Internetregierung") durch Regierungsvertreter der USA ersetzen.
|
||||
George W. Bush will die frei gewählten Mitglieder der ICANN ("Internetregierung") durch Regierungsvertreter der USA ersetzen.
|
||||
George W. Bush will die frei...
|
||||
George W. Bush will die frei
|
||||
George W. Bush will die frei---
|
||||
George W. Bush will die frei
|
||||
George W. Bush will die fr...</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
|
||||
-->
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user