Browse Source

first commit

Jesús 1 year ago
commit
8863159339
Signed by: Jesús <heckyel@hyperbola.info> GPG Key ID: F6EE7BC59A315766
100 changed files with 18375 additions and 0 deletions
  1. 10
    0
      .gitignore
  2. 21
    0
      403.html
  3. 21
    0
      404.html
  4. 21
    0
      500.html
  5. 661
    0
      LICENSE
  6. 26
    0
      README.md
  7. 53
    0
      index.php
  8. 32
    0
      mail/mail.php
  9. 18
    0
      package.json
  10. 91
    0
      robots.txt
  11. 22
    0
      smarty/.gitattributes
  12. 221
    0
      smarty/.gitignore
  13. 26
    0
      smarty/.travis.yml
  14. 29
    0
      smarty/COMPOSER_RELEASE_NOTES.txt
  15. 165
    0
      smarty/COPYING.lib
  16. 76
    0
      smarty/INHERITANCE_RELEASE_NOTES.txt
  17. 233
    0
      smarty/NEW_FEATURES.txt
  18. 575
    0
      smarty/README
  19. 65
    0
      smarty/README.md
  20. 109
    0
      smarty/SMARTY_2_BC_NOTES.txt
  21. 24
    0
      smarty/SMARTY_3.0_BC_NOTES.txt
  22. 306
    0
      smarty/SMARTY_3.1_NOTES.txt
  23. 3087
    0
      smarty/change_log.txt
  24. 43
    0
      smarty/composer.json
  25. 318
    0
      smarty/lexer/smarty_internal_configfilelexer.plex
  26. 362
    0
      smarty/lexer/smarty_internal_configfileparser.y
  27. 682
    0
      smarty/lexer/smarty_internal_templatelexer.plex
  28. 1351
    0
      smarty/lexer/smarty_internal_templateparser.y
  29. 107
    0
      smarty/libs/Autoloader.php
  30. 1529
    0
      smarty/libs/Smarty.class.php
  31. 455
    0
      smarty/libs/SmartyBC.class.php
  32. 160
    0
      smarty/libs/debug.tpl
  33. 112
    0
      smarty/libs/plugins/block.textformat.php
  34. 73
    0
      smarty/libs/plugins/function.counter.php
  35. 105
    0
      smarty/libs/plugins/function.cycle.php
  36. 221
    0
      smarty/libs/plugins/function.fetch.php
  37. 249
    0
      smarty/libs/plugins/function.html_checkboxes.php
  38. 164
    0
      smarty/libs/plugins/function.html_image.php
  39. 204
    0
      smarty/libs/plugins/function.html_options.php
  40. 232
    0
      smarty/libs/plugins/function.html_radios.php
  41. 391
    0
      smarty/libs/plugins/function.html_select_date.php
  42. 366
    0
      smarty/libs/plugins/function.html_select_time.php
  43. 176
    0
      smarty/libs/plugins/function.html_table.php
  44. 153
    0
      smarty/libs/plugins/function.mailto.php
  45. 104
    0
      smarty/libs/plugins/function.math.php
  46. 101
    0
      smarty/libs/plugins/modifier.capitalize.php
  47. 65
    0
      smarty/libs/plugins/modifier.date_format.php
  48. 112
    0
      smarty/libs/plugins/modifier.debug_print_var.php
  49. 200
    0
      smarty/libs/plugins/modifier.escape.php
  50. 58
    0
      smarty/libs/plugins/modifier.regex_replace.php
  51. 34
    0
      smarty/libs/plugins/modifier.replace.php
  52. 27
    0
      smarty/libs/plugins/modifier.spacify.php
  53. 66
    0
      smarty/libs/plugins/modifier.truncate.php
  54. 29
    0
      smarty/libs/plugins/modifiercompiler.cat.php
  55. 32
    0
      smarty/libs/plugins/modifiercompiler.count_characters.php
  56. 27
    0
      smarty/libs/plugins/modifiercompiler.count_paragraphs.php
  57. 27
    0
      smarty/libs/plugins/modifiercompiler.count_sentences.php
  58. 32
    0
      smarty/libs/plugins/modifiercompiler.count_words.php
  59. 35
    0
      smarty/libs/plugins/modifiercompiler.default.php
  60. 117
    0
      smarty/libs/plugins/modifiercompiler.escape.php
  61. 33
    0
      smarty/libs/plugins/modifiercompiler.from_charset.php
  62. 33
    0
      smarty/libs/plugins/modifiercompiler.indent.php
  63. 31
    0
      smarty/libs/plugins/modifiercompiler.lower.php
  64. 21
    0
      smarty/libs/plugins/modifiercompiler.noprint.php
  65. 25
    0
      smarty/libs/plugins/modifiercompiler.string_format.php
  66. 33
    0
      smarty/libs/plugins/modifiercompiler.strip.php
  67. 29
    0
      smarty/libs/plugins/modifiercompiler.strip_tags.php
  68. 33
    0
      smarty/libs/plugins/modifiercompiler.to_charset.php
  69. 50
    0
      smarty/libs/plugins/modifiercompiler.unescape.php
  70. 29
    0
      smarty/libs/plugins/modifiercompiler.upper.php
  71. 51
    0
      smarty/libs/plugins/modifiercompiler.wordwrap.php
  72. 89
    0
      smarty/libs/plugins/outputfilter.trimwhitespace.php
  73. 34
    0
      smarty/libs/plugins/shared.escape_special_chars.php
  74. 36
    0
      smarty/libs/plugins/shared.literal_compiler_param.php
  75. 45
    0
      smarty/libs/plugins/shared.make_timestamp.php
  76. 55
    0
      smarty/libs/plugins/shared.mb_str_replace.php
  77. 54
    0
      smarty/libs/plugins/shared.mb_unicode.php
  78. 75
    0
      smarty/libs/plugins/shared.mb_wordwrap.php
  79. 19
    0
      smarty/libs/plugins/variablefilter.htmlspecialchars.php
  80. 220
    0
      smarty/libs/sysplugins/smarty_cacheresource.php
  81. 275
    0
      smarty/libs/sysplugins/smarty_cacheresource_custom.php
  82. 507
    0
      smarty/libs/sysplugins/smarty_cacheresource_keyvaluestore.php
  83. 68
    0
      smarty/libs/sysplugins/smarty_data.php
  84. 90
    0
      smarty/libs/sysplugins/smarty_internal_block.php
  85. 220
    0
      smarty/libs/sysplugins/smarty_internal_cacheresource_file.php
  86. 51
    0
      smarty/libs/sysplugins/smarty_internal_compile_append.php
  87. 94
    0
      smarty/libs/sysplugins/smarty_internal_compile_assign.php
  88. 247
    0
      smarty/libs/sysplugins/smarty_internal_compile_block.php
  89. 77
    0
      smarty/libs/sysplugins/smarty_internal_compile_break.php
  90. 89
    0
      smarty/libs/sysplugins/smarty_internal_compile_call.php
  91. 112
    0
      smarty/libs/sysplugins/smarty_internal_compile_capture.php
  92. 98
    0
      smarty/libs/sysplugins/smarty_internal_compile_config_load.php
  93. 77
    0
      smarty/libs/sysplugins/smarty_internal_compile_continue.php
  94. 42
    0
      smarty/libs/sysplugins/smarty_internal_compile_debug.php
  95. 72
    0
      smarty/libs/sysplugins/smarty_internal_compile_eval.php
  96. 134
    0
      smarty/libs/sysplugins/smarty_internal_compile_extends.php
  97. 170
    0
      smarty/libs/sysplugins/smarty_internal_compile_for.php
  98. 330
    0
      smarty/libs/sysplugins/smarty_internal_compile_foreach.php
  99. 216
    0
      smarty/libs/sysplugins/smarty_internal_compile_function.php
  100. 0
    0
      smarty/libs/sysplugins/smarty_internal_compile_if.php

+ 10
- 0
.gitignore View File

@@ -0,0 +1,10 @@
1
+### NPM ###
2
+node_modules/
3
+### Sass ###
4
+.sass-cache/
5
+*.css.map
6
+*.min.css.map
7
+### Smarty ###
8
+*.tpl.php
9
+### Public ###
10
+public/

+ 21
- 0
403.html View File

@@ -0,0 +1,21 @@
1
+<!DOCTYPE html>
2
+<html lang="es">
3
+    <head>
4
+        <meta charset="UTF-8">
5
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+        <meta http-equiv="X-UA-Compatible" content="ie=edge">
7
+        <title>Portafolio</title>
8
+        <style>
9
+         body{
10
+             background: silver;
11
+         }
12
+         h2 {
13
+             color: darkblue;
14
+             text-align: center;
15
+         }
16
+        </style>
17
+    </head>
18
+    <body>
19
+        <h2>Lo sentimos, url perdida o no disponible.</h2>
20
+    </body>
21
+</html>

+ 21
- 0
404.html View File

@@ -0,0 +1,21 @@
1
+<!DOCTYPE html>
2
+<html lang="es">
3
+    <head>
4
+        <meta charset="UTF-8"/>
5
+        <title>Portafolio</title>
6
+        <style>
7
+         body{
8
+             background: silver;
9
+         }
10
+         h2 {
11
+             color: darkblue;
12
+             text-align: center;
13
+         }
14
+        </style>
15
+    </head>
16
+    <body>
17
+        <div>
18
+            <h2>Error 404: P&aacute;gina no encontrada</h2>
19
+        </div>
20
+    </body>
21
+</html>

+ 21
- 0
500.html View File

@@ -0,0 +1,21 @@
1
+<!DOCTYPE html>
2
+<html lang="es">
3
+    <head>
4
+        <meta charset="UTF-8">
5
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+        <meta http-equiv="X-UA-Compatible" content="ie=edge">
7
+        <title>Portafolio</title>
8
+        <style>
9
+         body{
10
+             background: silver;
11
+         }
12
+         h2 {
13
+             color: darkblue;
14
+             text-align: center;
15
+         }
16
+        </style>
17
+    </head>
18
+    <body>
19
+        <h2>Lo sentimos, hubo un error en el servidor</h2>
20
+    </body>
21
+</html>

+ 661
- 0
LICENSE View File

@@ -0,0 +1,661 @@
1
+                    GNU AFFERO GENERAL PUBLIC LICENSE
2
+                       Version 3, 19 November 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+                            Preamble
9
+
10
+  The GNU Affero General Public License is a free, copyleft license for
11
+software and other kinds of works, specifically designed to ensure
12
+cooperation with the community in the case of network server software.
13
+
14
+  The licenses for most software and other practical works are designed
15
+to take away your freedom to share and change the works.  By contrast,
16
+our General Public Licenses are intended to guarantee your freedom to
17
+share and change all versions of a program--to make sure it remains free
18
+software for all its users.
19
+
20
+  When we speak of free software, we are referring to freedom, not
21
+price.  Our General Public Licenses are designed to make sure that you
22
+have the freedom to distribute copies of free software (and charge for
23
+them if you wish), that you receive source code or can get it if you
24
+want it, that you can change the software or use pieces of it in new
25
+free programs, and that you know you can do these things.
26
+
27
+  Developers that use our General Public Licenses protect your rights
28
+with two steps: (1) assert copyright on the software, and (2) offer
29
+you this License which gives you legal permission to copy, distribute
30
+and/or modify the software.
31
+
32
+  A secondary benefit of defending all users' freedom is that
33
+improvements made in alternate versions of the program, if they
34
+receive widespread use, become available for other developers to
35
+incorporate.  Many developers of free software are heartened and
36
+encouraged by the resulting cooperation.  However, in the case of
37
+software used on network servers, this result may fail to come about.
38
+The GNU General Public License permits making a modified version and
39
+letting the public access it on a server without ever releasing its
40
+source code to the public.
41
+
42
+  The GNU Affero General Public License is designed specifically to
43
+ensure that, in such cases, the modified source code becomes available
44
+to the community.  It requires the operator of a network server to
45
+provide the source code of the modified version running there to the
46
+users of that server.  Therefore, public use of a modified version, on
47
+a publicly accessible server, gives the public access to the source
48
+code of the modified version.
49
+
50
+  An older license, called the Affero General Public License and
51
+published by Affero, was designed to accomplish similar goals.  This is
52
+a different license, not a version of the Affero GPL, but Affero has
53
+released a new version of the Affero GPL which permits relicensing under
54
+this license.
55
+
56
+  The precise terms and conditions for copying, distribution and
57
+modification follow.
58
+
59
+                       TERMS AND CONDITIONS
60
+
61
+  0. Definitions.
62
+
63
+  "This License" refers to version 3 of the GNU Affero General Public License.
64
+
65
+  "Copyright" also means copyright-like laws that apply to other kinds of
66
+works, such as semiconductor masks.
67
+
68
+  "The Program" refers to any copyrightable work licensed under this
69
+License.  Each licensee is addressed as "you".  "Licensees" and
70
+"recipients" may be individuals or organizations.
71
+
72
+  To "modify" a work means to copy from or adapt all or part of the work
73
+in a fashion requiring copyright permission, other than the making of an
74
+exact copy.  The resulting work is called a "modified version" of the
75
+earlier work or a work "based on" the earlier work.
76
+
77
+  A "covered work" means either the unmodified Program or a work based
78
+on the Program.
79
+
80
+  To "propagate" a work means to do anything with it that, without
81
+permission, would make you directly or secondarily liable for
82
+infringement under applicable copyright law, except executing it on a
83
+computer or modifying a private copy.  Propagation includes copying,
84
+distribution (with or without modification), making available to the
85
+public, and in some countries other activities as well.
86
+
87
+  To "convey" a work means any kind of propagation that enables other
88
+parties to make or receive copies.  Mere interaction with a user through
89
+a computer network, with no transfer of a copy, is not conveying.
90
+
91
+  An interactive user interface displays "Appropriate Legal Notices"
92
+to the extent that it includes a convenient and prominently visible
93
+feature that (1) displays an appropriate copyright notice, and (2)
94
+tells the user that there is no warranty for the work (except to the
95
+extent that warranties are provided), that licensees may convey the
96
+work under this License, and how to view a copy of this License.  If
97
+the interface presents a list of user commands or options, such as a
98
+menu, a prominent item in the list meets this criterion.
99
+
100
+  1. Source Code.
101
+
102
+  The "source code" for a work means the preferred form of the work
103
+for making modifications to it.  "Object code" means any non-source
104
+form of a work.
105
+
106
+  A "Standard Interface" means an interface that either is an official
107
+standard defined by a recognized standards body, or, in the case of
108
+interfaces specified for a particular programming language, one that
109
+is widely used among developers working in that language.
110
+
111
+  The "System Libraries" of an executable work include anything, other
112
+than the work as a whole, that (a) is included in the normal form of
113
+packaging a Major Component, but which is not part of that Major
114
+Component, and (b) serves only to enable use of the work with that
115
+Major Component, or to implement a Standard Interface for which an
116
+implementation is available to the public in source code form.  A
117
+"Major Component", in this context, means a major essential component
118
+(kernel, window system, and so on) of the specific operating system
119
+(if any) on which the executable work runs, or a compiler used to
120
+produce the work, or an object code interpreter used to run it.
121
+
122
+  The "Corresponding Source" for a work in object code form means all
123
+the source code needed to generate, install, and (for an executable
124
+work) run the object code and to modify the work, including scripts to
125
+control those activities.  However, it does not include the work's
126
+System Libraries, or general-purpose tools or generally available free
127
+programs which are used unmodified in performing those activities but
128
+which are not part of the work.  For example, Corresponding Source
129
+includes interface definition files associated with source files for
130
+the work, and the source code for shared libraries and dynamically
131
+linked subprograms that the work is specifically designed to require,
132
+such as by intimate data communication or control flow between those
133
+subprograms and other parts of the work.
134
+
135
+  The Corresponding Source need not include anything that users
136
+can regenerate automatically from other parts of the Corresponding
137
+Source.
138
+
139
+  The Corresponding Source for a work in source code form is that
140
+same work.
141
+
142
+  2. Basic Permissions.
143
+
144
+  All rights granted under this License are granted for the term of
145
+copyright on the Program, and are irrevocable provided the stated
146
+conditions are met.  This License explicitly affirms your unlimited
147
+permission to run the unmodified Program.  The output from running a
148
+covered work is covered by this License only if the output, given its
149
+content, constitutes a covered work.  This License acknowledges your
150
+rights of fair use or other equivalent, as provided by copyright law.
151
+
152
+  You may make, run and propagate covered works that you do not
153
+convey, without conditions so long as your license otherwise remains
154
+in force.  You may convey covered works to others for the sole purpose
155
+of having them make modifications exclusively for you, or provide you
156
+with facilities for running those works, provided that you comply with
157
+the terms of this License in conveying all material for which you do
158
+not control copyright.  Those thus making or running the covered works
159
+for you must do so exclusively on your behalf, under your direction
160
+and control, on terms that prohibit them from making any copies of
161
+your copyrighted material outside their relationship with you.
162
+
163
+  Conveying under any other circumstances is permitted solely under
164
+the conditions stated below.  Sublicensing is not allowed; section 10
165
+makes it unnecessary.
166
+
167
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
168
+
169
+  No covered work shall be deemed part of an effective technological
170
+measure under any applicable law fulfilling obligations under article
171
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
172
+similar laws prohibiting or restricting circumvention of such
173
+measures.
174
+
175
+  When you convey a covered work, you waive any legal power to forbid
176
+circumvention of technological measures to the extent such circumvention
177
+is effected by exercising rights under this License with respect to
178
+the covered work, and you disclaim any intention to limit operation or
179
+modification of the work as a means of enforcing, against the work's
180
+users, your or third parties' legal rights to forbid circumvention of
181
+technological measures.
182
+
183
+  4. Conveying Verbatim Copies.
184
+
185
+  You may convey verbatim copies of the Program's source code as you
186
+receive it, in any medium, provided that you conspicuously and
187
+appropriately publish on each copy an appropriate copyright notice;
188
+keep intact all notices stating that this License and any
189
+non-permissive terms added in accord with section 7 apply to the code;
190
+keep intact all notices of the absence of any warranty; and give all
191
+recipients a copy of this License along with the Program.
192
+
193
+  You may charge any price or no price for each copy that you convey,
194
+and you may offer support or warranty protection for a fee.
195
+
196
+  5. Conveying Modified Source Versions.
197
+
198
+  You may convey a work based on the Program, or the modifications to
199
+produce it from the Program, in the form of source code under the
200
+terms of section 4, provided that you also meet all of these conditions:
201
+
202
+    a) The work must carry prominent notices stating that you modified
203
+    it, and giving a relevant date.
204
+
205
+    b) The work must carry prominent notices stating that it is
206
+    released under this License and any conditions added under section
207
+    7.  This requirement modifies the requirement in section 4 to
208
+    "keep intact all notices".
209
+
210
+    c) You must license the entire work, as a whole, under this
211
+    License to anyone who comes into possession of a copy.  This
212
+    License will therefore apply, along with any applicable section 7
213
+    additional terms, to the whole of the work, and all its parts,
214
+    regardless of how they are packaged.  This License gives no
215
+    permission to license the work in any other way, but it does not
216
+    invalidate such permission if you have separately received it.
217
+
218
+    d) If the work has interactive user interfaces, each must display
219
+    Appropriate Legal Notices; however, if the Program has interactive
220
+    interfaces that do not display Appropriate Legal Notices, your
221
+    work need not make them do so.
222
+
223
+  A compilation of a covered work with other separate and independent
224
+works, which are not by their nature extensions of the covered work,
225
+and which are not combined with it such as to form a larger program,
226
+in or on a volume of a storage or distribution medium, is called an
227
+"aggregate" if the compilation and its resulting copyright are not
228
+used to limit the access or legal rights of the compilation's users
229
+beyond what the individual works permit.  Inclusion of a covered work
230
+in an aggregate does not cause this License to apply to the other
231
+parts of the aggregate.
232
+
233
+  6. Conveying Non-Source Forms.
234
+
235
+  You may convey a covered work in object code form under the terms
236
+of sections 4 and 5, provided that you also convey the
237
+machine-readable Corresponding Source under the terms of this License,
238
+in one of these ways:
239
+
240
+    a) Convey the object code in, or embodied in, a physical product
241
+    (including a physical distribution medium), accompanied by the
242
+    Corresponding Source fixed on a durable physical medium
243
+    customarily used for software interchange.
244
+
245
+    b) Convey the object code in, or embodied in, a physical product
246
+    (including a physical distribution medium), accompanied by a
247
+    written offer, valid for at least three years and valid for as
248
+    long as you offer spare parts or customer support for that product
249
+    model, to give anyone who possesses the object code either (1) a
250
+    copy of the Corresponding Source for all the software in the
251
+    product that is covered by this License, on a durable physical
252
+    medium customarily used for software interchange, for a price no
253
+    more than your reasonable cost of physically performing this
254
+    conveying of source, or (2) access to copy the
255
+    Corresponding Source from a network server at no charge.
256
+
257
+    c) Convey individual copies of the object code with a copy of the
258
+    written offer to provide the Corresponding Source.  This
259
+    alternative is allowed only occasionally and noncommercially, and
260
+    only if you received the object code with such an offer, in accord
261
+    with subsection 6b.
262
+
263
+    d) Convey the object code by offering access from a designated
264
+    place (gratis or for a charge), and offer equivalent access to the
265
+    Corresponding Source in the same way through the same place at no
266
+    further charge.  You need not require recipients to copy the
267
+    Corresponding Source along with the object code.  If the place to
268
+    copy the object code is a network server, the Corresponding Source
269
+    may be on a different server (operated by you or a third party)
270
+    that supports equivalent copying facilities, provided you maintain
271
+    clear directions next to the object code saying where to find the
272
+    Corresponding Source.  Regardless of what server hosts the
273
+    Corresponding Source, you remain obligated to ensure that it is
274
+    available for as long as needed to satisfy these requirements.
275
+
276
+    e) Convey the object code using peer-to-peer transmission, provided
277
+    you inform other peers where the object code and Corresponding
278
+    Source of the work are being offered to the general public at no
279
+    charge under subsection 6d.
280
+
281
+  A separable portion of the object code, whose source code is excluded
282
+from the Corresponding Source as a System Library, need not be
283
+included in conveying the object code work.
284
+
285
+  A "User Product" is either (1) a "consumer product", which means any
286
+tangible personal property which is normally used for personal, family,
287
+or household purposes, or (2) anything designed or sold for incorporation
288
+into a dwelling.  In determining whether a product is a consumer product,
289
+doubtful cases shall be resolved in favor of coverage.  For a particular
290
+product received by a particular user, "normally used" refers to a
291
+typical or common use of that class of product, regardless of the status
292
+of the particular user or of the way in which the particular user
293
+actually uses, or expects or is expected to use, the product.  A product
294
+is a consumer product regardless of whether the product has substantial
295
+commercial, industrial or non-consumer uses, unless such uses represent
296
+the only significant mode of use of the product.
297
+
298
+  "Installation Information" for a User Product means any methods,
299
+procedures, authorization keys, or other information required to install
300
+and execute modified versions of a covered work in that User Product from
301
+a modified version of its Corresponding Source.  The information must
302
+suffice to ensure that the continued functioning of the modified object
303
+code is in no case prevented or interfered with solely because
304
+modification has been made.
305
+
306
+  If you convey an object code work under this section in, or with, or
307
+specifically for use in, a User Product, and the conveying occurs as
308
+part of a transaction in which the right of possession and use of the
309
+User Product is transferred to the recipient in perpetuity or for a
310
+fixed term (regardless of how the transaction is characterized), the
311
+Corresponding Source conveyed under this section must be accompanied
312
+by the Installation Information.  But this requirement does not apply
313
+if neither you nor any third party retains the ability to install
314
+modified object code on the User Product (for example, the work has
315
+been installed in ROM).
316
+
317
+  The requirement to provide Installation Information does not include a
318
+requirement to continue to provide support service, warranty, or updates
319
+for a work that has been modified or installed by the recipient, or for
320
+the User Product in which it has been modified or installed.  Access to a
321
+network may be denied when the modification itself materially and
322
+adversely affects the operation of the network or violates the rules and
323
+protocols for communication across the network.
324
+
325
+  Corresponding Source conveyed, and Installation Information provided,
326
+in accord with this section must be in a format that is publicly
327
+documented (and with an implementation available to the public in
328
+source code form), and must require no special password or key for
329
+unpacking, reading or copying.
330
+
331
+  7. Additional Terms.
332
+
333
+  "Additional permissions" are terms that supplement the terms of this
334
+License by making exceptions from one or more of its conditions.
335
+Additional permissions that are applicable to the entire Program shall
336
+be treated as though they were included in this License, to the extent
337
+that they are valid under applicable law.  If additional permissions
338
+apply only to part of the Program, that part may be used separately
339
+under those permissions, but the entire Program remains governed by
340
+this License without regard to the additional permissions.
341
+
342
+  When you convey a copy of a covered work, you may at your option
343
+remove any additional permissions from that copy, or from any part of
344
+it.  (Additional permissions may be written to require their own
345
+removal in certain cases when you modify the work.)  You may place
346
+additional permissions on material, added by you to a covered work,
347
+for which you have or can give appropriate copyright permission.
348
+
349
+  Notwithstanding any other provision of this License, for material you
350
+add to a covered work, you may (if authorized by the copyright holders of
351
+that material) supplement the terms of this License with terms:
352
+
353
+    a) Disclaiming warranty or limiting liability differently from the
354
+    terms of sections 15 and 16 of this License; or
355
+
356
+    b) Requiring preservation of specified reasonable legal notices or
357
+    author attributions in that material or in the Appropriate Legal
358
+    Notices displayed by works containing it; or
359
+
360
+    c) Prohibiting misrepresentation of the origin of that material, or
361
+    requiring that modified versions of such material be marked in
362
+    reasonable ways as different from the original version; or
363
+
364
+    d) Limiting the use for publicity purposes of names of licensors or
365
+    authors of the material; or
366
+
367
+    e) Declining to grant rights under trademark law for use of some
368
+    trade names, trademarks, or service marks; or
369
+
370
+    f) Requiring indemnification of licensors and authors of that
371
+    material by anyone who conveys the material (or modified versions of
372
+    it) with contractual assumptions of liability to the recipient, for
373
+    any liability that these contractual assumptions directly impose on
374
+    those licensors and authors.
375
+
376
+  All other non-permissive additional terms are considered "further
377
+restrictions" within the meaning of section 10.  If the Program as you
378
+received it, or any part of it, contains a notice stating that it is
379
+governed by this License along with a term that is a further
380
+restriction, you may remove that term.  If a license document contains
381
+a further restriction but permits relicensing or conveying under this
382
+License, you may add to a covered work material governed by the terms
383
+of that license document, provided that the further restriction does
384
+not survive such relicensing or conveying.
385
+
386
+  If you add terms to a covered work in accord with this section, you
387
+must place, in the relevant source files, a statement of the
388
+additional terms that apply to those files, or a notice indicating
389
+where to find the applicable terms.
390
+
391
+  Additional terms, permissive or non-permissive, may be stated in the
392
+form of a separately written license, or stated as exceptions;
393
+the above requirements apply either way.
394
+
395
+  8. Termination.
396
+
397
+  You may not propagate or modify a covered work except as expressly
398
+provided under this License.  Any attempt otherwise to propagate or
399
+modify it is void, and will automatically terminate your rights under
400
+this License (including any patent licenses granted under the third
401
+paragraph of section 11).
402
+
403
+  However, if you cease all violation of this License, then your
404
+license from a particular copyright holder is reinstated (a)
405
+provisionally, unless and until the copyright holder explicitly and
406
+finally terminates your license, and (b) permanently, if the copyright
407
+holder fails to notify you of the violation by some reasonable means
408
+prior to 60 days after the cessation.
409
+
410
+  Moreover, your license from a particular copyright holder is
411
+reinstated permanently if the copyright holder notifies you of the
412
+violation by some reasonable means, this is the first time you have
413
+received notice of violation of this License (for any work) from that
414
+copyright holder, and you cure the violation prior to 30 days after
415
+your receipt of the notice.
416
+
417
+  Termination of your rights under this section does not terminate the
418
+licenses of parties who have received copies or rights from you under
419
+this License.  If your rights have been terminated and not permanently
420
+reinstated, you do not qualify to receive new licenses for the same
421
+material under section 10.
422
+
423
+  9. Acceptance Not Required for Having Copies.
424
+
425
+  You are not required to accept this License in order to receive or
426
+run a copy of the Program.  Ancillary propagation of a covered work
427
+occurring solely as a consequence of using peer-to-peer transmission
428
+to receive a copy likewise does not require acceptance.  However,
429
+nothing other than this License grants you permission to propagate or
430
+modify any covered work.  These actions infringe copyright if you do
431
+not accept this License.  Therefore, by modifying or propagating a
432
+covered work, you indicate your acceptance of this License to do so.
433
+
434
+  10. Automatic Licensing of Downstream Recipients.
435
+
436
+  Each time you convey a covered work, the recipient automatically
437
+receives a license from the original licensors, to run, modify and
438
+propagate that work, subject to this License.  You are not responsible
439
+for enforcing compliance by third parties with this License.
440
+
441
+  An "entity transaction" is a transaction transferring control of an
442
+organization, or substantially all assets of one, or subdividing an
443
+organization, or merging organizations.  If propagation of a covered
444
+work results from an entity transaction, each party to that
445
+transaction who receives a copy of the work also receives whatever
446
+licenses to the work the party's predecessor in interest had or could
447
+give under the previous paragraph, plus a right to possession of the
448
+Corresponding Source of the work from the predecessor in interest, if
449
+the predecessor has it or can get it with reasonable efforts.
450
+
451
+  You may not impose any further restrictions on the exercise of the
452
+rights granted or affirmed under this License.  For example, you may
453
+not impose a license fee, royalty, or other charge for exercise of
454
+rights granted under this License, and you may not initiate litigation
455
+(including a cross-claim or counterclaim in a lawsuit) alleging that
456
+any patent claim is infringed by making, using, selling, offering for
457
+sale, or importing the Program or any portion of it.
458
+
459
+  11. Patents.
460
+
461
+  A "contributor" is a copyright holder who authorizes use under this
462
+License of the Program or a work on which the Program is based.  The
463
+work thus licensed is called the contributor's "contributor version".
464
+
465
+  A contributor's "essential patent claims" are all patent claims
466
+owned or controlled by the contributor, whether already acquired or
467
+hereafter acquired, that would be infringed by some manner, permitted
468
+by this License, of making, using, or selling its contributor version,
469
+but do not include claims that would be infringed only as a
470
+consequence of further modification of the contributor version.  For
471
+purposes of this definition, "control" includes the right to grant
472
+patent sublicenses in a manner consistent with the requirements of
473
+this License.
474
+
475
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
476
+patent license under the contributor's essential patent claims, to
477
+make, use, sell, offer for sale, import and otherwise run, modify and
478
+propagate the contents of its contributor version.
479
+
480
+  In the following three paragraphs, a "patent license" is any express
481
+agreement or commitment, however denominated, not to enforce a patent
482
+(such as an express permission to practice a patent or covenant not to
483
+sue for patent infringement).  To "grant" such a patent license to a
484
+party means to make such an agreement or commitment not to enforce a
485
+patent against the party.
486
+
487
+  If you convey a covered work, knowingly relying on a patent license,
488
+and the Corresponding Source of the work is not available for anyone
489
+to copy, free of charge and under the terms of this License, through a
490
+publicly available network server or other readily accessible means,
491
+then you must either (1) cause the Corresponding Source to be so
492
+available, or (2) arrange to deprive yourself of the benefit of the
493
+patent license for this particular work, or (3) arrange, in a manner
494
+consistent with the requirements of this License, to extend the patent
495
+license to downstream recipients.  "Knowingly relying" means you have
496
+actual knowledge that, but for the patent license, your conveying the
497
+covered work in a country, or your recipient's use of the covered work
498
+in a country, would infringe one or more identifiable patents in that
499
+country that you have reason to believe are valid.
500
+
501
+  If, pursuant to or in connection with a single transaction or
502
+arrangement, you convey, or propagate by procuring conveyance of, a
503
+covered work, and grant a patent license to some of the parties
504
+receiving the covered work authorizing them to use, propagate, modify
505
+or convey a specific copy of the covered work, then the patent license
506
+you grant is automatically extended to all recipients of the covered
507
+work and works based on it.
508
+
509
+  A patent license is "discriminatory" if it does not include within
510
+the scope of its coverage, prohibits the exercise of, or is
511
+conditioned on the non-exercise of one or more of the rights that are
512
+specifically granted under this License.  You may not convey a covered
513
+work if you are a party to an arrangement with a third party that is
514
+in the business of distributing software, under which you make payment
515
+to the third party based on the extent of your activity of conveying
516
+the work, and under which the third party grants, to any of the
517
+parties who would receive the covered work from you, a discriminatory
518
+patent license (a) in connection with copies of the covered work
519
+conveyed by you (or copies made from those copies), or (b) primarily
520
+for and in connection with specific products or compilations that
521
+contain the covered work, unless you entered into that arrangement,
522
+or that patent license was granted, prior to 28 March 2007.
523
+
524
+  Nothing in this License shall be construed as excluding or limiting
525
+any implied license or other defenses to infringement that may
526
+otherwise be available to you under applicable patent law.
527
+
528
+  12. No Surrender of Others' Freedom.
529
+
530
+  If conditions are imposed on you (whether by court order, agreement or
531
+otherwise) that contradict the conditions of this License, they do not
532
+excuse you from the conditions of this License.  If you cannot convey a
533
+covered work so as to satisfy simultaneously your obligations under this
534
+License and any other pertinent obligations, then as a consequence you may
535
+not convey it at all.  For example, if you agree to terms that obligate you
536
+to collect a royalty for further conveying from those to whom you convey
537
+the Program, the only way you could satisfy both those terms and this
538
+License would be to refrain entirely from conveying the Program.
539
+
540
+  13. Remote Network Interaction; Use with the GNU General Public License.
541
+
542
+  Notwithstanding any other provision of this License, if you modify the
543
+Program, your modified version must prominently offer all users
544
+interacting with it remotely through a computer network (if your version
545
+supports such interaction) an opportunity to receive the Corresponding
546
+Source of your version by providing access to the Corresponding Source
547
+from a network server at no charge, through some standard or customary
548
+means of facilitating copying of software.  This Corresponding Source
549
+shall include the Corresponding Source for any work covered by version 3
550
+of the GNU General Public License that is incorporated pursuant to the
551
+following paragraph.
552
+
553
+  Notwithstanding any other provision of this License, you have
554
+permission to link or combine any covered work with a work licensed
555
+under version 3 of the GNU General Public License into a single
556
+combined work, and to convey the resulting work.  The terms of this
557
+License will continue to apply to the part which is the covered work,
558
+but the work with which it is combined will remain governed by version
559
+3 of the GNU General Public License.
560
+
561
+  14. Revised Versions of this License.
562
+
563
+  The Free Software Foundation may publish revised and/or new versions of
564
+the GNU Affero General Public License from time to time.  Such new versions
565
+will be similar in spirit to the present version, but may differ in detail to
566
+address new problems or concerns.
567
+
568
+  Each version is given a distinguishing version number.  If the
569
+Program specifies that a certain numbered version of the GNU Affero General
570
+Public License "or any later version" applies to it, you have the
571
+option of following the terms and conditions either of that numbered
572
+version or of any later version published by the Free Software
573
+Foundation.  If the Program does not specify a version number of the
574
+GNU Affero General Public License, you may choose any version ever published
575
+by the Free Software Foundation.
576
+
577
+  If the Program specifies that a proxy can decide which future
578
+versions of the GNU Affero General Public License can be used, that proxy's
579
+public statement of acceptance of a version permanently authorizes you
580
+to choose that version for the Program.
581
+
582
+  Later license versions may give you additional or different
583
+permissions.  However, no additional obligations are imposed on any
584
+author or copyright holder as a result of your choosing to follow a
585
+later version.
586
+
587
+  15. Disclaimer of Warranty.
588
+
589
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
590
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
591
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
592
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
593
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
594
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
595
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
596
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
597
+
598
+  16. Limitation of Liability.
599
+
600
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
601
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
602
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
603
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
604
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
605
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
606
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
607
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
608
+SUCH DAMAGES.
609
+
610
+  17. Interpretation of Sections 15 and 16.
611
+
612
+  If the disclaimer of warranty and limitation of liability provided
613
+above cannot be given local legal effect according to their terms,
614
+reviewing courts shall apply local law that most closely approximates
615
+an absolute waiver of all civil liability in connection with the
616
+Program, unless a warranty or assumption of liability accompanies a
617
+copy of the Program in return for a fee.
618
+
619
+                     END OF TERMS AND CONDITIONS
620
+
621
+            How to Apply These Terms to Your New Programs
622
+
623
+  If you develop a new program, and you want it to be of the greatest
624
+possible use to the public, the best way to achieve this is to make it
625
+free software which everyone can redistribute and change under these terms.
626
+
627
+  To do so, attach the following notices to the program.  It is safest
628
+to attach them to the start of each source file to most effectively
629
+state the exclusion of warranty; and each file should have at least
630
+the "copyright" line and a pointer to where the full notice is found.
631
+
632
+    <one line to give the program's name and a brief idea of what it does.>
633
+    Copyright (C) <year>  <name of author>
634
+
635
+    This program is free software: you can redistribute it and/or modify
636
+    it under the terms of the GNU Affero General Public License as published by
637
+    the Free Software Foundation, either version 3 of the License, or
638
+    (at your option) any later version.
639
+
640
+    This program is distributed in the hope that it will be useful,
641
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
642
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
643
+    GNU Affero General Public License for more details.
644
+
645
+    You should have received a copy of the GNU Affero General Public License
646
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
647
+
648
+Also add information on how to contact you by electronic and paper mail.
649
+
650
+  If your software can interact with users remotely through a computer
651
+network, you should also make sure that it provides a way for users to
652
+get its source.  For example, if your program is a web application, its
653
+interface could display a "Source" link that leads users to an archive
654
+of the code.  There are many ways you could offer source, and different
655
+solutions will be better for different programs; see section 13 for the
656
+specific requirements.
657
+
658
+  You should also get your employer (if you work as a programmer) or school,
659
+if any, to sign a "copyright disclaimer" for the program, if necessary.
660
+For more information on this, and how to apply and follow the GNU AGPL, see
661
+<http://www.gnu.org/licenses/>.

+ 26
- 0
README.md View File

@@ -0,0 +1,26 @@
1
+# Sitio web personal de Jesús E.
2
+
3
+## Instalación
4
+
5
+### Hyperbola GNU/Linux-libre
6
+
7
+```
8
+$ mkdir templates_c
9
+```
10
+
11
+```
12
+# chown $USER:http templates_c/
13
+```
14
+
15
+```
16
+# chmod g+w -R templates_c/
17
+```
18
+
19
+#### Descargar librerías adicionales (jQuery, normalize)
20
+
21
+```
22
+$ npm install
23
+```
24
+
25
+## Licencia
26
+Esta obra esta bajo la Licencia [GNU AGPLv3+](LICENSE)

+ 53
- 0
index.php View File

@@ -0,0 +1,53 @@
1
+<?php
2
+require_once('smarty/libs/Smarty.class.php');
3
+$titulo="Sitio personal de Jesús";
4
+$nombre="Jesús";
5
+$profesion="Desarrollador";
6
+$descripcion="Este es el sitio web personal de Jesús, un desarrollador, colaborador y hacker de proyectos con software Libre en reemplazo a las tecnologías privativas.";
7
+$enviado = "";
8
+
9
+/* ---- ---- Correo ---- ---- */
10
+require_once('mail/mail.php');
11
+
12
+/* ---- ---- Menu ---- ---- */
13
+$html=new Smarty;
14
+$html->assign("titulo", $titulo);
15
+$html->assign("nombre", $nombre);
16
+
17
+/* ---- ---- Fecha ---- ---- */
18
+$html->assign('yesterday', strtotime("now"));
19
+
20
+/* ---- ---- Description and Author ---- ---- */
21
+$html->assign("description", $descripcion);
22
+
23
+/* ---- ---- EMAIL ---- ----  */
24
+$html->assign("enviado", $enviado);
25
+
26
+/* ---- ---- CSS ---- ----  */
27
+$html->assign('templates', array('estilos' => 'templates/css/estilos.min.css',
28
+                                 'normalize' => 'node_modules/normalize.css/normalize.css',
29
+                                 'favicon' => 'templates/images/favicon.png')
30
+);
31
+
32
+/* ---- ---- LibreJS ---- ---- */
33
+$html->assign('librejs', array('librejs' => 'templates/librejs.html',
34
+                               'jquery' => 'node_modules/jquery/dist/jquery.min.js',
35
+                               'formulario' => 'templates/js/formulario.min.js',
36
+                               'efectos' => 'templates/js/efectos.min.js')
37
+);
38
+
39
+/* ---- ---- Projects and redes Sociales Libres ---- ---- */
40
+$html->assign('projects',
41
+              array('cl' => 'https://conocimientoslibres.tuxfamily.org',
42
+                    'hyperbola' => 'https://www.hyperbola.info',
43
+                    'librevideojs' => 'https://notabug.org/heckyel/librevideojs')
44
+);
45
+
46
+$html->assign('sociales',
47
+              array('diaspora' => 'https://diasp.org/u/heckyel',
48
+                    'gnusocial' => 'https://quitter.cl/heckyel',
49
+                    'libregit' => 'https://libregit.org/heckyel',
50
+                    'mediagoblin' => 'https://goblinrefuge.com/mediagoblin/u/cybersy/')
51
+);
52
+
53
+$html->display('index.tpl');

+ 32
- 0
mail/mail.php View File

@@ -0,0 +1,32 @@
1
+<?php
2
+
3
+// Check for empty fields
4
+if(empty($_POST['nombre'])  ||
5
+   empty($_POST['correo'])  ||
6
+   empty($_POST['mensaje']) ||
7
+   !filter_var($_POST['correo'],FILTER_VALIDATE_EMAIL))
8
+{
9
+    return false;
10
+}
11
+
12
+$name = strip_tags(utf8_decode(htmlspecialchars($_POST['nombre'])));
13
+$email_address = strip_tags(htmlspecialchars($_POST['correo']));
14
+$message = strip_tags(utf8_decode(htmlspecialchars($_POST['mensaje'])));
15
+
16
+// Create the email and send the message
17
+$to = 'user@domain.at'; // Add your email address
18
+$email_subject = <<<EOT
19
+[heckyel.ga] Mensaje de {$name}
20
+EOT;
21
+$email_body = <<<EOT
22
+Haz recibido un nuevo mensaje del formulario de contacto de tu sitio web.\n\n
23
+Aqui estan los detalles:\n\n
24
+Nombre: {$name}\n\n
25
+Email: {$email_address}\n\n
26
+Mensaje:\n
27
+{$message}
28
+EOT;
29
+$headers = "From: noreply@heckyel.ga\n"; // Using something like noreply@yourdomain.com.
30
+$headers .= "Reply-To: $email_address";
31
+mail($to,$email_subject,$email_body,$headers);
32
+return true;

+ 18
- 0
package.json View File

@@ -0,0 +1,18 @@
1
+{
2
+  "name": "personal-site",
3
+  "version": "1.0.0",
4
+  "description": "web site",
5
+  "scripts": {
6
+    "test": "echo \"Error: no test specified\" && exit 1"
7
+  },
8
+  "repository": {
9
+    "type": "git",
10
+    "url": "https://notabug.org/heckyel/personal-site.git"
11
+  },
12
+  "author": "Jesús E.",
13
+  "license": "AGPL-3.0",
14
+  "dependencies": {
15
+    "jquery": "^3.3.1",
16
+    "normalize.css": "^8.0.1"
17
+  }
18
+}

+ 91
- 0
robots.txt View File

@@ -0,0 +1,91 @@
1
+User-Agent: Googlebot
2
+Disallow: /login
3
+Disallow: /admin
4
+Disallow: /download
5
+
6
+User-Agent: *
7
+Disallow: /login
8
+Disallow: /admin
9
+
10
+User-agent: Orthogaffe
11
+Disallow: /
12
+
13
+User-agent: UbiCrawler
14
+Disallow: /
15
+
16
+User-agent: DOC
17
+Disallow: /
18
+
19
+User-agent: Zao
20
+Disallow: /
21
+
22
+User-agent: Zealbot
23
+Disallow: /
24
+
25
+User-agent: MSIECrawler
26
+Disallow: /
27
+
28
+User-agent: SiteSnagger
29
+Disallow: /
30
+
31
+User-agent: WebStripper
32
+Disallow: /
33
+
34
+User-agent: WebCopier
35
+Disallow: /
36
+
37
+User-agent: Fetch
38
+Disallow: /
39
+
40
+User-agent: Offline Explorer
41
+Disallow: /
42
+
43
+User-agent: Teleport
44
+Disallow: /
45
+
46
+User-agent: TeleportPro
47
+Disallow: /
48
+
49
+User-agent: WebZIP
50
+Disallow: /
51
+
52
+User-agent: linko
53
+Disallow: /
54
+
55
+User-agent: HTTrack
56
+Disallow: /
57
+
58
+User-agent: Microsoft.URL.Control
59
+Disallow: /
60
+
61
+User-agent: Xenu
62
+Disallow: /
63
+
64
+User-agent: larbin
65
+Disallow: /
66
+
67
+User-agent: libwww
68
+Disallow: /
69
+
70
+User-agent: ZyBORG
71
+Disallow: /
72
+
73
+User-agent: Download Ninja
74
+Disallow: /
75
+
76
+User-agent: wget
77
+Disallow: /
78
+
79
+User-agent: grub-client
80
+Disallow: /
81
+
82
+User-agent: k2spider
83
+Disallow: /
84
+
85
+User-agent: NPBot
86
+Disallow: /
87
+
88
+User-agent: WebReaper
89
+Disallow: /
90
+
91
+Sitemap: https://heckyel.ga/sitemap.xml

+ 22
- 0
smarty/.gitattributes View File

@@ -0,0 +1,22 @@
1
+# Auto detect text files and perform LF normalization
2
+* text=auto
3
+
4
+# Custom for Visual Studio
5
+*.cs     diff=csharp
6
+*.sln    merge=union
7
+*.csproj merge=union
8
+*.vbproj merge=union
9
+*.fsproj merge=union
10
+*.dbproj merge=union
11
+
12
+# Standard to msysgit
13
+*.doc	 diff=astextplain
14
+*.DOC	 diff=astextplain
15
+*.docx diff=astextplain
16
+*.DOCX diff=astextplain
17
+*.dot  diff=astextplain
18
+*.DOT  diff=astextplain
19
+*.pdf  diff=astextplain
20
+*.PDF	 diff=astextplain
21
+*.rtf	 diff=astextplain
22
+*.RTF	 diff=astextplain

+ 221
- 0
smarty/.gitignore View File

@@ -0,0 +1,221 @@
1
+#################
2
+## Eclipse
3
+#################
4
+
5
+*.pydevproject
6
+.project
7
+.metadata
8
+bin/
9
+tmp/
10
+*.tmp
11
+*.bak
12
+*.swp
13
+*~.nib
14
+local.properties
15
+.classpath
16
+.settings/
17
+.loadpath
18
+
19
+# External tool builders
20
+.externalToolBuilders/
21
+
22
+# Locally stored "Eclipse launch configurations"
23
+*.launch
24
+
25
+# CDT-specific
26
+.cproject
27
+
28
+# PDT-specific
29
+.buildpath
30
+
31
+
32
+#################
33
+## Visual Studio
34
+#################
35
+
36
+## Ignore Visual Studio temporary files, build results, and
37
+## files generated by popular Visual Studio add-ons.
38
+
39
+# User-specific files
40
+*.suo
41
+*.user
42
+*.sln.docstates
43
+
44
+# Build results
45
+
46
+[Dd]ebug/
47
+[Rr]elease/
48
+x64/
49
+build/
50
+[Bb]in/
51
+[Oo]bj/
52
+
53
+# MSTest test Results
54
+[Tt]est[Rr]esult*/
55
+[Bb]uild[Ll]og.*
56
+
57
+*_i.c
58
+*_p.c
59
+*.ilk
60
+*.meta
61
+*.obj
62
+*.pch
63
+*.pdb
64
+*.pgc
65
+*.pgd
66
+*.rsp
67
+*.sbr
68
+*.tlb
69
+*.tli
70
+*.tlh
71
+*.tmp
72
+*.tmp_proj
73
+*.log
74
+*.vspscc
75
+*.vssscc
76
+.builds
77
+*.pidb
78
+*.log
79
+*.scc
80
+
81
+# Visual C++ cache files
82
+ipch/
83
+*.aps
84
+*.ncb
85
+*.opensdf
86
+*.sdf
87
+*.cachefile
88
+
89
+# Visual Studio profiler
90
+*.psess
91
+*.vsp
92
+*.vspx
93
+
94
+# Guidance Automation Toolkit
95
+*.gpState
96
+
97
+# ReSharper is a .NET coding add-in
98
+_ReSharper*/
99
+*.[Rr]e[Ss]harper
100
+
101
+# TeamCity is a build add-in
102
+_TeamCity*
103
+
104
+# DotCover is a Code Coverage Tool
105
+*.dotCover
106
+
107
+# NCrunch
108
+*.ncrunch*
109
+.*crunch*.local.xml
110
+
111
+# Installshield output folder
112
+[Ee]xpress/
113
+
114
+# DocProject is a documentation generator add-in
115
+DocProject/buildhelp/
116
+DocProject/Help/*.HxT
117
+DocProject/Help/*.HxC
118
+DocProject/Help/*.hhc
119
+DocProject/Help/*.hhk
120
+DocProject/Help/*.hhp
121
+DocProject/Help/Html2
122
+DocProject/Help/html
123
+
124
+# Click-Once directory
125
+publish/
126
+
127
+# Publish Web Output
128
+*.Publish.xml
129
+*.pubxml
130
+
131
+# NuGet Packages Directory
132
+## TODO: If you have NuGet Package Restore enabled, uncomment the next line
133
+#packages/
134
+
135
+# Windows Azure Build Output
136
+csx
137
+*.build.csdef
138
+
139
+# Windows Store app package directory
140
+AppPackages/
141
+
142
+# Others
143
+sql/
144
+*.Cache
145
+ClientBin/
146
+[Ss]tyle[Cc]op.*
147
+~$*
148
+*~
149
+*.dbmdl
150
+*.[Pp]ublish.xml
151
+*.pfx
152
+*.publishsettings
153
+
154
+# RIA/Silverlight projects
155
+Generated_Code/
156
+
157
+# Backup & report files from converting an old project file to a newer
158
+# Visual Studio version. Backup files are not needed, because we have git ;-)
159
+_UpgradeReport_Files/
160
+Backup*/
161
+UpgradeLog*.XML
162
+UpgradeLog*.htm
163
+
164
+# SQL Server files
165
+App_Data/*.mdf
166
+App_Data/*.ldf
167
+
168
+#############
169
+## Windows detritus
170
+#############
171
+
172
+# Windows image file caches
173
+Thumbs.db
174
+ehthumbs.db
175
+
176
+# Folder config file
177
+Desktop.ini
178
+
179
+# Recycle Bin used on file shares
180
+$RECYCLE.BIN/
181
+
182
+# Mac crap
183
+.DS_Store
184
+
185
+
186
+#############
187
+## Python
188
+#############
189
+
190
+*.py[co]
191
+
192
+# Packages
193
+*.egg
194
+*.egg-info
195
+dist/
196
+build/
197
+eggs/
198
+parts/
199
+var/
200
+sdist/
201
+develop-eggs/
202
+.installed.cfg
203
+
204
+# Installer logs
205
+pip-log.txt
206
+
207
+# Unit test / coverage reports
208
+.coverage
209
+.tox
210
+
211
+#Translations
212
+*.mo
213
+
214
+#Mr Developer
215
+.mr.developer.cfg
216
+
217
+.idea/
218
+
219
+# Smarty
220
+lexer/*.php
221
+lexer/*.out

+ 26
- 0
smarty/.travis.yml View File

@@ -0,0 +1,26 @@
1
+language: php
2
+
3
+php:
4
+  - 5.3
5
+  - 5.4
6
+  - 5.5
7
+  - 5.6
8
+  - 7.0
9
+  - hhvm
10
+
11
+services:
12
+  - memcached
13
+  - mysql
14
+
15
+before_script:
16
+    - if [ ${TRAVIS_PHP_VERSION:0:3} != "5.2" ]; then travis_retry composer --prefer-source --dev install; fi
17
+    - if [ ${TRAVIS_PHP_VERSION:0:3} <= "5.6" ]; then  phpenv config-add travis.ini; fi
18
+    - mysql -e "create database IF NOT EXISTS test;" -uroot
19
+
20
+install:
21
+   - git clone --depth=50 --branch v3.1.30 git://github.com/smarty-php/smarty-phpunit.git
22
+
23
+script:
24
+   - cd smarty-phpunit
25
+   - phpunit ./
26
+

+ 29
- 0
smarty/COMPOSER_RELEASE_NOTES.txt View File

@@ -0,0 +1,29 @@
1
+
2
+
3
+Starting with Smarty 3.1.21 Composer has been configured to load the packages from github.
4
+
5
+*******************************************************************************
6
+*                                                                             *
7
+*  NOTE: Because of this change you must clear your local composer cache with *
8
+*                 the "composer clearcache" command                           *
9
+*                                                                             *
10
+*******************************************************************************
11
+
12
+To get the latest stable version use
13
+    "require": {
14
+        "smarty/smarty": "~3.1"
15
+    }
16
+in your composer.json file.
17
+
18
+To get the trunk version use
19
+    "require": {
20
+        "smarty/smarty": "~3.1@dev"
21
+    }
22
+
23
+The "smarty/smarty" package will start at libs/....   subfolder.
24
+
25
+To retrieve the development and documentation folders add
26
+    "require-dev": {
27
+        "smarty/smarty-dev": "~3.1@dev"
28
+    }
29
+

+ 165
- 0
smarty/COPYING.lib View File

@@ -0,0 +1,165 @@
1
+                   GNU LESSER GENERAL PUBLIC LICENSE
2
+                       Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+  This version of the GNU Lesser General Public License incorporates
10
+the terms and conditions of version 3 of the GNU General Public
11
+License, supplemented by the additional permissions listed below.
12
+
13
+  0. Additional Definitions.
14
+
15
+  As used herein, "this License" refers to version 3 of the GNU Lesser
16
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+General Public License.
18
+
19
+  "The Library" refers to a covered work governed by this License,
20
+other than an Application or a Combined Work as defined below.
21
+
22
+  An "Application" is any work that makes use of an interface provided
23
+by the Library, but which is not otherwise based on the Library.
24
+Defining a subclass of a class defined by the Library is deemed a mode
25
+of using an interface provided by the Library.
26
+
27
+  A "Combined Work" is a work produced by combining or linking an
28
+Application with the Library.  The particular version of the Library
29
+with which the Combined Work was made is also called the "Linked
30
+Version".
31
+
32
+  The "Minimal Corresponding Source" for a Combined Work means the
33
+Corresponding Source for the Combined Work, excluding any source code
34
+for portions of the Combined Work that, considered in isolation, are
35
+based on the Application, and not on the Linked Version.
36
+
37
+  The "Corresponding Application Code" for a Combined Work means the
38
+object code and/or source code for the Application, including any data
39
+and utility programs needed for reproducing the Combined Work from the
40
+Application, but excluding the System Libraries of the Combined Work.
41
+
42
+  1. Exception to Section 3 of the GNU GPL.
43
+
44
+  You may convey a covered work under sections 3 and 4 of this License
45
+without being bound by section 3 of the GNU GPL.
46
+
47
+  2. Conveying Modified Versions.
48
+
49
+  If you modify a copy of the Library, and, in your modifications, a
50
+facility refers to a function or data to be supplied by an Application
51
+that uses the facility (other than as an argument passed when the
52
+facility is invoked), then you may convey a copy of the modified
53
+version:
54
+
55
+   a) under this License, provided that you make a good faith effort to
56
+   ensure that, in the event an Application does not supply the
57
+   function or data, the facility still operates, and performs
58
+   whatever part of its purpose remains meaningful, or
59
+
60
+   b) under the GNU GPL, with none of the additional permissions of
61
+   this License applicable to that copy.
62
+
63
+  3. Object Code Incorporating Material from Library Header Files.
64
+
65
+  The object code form of an Application may incorporate material from
66
+a header file that is part of the Library.  You may convey such object
67
+code under terms of your choice, provided that, if the incorporated
68
+material is not limited to numerical parameters, data structure
69
+layouts and accessors, or small macros, inline functions and templates
70
+(ten or fewer lines in length), you do both of the following:
71
+
72
+   a) Give prominent notice with each copy of the object code that the
73
+   Library is used in it and that the Library and its use are
74
+   covered by this License.
75
+
76
+   b) Accompany the object code with a copy of the GNU GPL and this license
77
+   document.
78
+
79
+  4. Combined Works.
80
+
81
+  You may convey a Combined Work under terms of your choice that,
82
+taken together, effectively do not restrict modification of the
83
+portions of the Library contained in the Combined Work and reverse
84
+engineering for debugging such modifications, if you also do each of
85
+the following:
86
+
87
+   a) Give prominent notice with each copy of the Combined Work that
88
+   the Library is used in it and that the Library and its use are
89
+   covered by this License.
90
+
91
+   b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+   document.
93
+
94
+   c) For a Combined Work that displays copyright notices during
95
+   execution, include the copyright notice for the Library among
96
+   these notices, as well as a reference directing the user to the
97
+   copies of the GNU GPL and this license document.
98
+
99
+   d) Do one of the following:
100
+
101
+       0) Convey the Minimal Corresponding Source under the terms of this
102
+       License, and the Corresponding Application Code in a form
103
+       suitable for, and under terms that permit, the user to
104
+       recombine or relink the Application with a modified version of
105
+       the Linked Version to produce a modified Combined Work, in the
106
+       manner specified by section 6 of the GNU GPL for conveying
107
+       Corresponding Source.
108
+
109
+       1) Use a suitable shared library mechanism for linking with the
110
+       Library.  A suitable mechanism is one that (a) uses at run time
111
+       a copy of the Library already present on the user's computer
112
+       system, and (b) will operate properly with a modified version
113
+       of the Library that is interface-compatible with the Linked
114
+       Version.
115
+
116
+   e) Provide Installation Information, but only if you would otherwise
117
+   be required to provide such information under section 6 of the
118
+   GNU GPL, and only to the extent that such information is
119
+   necessary to install and execute a modified version of the
120
+   Combined Work produced by recombining or relinking the
121
+   Application with a modified version of the Linked Version. (If
122
+   you use option 4d0, the Installation Information must accompany
123
+   the Minimal Corresponding Source and Corresponding Application
124
+   Code. If you use option 4d1, you must provide the Installation
125
+   Information in the manner specified by section 6 of the GNU GPL
126
+   for conveying Corresponding Source.)
127
+
128
+  5. Combined Libraries.
129
+
130
+  You may place library facilities that are a work based on the
131
+Library side by side in a single library together with other library
132
+facilities that are not Applications and are not covered by this
133
+License, and convey such a combined library under terms of your
134
+choice, if you do both of the following:
135
+
136
+   a) Accompany the combined library with a copy of the same work based
137
+   on the Library, uncombined with any other library facilities,
138
+   conveyed under the terms of this License.
139
+
140
+   b) Give prominent notice with the combined library that part of it
141
+   is a work based on the Library, and explaining where to find the
142
+   accompanying uncombined form of the same work.
143
+
144
+  6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+  The Free Software Foundation may publish revised and/or new versions
147
+of the GNU Lesser General Public License from time to time. Such new
148
+versions will be similar in spirit to the present version, but may
149
+differ in detail to address new problems or concerns.
150
+
151
+  Each version is given a distinguishing version number. If the
152
+Library as you received it specifies that a certain numbered version
153
+of the GNU Lesser General Public License "or any later version"
154
+applies to it, you have the option of following the terms and
155
+conditions either of that published version or of any later version
156
+published by the Free Software Foundation. If the Library as you
157
+received it does not specify a version number of the GNU Lesser
158
+General Public License, you may choose any version of the GNU Lesser
159
+General Public License ever published by the Free Software Foundation.
160
+
161
+  If the Library as you received it specifies that a proxy can decide
162
+whether future versions of the GNU Lesser General Public License shall
163
+apply, that proxy's public statement of acceptance of any version is
164
+permanent authorization for you to choose that version for the
165
+Library.

+ 76
- 0
smarty/INHERITANCE_RELEASE_NOTES.txt View File

@@ -0,0 +1,76 @@
1
+Starting with version 3.1.28 template inheritance is no longer a compile time process.
2
+All {block} tag parent/child relations are resolved at run time.
3
+This does resolve all known existing restrictions (see below).
4
+
5
+The $smarty::$inheritance_merge_compiled_includes property has been removed.
6
+Any access to it is ignored.
7
+
8
+New features:
9
+
10
+Any code outside root {block} tags in child templates is now executed but any output will be ignored.
11
+
12
+   {extends 'foo.tpl'}
13
+   {$bar = 'on'}           // assigns variable $bar seen in parent templates
14
+   {block 'buh'}{/block}
15
+
16
+   {extends 'foo.tpl'}
17
+   {$bar}           // the output of variable bar is ignored
18
+   {block 'buh'}{/block}
19
+
20
+{block} tags can be dynamically en/disabled by conditions.
21
+
22
+   {block 'root'}
23
+      {if $foo}
24
+         {block 'v1'}
25
+             ....
26
+         {/block}
27
+      {else}
28
+         {block 'v1'}
29
+             ....
30
+         {/block}
31
+      {/if}
32
+   {/block}
33
+
34
+{block} tags can have variable names.
35
+
36
+   {block $foo}
37
+        ....
38
+   {/block}
39
+
40
+Starting with 3.1.28 you can mix inheritance by extends resuorce with the {extends} tag.
41
+A template called by extends resoure can extend a subtemple or chain buy the {extends} tag.
42
+
43
+NOTE There is a BC break. If you used the extends resource {extends} tags have been ignored.
44
+
45
+THE FOLLOWING RESTRICTIONS ARE NO LONGER EXISTING:
46
+In Smarty 3.1 template inheritance is a compile time process. All the extending of {block} tags
47
+is done at compile time and the parent and child templates are compiled in a single compiled template.
48
+{include} subtemplate could also {block} tags. Such subtemplate could not compiled by it's own because
49
+it could be used in other context where the {block} extended with a different result. For that reasion
50
+the compiled code of {include} subtemplates gets also merged in compiled inheritance template.
51
+
52
+Merging the code into a single compile template has some drawbacks.
53
+1. You could not use variable file names in {include} Smarty would use the {include} of compilation time.
54
+2. You could not use individual compile_id in {include}
55
+3. Seperate caching of subtemplate was not possible
56
+4. Any change of the template directory structure between calls was not necessarily seen.
57
+
58
+Starting with 3.1.15 some of the above conditions got checked and resulted in an exception. It turned out
59
+that a couple of users did use some of above and now got exceptions.
60
+
61
+To resolve this starting with 3.1.16 there is a new configuration parameter $inheritance_merge_compiled_includes.
62
+For most backward compatibility its default setting is true.
63
+With this setting all {include} subtemplate will be merge into the compiled inheritance template, but the above cases
64
+could be rejected by exception.
65
+
66
+
67
+If $smarty->inheritance_merge_compiled_includes = false; {include} subtemplate will not be merged. 
68
+You must now manually merge all {include} subtemplate which do contain {block} tags. This is done by setting the "inline" option.
69
+{include file='foo.bar' inline}
70
+
71
+1. In case of a variable file name like {include file=$foo inline} you must use the variable in a compile_id  $smarty->compile_id = $foo;
72
+2. If you use individual compile_id in {include file='foo.tpl' compile_id=$bar inline} it must be used in the 
73
+   global compile_id as well  $smarty->compile_id = $bar;
74
+3. If call templates with different template_dir configurations and a parent could same named child template from different folders
75
+   you must make the folder name part of the compile_id.
76
+

+ 233
- 0
smarty/NEW_FEATURES.txt View File

@@ -0,0 +1,233 @@
1
+
2
+
3
+This file contains a brief description of new features which have been added to Smarty 3.1
4
+
5
+Smarty 3.1.30
6
+
7
+    Loop optimization {foreach} and {section}
8
+    =========================================
9
+    Smarty does optimize the {foreach} and {section} loops by removing code for not needed loop
10
+    properties.
11
+    The compiler collects needed properties by scanning the current template for $item@property,
12
+    $smarty.foreach.name.property and $smarty.section.name.property.
13
+    The compiler does not know if additional properties will be needed outside the current template scope.
14
+    Additional properties can be generated by adding them with the property attribute.
15
+
16
+    Example:
17
+        index.tpl
18
+        {foreach $from as $item properties=[iteration, index]}
19
+            {include 'sub.tpl'}
20
+            {$item.total}
21
+        {/foreach}
22
+
23
+        sub.tpl
24
+        {$item.index} {$item.iteration} {$item.total}
25
+
26
+    In above example code for the 'total' property is automatically generated as $item.total is used in
27
+    index.tpl. Code for 'iteration' and 'index' must be added with properties=[iteration, index].
28
+
29
+    New tag {make_nocache}
30
+    ======================
31
+    Syntax: {make_nocache $foo}
32
+
33
+    This tag makes a variable which does exists normally only while rendering the compiled template
34
+    available in the cached template for use in not cached expressions.
35
+
36
+    Expample:
37
+        {foreach from=$list item=item}
38
+            <li>{$item.name} {make_nocache $item}{if $current==$item.id} ACTIVE{/if}</li>
39
+        {/foreach}
40
+
41
+    The {foreach} loop is rendered while processing the compiled template, but $current is a nocache
42
+    variable. Normally the {if $current==$item.id} would fail as the $item variable is unkown in the 
43
+    cached template. {make_nocache $item} does make the current $item value known in thee cached template.
44
+
45
+    {make_nocache} is ignored when caching is disabled or the variable does exists as nocache variable.
46
+
47
+    NOTE: if the variable value does contain objects these must have the __set_state method implemented.
48
+
49
+
50
+    Scope Attributes
51
+    ================
52
+    The scope handling has been updated to cover all cases of variable assignments in templates.
53
+
54
+    The tags {assign}, {append} direct assignments like {$foo = ...}, {$foo[...]= ...} support
55
+    the following optional scope attributes:
56
+    scope='parent'    - the variable will be assigned in the current template and if the template
57
+                        was included by {include} the calling template
58
+    scope='tpl_root'  - the variable will be assigned in the outermost root template called by $smarty->display()
59
+                        or $smarty->fetch() and is bubbled up all {include} sub-templates to the current template.
60
+    scope='smarty'    - the variable will be assigned in the Smarty object and is bubbled up all {include} sub-templates
61
+                        to the current template.
62
+    scope='global'    - the variable will be assigned as Smarty object global variable and is bubbled up all {include}
63
+                        sub-templates to the current template.
64
+    scope='root'      - the variable will be assigned if a data object was used for variable definitions in the data
65
+                        object or in the Smarty object otherwise and is bubbled up all {include} sub-templates to the
66
+                        current template.
67
+    scope='local'     - this scope has only a meaning if the tag is called within a template {function}.
68
+                        The variable will be assigned in the local scope of the template function and the
69
+                        template which did call the template function.
70
+
71
+
72
+    The {config_load} tag supports all of the above except the global scope.
73
+
74
+    The scope attribute can be used also with the {include} tag.
75
+    Supported scope are parent, tpl_root, smarty, global and root.
76
+    A scope used together with the {include} tag will cause that with some exceptions any variable
77
+    assignment within that sub-template will update/assign the variable in other scopes according
78
+    to the above rules. It does include also variables assigned by plugins, tags supporting the assign=foo 
79
+    attribute and direct assignments in {if} and {while} like {if $foo=$bar}.
80
+    Excluded are the key and value variables of {foreach}, {for} loop variables , variables passed by attributes
81
+    in {include} and direct increments/decrements like {$foo++}, {$foo--}
82
+
83
+    Note: The scopes should be used only to the extend really need. If a variable value assigned in an included
84
+          sub-template should be returned to the calling sub-template just use {$foo='bar' scope='parent'}.
85
+          Use scopes only with variables for which it's realy needed. Avoid general scope settings with the
86
+          {include} tag as it can have a performance impact.
87
+
88
+     The {assign}, {append}, {config_load} and {$foo...=...} tags have a new option flag 'noscope'.Thi
89
+     Example: {$foo='bar' noscope}  This will assign $foo only in the current template and any scope settings
90
+               at {include} is ignored.
91
+
92
+
93
+    Caching
94
+    =======
95
+    Caching does now observe the template_dir setting and will create separate cache files if required
96
+
97
+    Compiled Templates
98
+    ==================
99
+    The template_dir setting is now encoded in the uid of the file name.
100
+    The content of the compiled template may depend on the template_dir search order
101
+    {include .... inline} is used or $smarty->merge_compiled_includes is enabled
102
+
103
+    APC
104
+    ===
105
+    If APC is enabled force an apc_compile_file() when compiled or cached template was updated
106
+
107
+Smarty 3.1.28
108
+
109
+    OPCACHE
110
+    =======
111
+    Smarty does now invalidate automatically updated and cleared compiled or cached template files in OPCACHE.
112
+    Correct operation is no longer dependent on OPCACHE configuration settings.
113
+
114
+    Template inheritance
115
+    ====================
116
+    Template inheritance is now processed in run time.
117
+    See the INHERITANCE_RELEASE_NOTES
118
+
119
+    Modifier regex_replace
120
+    ======================
121
+    An optional limit parameter was added
122
+
123
+    fetch() and display()
124
+    =====================
125
+    The fetch() and display() methods of the template object accept now optionally the same parameter
126
+    as the corresponding Smarty methods to get the content of another template.
127
+    Example:
128
+        $template->display();           Does display template of template object
129
+        $template->display('foo.tpl');  Does display template 'foo.bar' 
130
+
131
+    File: resource
132
+    ==============
133
+    Multiple template_dir entries can now be selected  by a comma separated list of indices.
134
+    The template_dir array is searched in the order of the indices. (Could be used to change the default search order)
135
+    Example:
136
+        $smarty->display('[1],[0]foo.bar');
137
+
138
+    Filter support
139
+    ==============
140
+    Optional filter names
141
+      An optional filter name was added to $smarty->registerFilter(). It can be used to unregister a filter by name.
142
+      - $smarty->registerFilter('output', $callback, 'name');
143
+        $smarty->unregister('output', 'name');
144
+
145
+    Closures
146
+      $smarty->registerFilter() does now accept closures.
147
+      - $smarty->registerFilter('pre', function($source) {return $source;});
148
+      If no optional filter name was specified it gets the default name 'closure'.
149
+      If you register multiple closures register each with a unique filter name.
150
+      - $smarty->registerFilter('pre', function($source) {return $source;}, 'closure_1');
151
+      - $smarty->registerFilter('pre', function($source) {return $source;}, 'closure_2');
152
+
153
+
154
+Smarty 3.1.22
155
+
156
+    Namespace support within templates
157
+    ==================================
158
+    Within templates you can now use namespace specifications on:
159
+     - Constants                like    foo\bar\FOO
160
+     - Class names              like    foo\bar\Baz::FOO, foo\bar\Baz::$foo, foo\bar\Baz::foo()
161
+     - PHP function names       like    foo\bar\baz()
162
+
163
+    Security
164
+    ========
165
+    - disable special $smarty variable -
166
+    The Smarty_Security class has the new property $disabled_special_smarty_vars.
167
+    It's an array which can be loaded with the $smarty special variable names like
168
+    'template_object', 'template', 'current_dir' and others which will be disabled.
169
+    Note: That this security check is performed at compile time.
170
+
171
+    - limit template nesting -
172
+    Property $max_template_nesting of Smarty_Security does set the maximum template nesting level.
173
+    The main template is level 1. The nesting level is checked at run time. When the maximum will be exceeded
174
+    an Exception will be thrown. The default setting is 0 which does disable this check.
175
+
176
+    - trusted static methods -
177
+   The Smarty_Security class has the new property $trusted_static_methods to restrict access to static methods.
178
+   It's an nested array of trusted class and method names.
179
+         Format:
180
+         array (
181
+                    'class_1' => array('method_1', 'method_2'), // allowed methods
182
+                    'class_2' => array(),                       // all methods of class allowed
183
+               )
184
+   To disable access for all methods of all classes set $trusted_static_methods = null;
185
+   The default value is an empty array() which does enables all methods of all classes, but for backward compatibility
186
+   the setting of $static_classes will be checked.
187
+   Note: That this security check is performed at compile time.
188
+
189
+    - trusted static properties -
190
+   The Smarty_Security class has the new property $trusted_static_properties to restrict access to static properties.
191
+   It's an nested array of trusted class and property names.
192
+         Format:
193
+         array (
194
+                    'class_1' => array('prop_1', 'prop_2'), // allowed properties listed
195
+                    'class_2' => array(),                   // all properties of class allowed
196
+                }
197
+   To disable access for all properties of all classes set $trusted_static_properties = null;
198
+   The default value is an empty array() which does enables all properties of all classes, but for backward compatibility
199
+   the setting of $static_classes will be checked.
200
+   Note: That this security check is performed at compile time.
201
+
202
+    - trusted constants .
203
+   The Smarty_Security class has the new property $trusted_constants to restrict access to constants.
204
+   It's an array of trusted constant names.
205
+         Format:
206
+         array (
207
+                    'SMARTY_DIR' , // allowed constant
208
+                }
209
+   If the array is empty (default) the usage of constants  can be controlled with the
210
+   Smarty_Security::$allow_constants property (default true)
211
+
212
+
213
+
214
+    Compiled Templates
215
+    ==================
216
+    Smarty does now automatically detects a change of the $merge_compiled_includes and $escape_html
217
+    property and creates different compiled templates files depending on the setting.
218
+
219
+    Same applies to config files and the $config_overwrite, $config_booleanize and
220
+    $config_read_hidden properties.
221
+
222
+    Debugging
223
+    =========
224
+    The layout of the debug window has been changed for better readability
225
+
226
+    New class constants
227
+        Smarty::DEBUG_OFF
228
+        Smarty::DEBUG_ON
229
+        Smarty::DEBUG_INDIVIDUAL
230
+    have been introduced for setting the $debugging property.
231
+
232
+    Smarty::DEBUG_INDIVIDUAL will create for each display() and fetch() call an individual debug window.
233
+

+ 575
- 0
smarty/README View File

@@ -0,0 +1,575 @@
1
+Smarty 3.x
2
+
3
+Author: Monte Ohrt <monte at ohrt dot com >
4
+Author: Uwe Tews
5
+
6
+AN INTRODUCTION TO SMARTY 3
7
+
8
+NOTICE FOR 3.1 release:
9
+
10
+Please see the SMARTY_3.1_NOTES.txt file that comes with the distribution.
11
+
12
+NOTICE for 3.0.5 release:
13
+
14
+Smarty now follows the PHP error_reporting level by default. If PHP does not mask E_NOTICE and you try to access an unset template variable, you will now get an E_NOTICE warning. To revert to the old behavior:
15
+
16
+$smarty->error_reporting = E_ALL & ~E_NOTICE;
17
+
18
+NOTICE for 3.0 release:
19
+
20
+IMPORTANT: Some API adjustments have been made between the RC4 and 3.0 release.
21
+We felt it is better to make these now instead of after a 3.0 release, then have to
22
+immediately deprecate APIs in 3.1. Online documentation has been updated
23
+to reflect these changes. Specifically:
24
+
25
+---- API CHANGES RC4 -> 3.0 ----
26
+
27
+$smarty->register->*
28
+$smarty->unregister->*
29
+$smarty->utility->*
30
+$samrty->cache->*
31
+
32
+Have all been changed to local method calls such as:
33
+
34
+$smarty->clearAllCache()
35
+$smarty->registerFoo()
36
+$smarty->unregisterFoo()
37
+$smarty->testInstall()
38
+etc.
39
+
40
+Registration of function, block, compiler, and modifier plugins have been
41
+consolidated under two API calls:
42
+
43
+$smarty->registerPlugin(...)
44
+$smarty->unregisterPlugin(...)
45
+
46
+Registration of pre, post, output and variable filters have been
47
+consolidated under two API calls:
48
+
49
+$smarty->registerFilter(...)
50
+$smarty->unregisterFilter(...)
51
+
52
+Please refer to the online documentation for all specific changes:
53
+
54
+http://www.smarty.net/documentation
55
+
56
+----
57
+
58
+The Smarty 3 API has been refactored to a syntax geared
59
+for consistency and modularity. The Smarty 2 API syntax is still supported, but
60
+will throw a deprecation notice. You can disable the notices, but it is highly
61
+recommended to adjust your syntax to Smarty 3, as the Smarty 2 syntax must run
62
+through an extra rerouting wrapper.
63
+
64
+Basically, all Smarty methods now follow the "fooBarBaz" camel case syntax. Also,
65
+all Smarty properties now have getters and setters. So for example, the property
66
+$smarty->cache_dir can be set with $smarty->setCacheDir('foo/') and can be
67
+retrieved with $smarty->getCacheDir().
68
+
69
+Some of the Smarty 3 APIs have been revoked such as the "is*" methods that were
70
+just duplicate functions of the now available "get*" methods.
71
+
72
+Here is a rundown of the Smarty 3 API:
73
+
74
+$smarty->fetch($template, $cache_id = null, $compile_id = null, $parent = null)
75
+$smarty->display($template, $cache_id = null, $compile_id = null, $parent = null)
76
+$smarty->isCached($template, $cache_id = null, $compile_id = null)
77
+$smarty->createData($parent = null)
78
+$smarty->createTemplate($template, $cache_id = null, $compile_id = null, $parent = null)
79
+$smarty->enableSecurity()
80
+$smarty->disableSecurity()
81
+$smarty->setTemplateDir($template_dir)
82
+$smarty->addTemplateDir($template_dir)
83
+$smarty->templateExists($resource_name)
84
+$smarty->loadPlugin($plugin_name, $check = true)
85
+$smarty->loadFilter($type, $name)
86
+$smarty->setExceptionHandler($handler)
87
+$smarty->addPluginsDir($plugins_dir)
88
+$smarty->getGlobal($varname = null)
89
+$smarty->getRegisteredObject($name)
90
+$smarty->getDebugTemplate()
91
+$smarty->setDebugTemplate($tpl_name)
92
+$smarty->assign($tpl_var, $value = null, $nocache = false)
93
+$smarty->assignGlobal($varname, $value = null, $nocache = false)
94
+$smarty->assignByRef($tpl_var, &$value, $nocache = false)
95
+$smarty->append($tpl_var, $value = null, $merge = false, $nocache = false)
96
+$smarty->appendByRef($tpl_var, &$value, $merge = false)
97
+$smarty->clearAssign($tpl_var)
98
+$smarty->clearAllAssign()
99
+$smarty->configLoad($config_file, $sections = null)
100
+$smarty->getVariable($variable, $_ptr = null, $search_parents = true, $error_enable = true)
101
+$smarty->getConfigVariable($variable)
102
+$smarty->getStreamVariable($variable)
103
+$smarty->getConfigVars($varname = null)
104
+$smarty->clearConfig($varname = null)
105
+$smarty->getTemplateVars($varname = null, $_ptr = null, $search_parents = true)
106
+$smarty->clearAllCache($exp_time = null, $type = null)
107
+$smarty->clearCache($template_name, $cache_id = null, $compile_id = null, $exp_time = null, $type = null)
108
+
109
+$smarty->registerPlugin($type, $tag, $callback, $cacheable = true, $cache_attr = array())
110
+
111
+$smarty->registerObject($object_name, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())
112
+
113
+$smarty->registerFilter($type, $function_name)
114
+$smarty->registerResource($resource_type, $function_names)
115
+$smarty->registerDefaultPluginHandler($function_name)
116
+$smarty->registerDefaultTemplateHandler($function_name)
117
+
118
+$smarty->unregisterPlugin($type, $tag)
119
+$smarty->unregisterObject($object_name)
120
+$smarty->unregisterFilter($type, $function_name)
121
+$smarty->unregisterResource($resource_type)
122
+
123
+$smarty->compileAllTemplates($extension = '.tpl', $force_compile = false, $time_limit = 0, $max_errors = null)
124
+$smarty->clearCompiledTemplate($resource_name = null, $compile_id = null, $exp_time = null)
125
+$smarty->testInstall()
126
+
127
+// then all the getters/setters, available for all properties. Here are a few:
128
+
129
+$caching = $smarty->getCaching();      // get $smarty->caching
130
+$smarty->setCaching(true);             // set $smarty->caching
131
+$smarty->setDeprecationNotices(false); // set $smarty->deprecation_notices
132
+$smarty->setCacheId($id);              // set $smarty->cache_id
133
+$debugging = $smarty->getDebugging();  // get $smarty->debugging
134
+
135
+
136
+FILE STRUCTURE
137
+
138
+The Smarty 3 file structure is similar to Smarty 2:
139
+
140
+/libs/
141
+  Smarty.class.php
142
+/libs/sysplugins/
143
+  internal.*
144
+/libs/plugins/
145
+  function.mailto.php
146
+  modifier.escape.php
147
+  ...
148
+
149
+A lot of Smarty 3 core functionality lies in the sysplugins directory; you do
150
+not need to change any files here. The /libs/plugins/ folder is where Smarty
151
+plugins are located. You can add your own here, or create a separate plugin
152
+directory, just the same as Smarty 2. You will still need to create your own
153
+/cache/, /templates/, /templates_c/, /configs/ folders. Be sure /cache/ and
154
+/templates_c/ are writable.
155
+
156
+The typical way to use Smarty 3 should also look familiar:
157
+
158
+require('Smarty.class.php');
159
+$smarty = new Smarty;
160
+$smarty->assign('foo','bar');
161
+$smarty->display('index.tpl');
162
+
163
+
164
+However, Smarty 3 works completely different on the inside. Smarty 3 is mostly
165
+backward compatible with Smarty 2, except for the following items:
166
+
167
+*) Smarty 3 is PHP 5 only. It will not work with PHP 4.
168
+*) The {php} tag is disabled by default. Enable with $smarty->allow_php_tag=true.
169
+*) Delimiters surrounded by whitespace are no longer treated as Smarty tags.
170
+   Therefore, { foo } will not compile as a tag, you must use {foo}. This change
171
+   Makes Javascript/CSS easier to work with, eliminating the need for {literal}.
172
+   This can be disabled by setting $smarty->auto_literal = false;
173
+*) The Smarty 3 API is a bit different. Many Smarty 2 API calls are deprecated
174
+   but still work. You will want to update your calls to Smarty 3 for maximum
175
+   efficiency.
176
+
177
+
178
+There are many things that are new to Smarty 3. Here are the notable items:
179
+   
180
+LEXER/PARSER
181
+============
182
+
183
+Smarty 3 now uses a lexing tokenizer for its parser/compiler. Basically, this
184
+means Smarty has some syntax additions that make life easier such as in-template
185
+math, shorter/intuitive function parameter options, infinite function recursion,
186
+more accurate error handling, etc.
187
+
188
+
189
+WHAT IS NEW IN SMARTY TEMPLATE SYNTAX
190
+=====================================
191
+
192
+Smarty 3 allows expressions almost anywhere. Expressions can include PHP
193
+functions as long as they are not disabled by the security policy, object
194
+methods and properties, etc. The {math} plugin is no longer necessary but
195
+is still supported for BC.
196
+
197
+Examples:
198
+{$x+$y}                           will output the sum of x and y.
199
+{$foo = strlen($bar)}             function in assignment
200
+{assign var=foo value= $x+$y}     in attributes 
201
+{$foo = myfunct( ($x+$y)*3 )}     as function parameter 
202
+{$foo[$x+3]}                      as array index
203
+
204
+Smarty tags can be used as values within other tags.
205
+Example:  {$foo={counter}+3}
206
+
207
+Smarty tags can also be used inside double quoted strings.
208
+Example:  {$foo="this is message {counter}"}
209
+
210
+You can define arrays within templates.
211
+Examples:
212
+{assign var=foo value=[1,2,3]}
213
+{assign var=foo value=['y'=>'yellow','b'=>'blue']}
214
+Arrays can be nested.
215
+{assign var=foo value=[1,[9,8],3]}
216
+
217
+There is a new short syntax supported for assigning variables.
218
+Example: {$foo=$bar+2}
219
+
220
+You can assign a value to a specific array element. If the variable exists but
221
+is not an array, it is converted to an array before the new values are assigned.
222
+Examples:
223
+{$foo['bar']=1}
224
+{$foo['bar']['blar']=1}
225
+
226
+You can append values to an array. If the variable exists but is not an array,
227
+it is converted to an array before the new values are assigned.
228
+Example: {$foo[]=1}
229
+
230
+You can use a PHP-like syntax for accessing array elements, as well as the
231
+original "dot" notation.
232
+Examples:
233
+{$foo[1]}             normal access
234
+{$foo['bar']}
235
+{$foo['bar'][1]}
236
+{$foo[$x+$x]}         index may contain any expression
237
+{$foo[$bar[1]]}       nested index
238
+{$foo[section_name]}  smarty section access, not array access!
239
+
240
+The original "dot" notation stays, and with improvements.
241
+Examples:
242
+{$foo.a.b.c}        =>  $foo['a']['b']['c'] 
243
+{$foo.a.$b.c}       =>  $foo['a'][$b]['c']        with variable index
244
+{$foo.a.{$b+4}.c}   =>  $foo['a'][$b+4]['c']       with expression as index
245
+{$foo.a.{$b.c}}     =>  $foo['a'][$b['c']]         with nested index
246
+
247
+note that { and } are used to address ambiguties when nesting the dot syntax. 
248
+
249
+Variable names themselves can be variable and contain expressions.
250
+Examples:
251
+$foo         normal variable
252
+$foo_{$bar}  variable name containing other variable 
253
+$foo_{$x+$y} variable name containing expressions 
254
+$foo_{$bar}_buh_{$blar}  variable name with multiple segments
255
+{$foo_{$x}}  will output the variable $foo_1 if $x has a value of 1.
256
+
257
+Object method chaining is implemented.
258
+Example: {$object->method1($x)->method2($y)}
259
+
260
+{for} tag added for looping (replacement for {section} tag):
261
+{for $x=0, $y=count($foo); $x<$y; $x++}  ....  {/for}
262
+Any number of statements can be used separated by comma as the first
263
+inital expression at {for}.
264
+
265
+{for $x = $start to $end step $step} ... {/for}is in the SVN now .
266
+You can use also
267
+{for $x = $start to $end} ... {/for}
268
+In this case the step value will be automaticall 1 or -1 depending on the start and end values.
269
+Instead of $start and $end you can use any valid expression.
270
+Inside the loop the following special vars can be accessed:
271
+$x@iteration = number of iteration
272
+$x@total = total number of iterations
273
+$x@first = true on first iteration
274
+$x@last = true on last iteration
275
+
276
+
277
+The Smarty 2 {section} syntax is still supported.
278
+
279
+New shorter {foreach} syntax to loop over an array.
280
+Example: {foreach $myarray as $var}...{/foreach}
281
+
282
+Within the foreach loop, properties are access via:
283
+
284
+$var@key            foreach $var array key
285
+$var@iteration      foreach current iteration count (1,2,3...)
286
+$var@index          foreach current index count (0,1,2...)
287
+$var@total          foreach $var array total
288
+$var@first          true on first iteration
289
+$var@last           true on last iteration
290
+
291
+The Smarty 2 {foreach} tag syntax is still supported.
292
+
293
+NOTE: {$bar[foo]} still indicates a variable inside of a {section} named foo. 
294
+If you want to access an array element with index foo, you must use quotes
295
+such as {$bar['foo']}, or use the dot syntax {$bar.foo}.
296
+
297
+while block tag is now implemented:
298
+{while $foo}...{/while}
299
+{while $x lt 10}...{/while}
300
+
301
+Direct access to PHP functions:
302
+Just as you can use PHP functions as modifiers directly, you can now access
303
+PHP functions directly, provided they are permitted by security settings:
304
+{time()}
305
+
306
+There is a new {function}...{/function} block tag to implement a template function.
307
+This enables reuse of code sequences like a plugin function. It can call itself recursively.
308
+Template function must be called with the new {call name=foo...} tag.
309
+
310
+Example:
311
+
312
+Template file:
313
+{function name=menu level=0}
314
+  <ul class="level{$level}">
315
+  {foreach $data as $entry}
316
+    {if is_array($entry)}
317
+      <li>{$entry@key}</li>
318
+       {call name=menu data=$entry level=$level+1}
319
+    {else}
320
+      <li>{$entry}</li>
321
+    {/if}
322
+  {/foreach}
323
+  </ul>
324
+{/function}
325
+
326
+{$menu = ['item1','item2','item3' => ['item3-1','item3-2','item3-3' =>
327
+  ['item3-3-1','item3-3-2']],'item4']}
328
+
329
+{call name=menu data=$menu}
330
+
331
+
332
+Generated output:
333
+    * item1
334
+    * item2
335
+    * item3
336
+          o item3-1
337
+          o item3-2
338
+          o item3-3
339
+                + item3-3-1
340
+                + item3-3-2
341
+    * item4
342
+
343
+The function tag itself must have the "name" attribute. This name is the tag
344
+name when calling the function. The function tag may have any number of
345
+additional attributes. These will be default settings for local variables.
346
+
347
+New {nocache} block function:
348
+{nocache}...{/nocache} will declare a section of the template to be non-cached
349
+when template caching is enabled.
350
+
351
+New nocache attribute:
352
+You can declare variable/function output as non-cached with the nocache attribute.
353
+Examples:
354
+
355
+{$foo nocache=true}
356
+{$foo nocache} /* same */
357
+
358
+{foo bar="baz" nocache=true}
359
+{foo bar="baz" nocache} /* same */
360
+
361
+{time() nocache=true}
362
+{time() nocache} /* same */
363
+
364
+Or you can also assign the variable in your script as nocache:
365
+$smarty->assign('foo',$something,true); // third param is nocache setting
366
+{$foo} /* non-cached */
367
+
368
+$smarty.current_dir returns the directory name of the current template.
369
+
370
+You can use strings directly as templates with the "string" resource type.
371
+Examples:
372
+$smarty->display('string:This is my template, {$foo}!'); // php
373
+{include file="string:This is my template, {$foo}!"} // template
374
+
375
+
376
+
377
+VARIABLE SCOPE / VARIABLE STORAGE
378
+=================================
379
+
380
+In Smarty 2, all assigned variables were stored within the Smarty object. 
381
+Therefore, all variables assigned in PHP were accessible by all subsequent 
382
+fetch and display template calls.
383
+
384
+In Smarty 3, we have the choice to assign variables to the main Smarty object, 
385
+to user-created data objects, and to user-created template objects. 
386
+These objects can be chained. The object at the end of a chain can access all
387
+variables belonging to that template and all variables within the parent objects.
388
+The Smarty object can only be the root of a chain, but a chain can be isolated
389
+from the Smarty object.
390
+
391
+All known Smarty assignment interfaces will work on the data and template objects.
392
+
393
+Besides the above mentioned objects, there is also a special storage area for
394
+global variables.
395
+
396
+A Smarty data object can be created as follows:
397
+$data = $smarty->createData();    // create root data object
398
+$data->assign('foo','bar');       // assign variables as usual
399
+$data->config_load('my.conf');									 // load config file    
400
+
401
+$data= $smarty->createData($smarty);  // create data object having a parent link to
402
+the Smarty object
403
+
404
+$data2= $smarty->createData($data);   // create data object having a parent link to
405
+the $data data object
406
+
407
+A template object can be created by using the createTemplate method. It has the
408
+same parameter assignments as the fetch() or display() method.
409
+Function definition:
410
+function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null)
411
+
412
+The first parameter can be a template name, a smarty object or a data object.
413
+
414
+Examples:
415
+$tpl = $smarty->createTemplate('mytpl.tpl'); // create template object not linked to any parent
416
+$tpl->assign('foo','bar');                   // directly assign variables
417
+$tpl->config_load('my.conf');									 // load config file    
418
+
419
+$tpl = $smarty->createTemplate('mytpl.tpl',$smarty);  // create template having a parent link to the Smarty object
420
+$tpl = $smarty->createTemplate('mytpl.tpl',$data);    // create template having a parent link to the $data object
421
+
422
+The standard fetch() and display() methods will implicitly create a template object.
423
+If the $parent parameter is not specified in these method calls, the template object
424
+is will link back to the Smarty object as it's parent.
425
+
426
+If a template is called by an {include...} tag from another template, the
427
+subtemplate links back to the calling template as it's parent. 
428
+
429
+All variables assigned locally or from a parent template are accessible. If the
430
+template creates or modifies a variable by using the {assign var=foo...} or
431
+{$foo=...} tags, these new values are only known locally (local scope). When the
432
+template exits, none of the new variables or modifications can be seen in the
433
+parent template(s). This is same behavior as in Smarty 2. 
434
+
435
+With Smarty 3, we can assign variables with a scope attribute which allows the
436
+availablility of these new variables or modifications globally (ie in the parent
437
+templates.)
438
+
439
+Possible scopes are local, parent, root and global. 
440
+Examples:
441
+{assign var=foo value='bar'}       // no scope is specified, the default 'local'
442
+{$foo='bar'}                       // same, local scope
443
+{assign var=foo value='bar' scope='local'} // same, local scope
444
+
445
+{assign var=foo value='bar' scope='parent'} // Values will be available to the parent object 
446
+{$foo='bar' scope='parent'}                 // (normally the calling template)
447
+
448
+{assign var=foo value='bar' scope='root'}   // Values will be exported up to the root object, so they can 
449
+{$foo='bar' scope='root'}                   // be seen from all templates using the same root.
450
+
451
+{assign var=foo value='bar' scope='global'} // Values will be exported to global variable storage, 
452
+{$foo='bar' scope='global'}                 // they are available to any and all templates.
453
+
454
+
455
+The scope attribute can also be attached to the {include...} tag. In this case,
456
+the specified scope will be the default scope for all assignments within the
457
+included template.
458
+
459
+
460
+PLUGINS
461
+=======
462
+
463
+Smarty 3 plugins follow the same coding rules as in Smarty 2. 
464
+The main difference is that the template object is now passed in place of the smarty object. 
465
+The smarty object can be still be accessed through $template->smarty.
466
+
467
+smarty_plugintype_name (array $params, Smarty_Internal_Template $template)
468
+
469
+The Smarty 2 plugins are still compatible as long as they do not make use of specific Smarty 2 internals.
470
+
471
+
472
+TEMPLATE INHERITANCE:
473
+=====================
474
+
475
+With template inheritance you can define blocks, which are areas that can be
476
+overriden by child templates, so your templates could look like this: 
477
+
478
+parent.tpl:
479
+<html>
480
+  <head>
481
+    <title>{block name='title'}My site name{/block}</title>
482
+  </head>
483
+  <body>
484
+    <h1>{block name='page-title'}Default page title{/block}</h1>
485
+    <div id="content">
486
+      {block name='content'}
487
+        Default content
488
+      {/block}
489
+    </div>
490
+  </body>
491
+</html>
492
+
493
+child.tpl:
494
+{extends file='parent.tpl'} 
495
+{block name='title'}
496
+Child title
497
+{/block}
498
+
499
+grandchild.tpl:
500
+{extends file='child.tpl'} 
501
+{block name='title'}Home - {$smarty.block.parent}{/block} 
502
+{block name='page-title'}My home{/block}
503
+{block name='content'}
504
+  {foreach $images as $img}
505
+    <img src="{$img.url}" alt="{$img.description}" />
506
+  {/foreach}
507
+{/block}
508
+
509
+We redefined all the blocks here, however in the title block we used {$smarty.block.parent},
510
+which tells Smarty to insert the default content from the parent template in its place.
511
+The content block was overriden to display the image files, and page-title has also be 
512
+overriden to display a completely different title. 
513
+
514
+If we render grandchild.tpl we will get this: 
515
+<html>
516
+  <head>
517
+    <title>Home - Child title</title>
518
+  </head>
519
+  <body>
520
+    <h1>My home</h1>
521
+    <div id="content">
522
+      <img src="/example.jpg" alt="image" />
523
+      <img src="/example2.jpg" alt="image" />
524
+      <img src="/example3.jpg" alt="image" />
525
+    </div>
526
+  </body>
527
+</html>
528
+
529
+NOTE: In the child templates everything outside the {extends} or {block} tag sections
530
+is ignored.
531
+
532
+The inheritance tree can be as big as you want (meaning you can extend a file that 
533
+extends another one that extends another one and so on..), but be aware that all files 
534
+have to be checked for modifications at runtime so the more inheritance the more overhead you add.
535
+
536
+Instead of defining the parent/child relationships with the {extends} tag in the child template you
537
+can use the resource as follow:
538
+
539
+$smarty->display('extends:parent.tpl|child.tpl|grandchild.tpl');
540
+
541
+Child {block} tags may optionally have a append or prepend attribute. In this case the parent block content 
542
+is appended or prepended to the child block content.
543
+
544
+{block name='title' append} My title {/block}
545
+
546
+
547
+PHP STREAMS:
548
+============
549
+
550
+(see online documentation)
551
+
552
+VARIBLE FILTERS:
553
+================
554
+
555
+(see online documentation)
556
+
557
+
558
+STATIC CLASS ACCESS AND NAMESPACE SUPPORT
559
+=========================================
560
+
561
+You can register a class with optional namespace for the use in the template like:
562
+
563
+$smarty->register->templateClass('foo','name\name2\myclass');
564
+
565
+In the template you can use it like this:
566
+{foo::method()}  etc.
567
+
568
+
569
+=======================
570
+
571
+Please look through it and send any questions/suggestions/etc to the forums.
572
+
573
+http://www.phpinsider.com/smarty-forum/viewtopic.php?t=14168
574
+
575
+Monte and Uwe

+ 65
- 0
smarty/README.md View File

@@ -0,0 +1,65 @@
1
+#Smarty 3 template engine
2
+##Distribution repository
3
+
4
+> Smarty 3.1.28 introduces run time template inheritance
5
+
6
+> Read the NEW_FEATURES and INHERITANCE_RELEASE_NOTES file for recent extensions to Smarty 3.1 functionality
7
+
8
+Smarty versions 3.1.11 or later are now on github and can be installed with Composer.
9
+
10
+
11
+The "smarty/smarty" package will start at libs/....   subfolder.
12
+
13
+To get the latest stable version of Smarty 3.1 use
14
+
15
+```json
16
+"require": {
17
+    "smarty/smarty": "~3.1"
18
+}
19
+```
20
+
21
+in your composer.json file.
22
+
23
+To get the trunk version use
24
+
25
+```json
26
+"require": {
27
+    "smarty/smarty": "~3.1@dev"
28
+}
29
+```
30
+
31
+For a specific version use something like
32
+
33
+```json
34
+"require": {
35
+    "smarty/smarty": "3.1.19"
36
+}
37
+```
38
+
39
+PHPUnit test can be installed by corresponding composer entries like
40
+
41
+```json
42
+"require": {
43
+    "smarty/smarty-phpunit": "3.1.19"
44
+}
45
+```
46
+
47
+Similar applies for the lexer/parser generator
48
+
49
+```json
50
+"require": {
51
+    "smarty/smarty-lexer": "3.1.19"
52
+}
53
+```
54
+
55
+Or you could use
56
+
57
+```json
58
+"require": {
59
+    "smarty/smarty-dev": "3.1.19"
60
+}
61
+```
62
+
63
+Which is a wrapper to install all 3 packages
64
+
65
+Composer can also be used for Smarty2 versions 2.6.24 to 2.6.28

+ 109
- 0
smarty/SMARTY_2_BC_NOTES.txt View File

@@ -0,0 +1,109 @@
1
+= Known incompatibilities with Smarty 2 =
2
+
3
+== Syntax ==
4
+
5
+Smarty 3 API has a new syntax. Much of the Smarty 2 syntax is supported 
6
+by a wrapper but deprecated. See the README that comes with Smarty 3 for more 
7
+information.
8
+
9
+The {$array|@mod} syntax has always been a bit confusing, where an "@" is required
10
+to apply a modifier to an array instead of the individual elements. Normally you
11
+always want the modifier to apply to the variable regardless of its type. In Smarty 3,
12
+{$array|mod} and {$array|@mod} behave identical. It is safe to drop the "@" and the
13
+modifier will still apply to the array. If you really want the modifier to apply to
14
+each array element, you must loop the array in-template, or use a custom modifier that
15
+supports array iteration. Most smarty functions already escape values where necessary
16
+such as {html_options}
17
+
18
+== PHP Version ==
19
+Smarty 3 is PHP 5 only. It will not work with PHP 4.
20
+
21
+== {php} Tag ==
22
+The {php} tag is disabled by default. The use of {php} tags is
23
+deprecated. It can be enabled with $smarty->allow_php_tag=true.
24
+
25
+But if you scatter PHP code which belongs together into several
26
+{php} tags it may not work any longer.
27
+
28
+== Delimiters and whitespace ==
29
+Delimiters surrounded by whitespace are no longer treated as Smarty tags.
30
+Therefore, { foo } will not compile as a tag, you must use {foo}. This change
31
+Makes Javascript/CSS easier to work with, eliminating the need for {literal}.
32
+This can be disabled by setting $smarty->auto_literal = false;
33
+
34
+== Unquoted Strings ==
35
+Smarty 2 was a bit more forgiving (and ambiguous) when it comes to unquoted strings 
36
+in parameters. Smarty3 is more restrictive. You can still pass strings without quotes 
37
+so long as they contain no special characters. (anything outside of A-Za-z0-9_) 
38
+
39
+For example filename strings must be quoted
40
+<source lang="smarty">
41
+{include file='path/foo.tpl'}
42
+</source>
43
+
44
+== Extending the Smarty class ==
45
+Smarty 3 makes use of the __construct method for initialization. If you are extending 
46
+the Smarty class, its constructor is not called implicitly if the your child class defines 
47
+its own constructor. In order to run Smarty's constructor, a call to parent::__construct() 
48
+within your child constructor is required. 
49
+
50
+<source lang="php">
51
+class MySmarty extends Smarty {
52
+   function __construct() {
53
+       parent::__construct();
54
+    
55
+       // your initialization code goes here
56
+
57
+   }
58
+}
59
+</source>
60
+
61
+== Autoloader ==
62
+Smarty 3 does register its own autoloader with spl_autoload_register. If your code has 
63
+an existing __autoload function then this function must be explicitly registered on 
64
+the __autoload stack. See http://us3.php.net/manual/en/function.spl-autoload-register.php 
65
+for further details.
66
+
67
+== Plugin Filenames ==
68
+Smarty 3 optionally supports the PHP spl_autoloader. The autoloader requires filenames 
69
+to be lower case. Because of this, Smarty plugin file names must also be lowercase. 
70
+In Smarty 2, mixed case file names did work.
71
+
72
+== Scope of Special Smarty Variables ==
73
+In Smarty 2 the special Smarty variables $smarty.section... and $smarty.foreach... 
74
+had global scope. If you had loops with the same name in subtemplates you could accidentally 
75
+overwrite values of parent template.
76
+
77
+In Smarty 3 these special Smarty variable have only local scope in the template which 
78
+is defining the loop. If you need their value in a subtemplate you have to pass them 
79
+as parameter.
80
+<source lang="smarty">
81
+{include file='path/foo.tpl' index=$smarty.section.foo.index}
82
+</source>
83
+
84
+== SMARTY_RESOURCE_CHAR_SET ==
85
+Smarty 3 sets the constant SMARTY_RESOURCE_CHAR_SET to utf-8 as default template charset. 
86
+This is now used also on modifiers like escape as default charset. If your templates use 
87
+other charsets make sure that you define the constant accordingly. Otherwise you may not 
88
+get any output.
89
+
90
+== newline at {if} tags ==
91
+A \n was added to the compiled code of the {if},{else},{elseif},{/if} tags to get output of newlines as expected by the template source. 
92
+If one of the {if} tags is at the line end you will now get a newline in the HTML output.
93
+
94
+== trigger_error() ==
95
+The API function trigger_error() has been removed because it did just map to PHP trigger_error.
96
+However it's still included in the Smarty2 API wrapper.
97
+
98
+== Smarty constants ==
99
+The constants 
100
+SMARTY_PHP_PASSTHRU
101
+SMARTY_PHP_QUOTE
102
+SMARTY_PHP_REMOVE
103
+SMARTY_PHP_ALLOW
104
+have been replaced with class constants
105
+Smarty::PHP_PASSTHRU
106
+Smarty::PHP_QUOTE
107
+Smarty::PHP_REMOVE
108
+Smarty::PHP_ALLOW
109
+

+ 24