├── .htaccess
├── Db.class.php
├── LICENSE
├── README.markdown
├── db.sql
├── images
└── favicons
│ ├── android-icon-192x192.png
│ ├── apple-icon-114x114.png
│ ├── apple-icon-120x120.png
│ ├── apple-icon-144x144.png
│ ├── apple-icon-152x152.png
│ ├── apple-icon-180x180.png
│ ├── apple-icon-57x57.png
│ ├── apple-icon-60x60.png
│ ├── apple-icon-72x72.png
│ ├── apple-icon-76x76.png
│ ├── favicon-16x16.png
│ ├── favicon-32x32.png
│ └── favicon-96x96.png
├── index.php
├── install.php
├── legacy
├── app.css
├── bin.js
├── custom.modernizr.js
├── google-code-prettify
│ ├── prettify.js
│ └── tomorrow-night.css
├── index.css
├── jquery-ui-1.10.3.custom.min.js
├── jquery.min.js
├── mousetrap.min.js
├── tabby.js
├── toastr
│ ├── toastr.min.css
│ └── toastr.min.js
├── tos.css
└── zclip.min.js
├── manifest.json
├── robots.txt
├── smarty
├── COMPOSER_RELEASE_NOTES.txt
├── INHERITANCE_RELEASE_NOTES.txt
├── LICENSE
├── NEW_FEATURES.txt
├── README
├── README.md
├── SMARTY_2_BC_NOTES.txt
├── SMARTY_3.0_BC_NOTES.txt
├── SMARTY_3.1_NOTES.txt
├── change_log.txt
├── composer.json
├── error_reporting.ini
├── libs
│ ├── Autoloader.php
│ ├── Smarty.class.php
│ ├── SmartyBC.class.php
│ ├── bootstrap.php
│ ├── debug.tpl
│ ├── plugins
│ │ ├── block.textformat.php
│ │ ├── function.counter.php
│ │ ├── function.cycle.php
│ │ ├── function.fetch.php
│ │ ├── function.html_checkboxes.php
│ │ ├── function.html_image.php
│ │ ├── function.html_options.php
│ │ ├── function.html_radios.php
│ │ ├── function.html_select_date.php
│ │ ├── function.html_select_time.php
│ │ ├── function.html_table.php
│ │ ├── function.mailto.php
│ │ ├── function.math.php
│ │ ├── modifier.capitalize.php
│ │ ├── modifier.date_format.php
│ │ ├── modifier.debug_print_var.php
│ │ ├── modifier.escape.php
│ │ ├── modifier.mb_wordwrap.php
│ │ ├── modifier.regex_replace.php
│ │ ├── modifier.replace.php
│ │ ├── modifier.spacify.php
│ │ ├── modifier.truncate.php
│ │ ├── modifiercompiler.cat.php
│ │ ├── modifiercompiler.count_characters.php
│ │ ├── modifiercompiler.count_paragraphs.php
│ │ ├── modifiercompiler.count_sentences.php
│ │ ├── modifiercompiler.count_words.php
│ │ ├── modifiercompiler.default.php
│ │ ├── modifiercompiler.escape.php
│ │ ├── modifiercompiler.from_charset.php
│ │ ├── modifiercompiler.indent.php
│ │ ├── modifiercompiler.lower.php
│ │ ├── modifiercompiler.noprint.php
│ │ ├── modifiercompiler.string_format.php
│ │ ├── modifiercompiler.strip.php
│ │ ├── modifiercompiler.strip_tags.php
│ │ ├── modifiercompiler.to_charset.php
│ │ ├── modifiercompiler.unescape.php
│ │ ├── modifiercompiler.upper.php
│ │ ├── modifiercompiler.wordwrap.php
│ │ ├── outputfilter.trimwhitespace.php
│ │ ├── shared.escape_special_chars.php
│ │ ├── shared.literal_compiler_param.php
│ │ ├── shared.make_timestamp.php
│ │ ├── shared.mb_str_replace.php
│ │ ├── shared.mb_unicode.php
│ │ └── variablefilter.htmlspecialchars.php
│ └── sysplugins
│ │ ├── smarty_cacheresource.php
│ │ ├── smarty_cacheresource_custom.php
│ │ ├── smarty_cacheresource_keyvaluestore.php
│ │ ├── smarty_data.php
│ │ ├── smarty_internal_block.php
│ │ ├── smarty_internal_cacheresource_file.php
│ │ ├── smarty_internal_compile_append.php
│ │ ├── smarty_internal_compile_assign.php
│ │ ├── smarty_internal_compile_block.php
│ │ ├── smarty_internal_compile_block_child.php
│ │ ├── smarty_internal_compile_block_parent.php
│ │ ├── smarty_internal_compile_break.php
│ │ ├── smarty_internal_compile_call.php
│ │ ├── smarty_internal_compile_capture.php
│ │ ├── smarty_internal_compile_child.php
│ │ ├── smarty_internal_compile_config_load.php
│ │ ├── smarty_internal_compile_continue.php
│ │ ├── smarty_internal_compile_debug.php
│ │ ├── smarty_internal_compile_eval.php
│ │ ├── smarty_internal_compile_extends.php
│ │ ├── smarty_internal_compile_for.php
│ │ ├── smarty_internal_compile_foreach.php
│ │ ├── smarty_internal_compile_function.php
│ │ ├── smarty_internal_compile_if.php
│ │ ├── smarty_internal_compile_include.php
│ │ ├── smarty_internal_compile_include_php.php
│ │ ├── smarty_internal_compile_insert.php
│ │ ├── smarty_internal_compile_ldelim.php
│ │ ├── smarty_internal_compile_make_nocache.php
│ │ ├── smarty_internal_compile_nocache.php
│ │ ├── smarty_internal_compile_parent.php
│ │ ├── smarty_internal_compile_private_block_plugin.php
│ │ ├── smarty_internal_compile_private_foreachsection.php
│ │ ├── smarty_internal_compile_private_function_plugin.php
│ │ ├── smarty_internal_compile_private_modifier.php
│ │ ├── smarty_internal_compile_private_object_block_function.php
│ │ ├── smarty_internal_compile_private_object_function.php
│ │ ├── smarty_internal_compile_private_php.php
│ │ ├── smarty_internal_compile_private_print_expression.php
│ │ ├── smarty_internal_compile_private_registered_block.php
│ │ ├── smarty_internal_compile_private_registered_function.php
│ │ ├── smarty_internal_compile_private_special_variable.php
│ │ ├── smarty_internal_compile_rdelim.php
│ │ ├── smarty_internal_compile_section.php
│ │ ├── smarty_internal_compile_setfilter.php
│ │ ├── smarty_internal_compile_shared_inheritance.php
│ │ ├── smarty_internal_compile_while.php
│ │ ├── smarty_internal_compilebase.php
│ │ ├── smarty_internal_config_file_compiler.php
│ │ ├── smarty_internal_configfilelexer.php
│ │ ├── smarty_internal_configfileparser.php
│ │ ├── smarty_internal_data.php
│ │ ├── smarty_internal_debug.php
│ │ ├── smarty_internal_errorhandler.php
│ │ ├── smarty_internal_extension_handler.php
│ │ ├── smarty_internal_method_addautoloadfilters.php
│ │ ├── smarty_internal_method_adddefaultmodifiers.php
│ │ ├── smarty_internal_method_append.php
│ │ ├── smarty_internal_method_appendbyref.php
│ │ ├── smarty_internal_method_assignbyref.php
│ │ ├── smarty_internal_method_assignglobal.php
│ │ ├── smarty_internal_method_clearallassign.php
│ │ ├── smarty_internal_method_clearallcache.php
│ │ ├── smarty_internal_method_clearassign.php
│ │ ├── smarty_internal_method_clearcache.php
│ │ ├── smarty_internal_method_clearcompiledtemplate.php
│ │ ├── smarty_internal_method_clearconfig.php
│ │ ├── smarty_internal_method_compileallconfig.php
│ │ ├── smarty_internal_method_compilealltemplates.php
│ │ ├── smarty_internal_method_configload.php
│ │ ├── smarty_internal_method_createdata.php
│ │ ├── smarty_internal_method_getautoloadfilters.php
│ │ ├── smarty_internal_method_getconfigvariable.php
│ │ ├── smarty_internal_method_getconfigvars.php
│ │ ├── smarty_internal_method_getdebugtemplate.php
│ │ ├── smarty_internal_method_getdefaultmodifiers.php
│ │ ├── smarty_internal_method_getglobal.php
│ │ ├── smarty_internal_method_getregisteredobject.php
│ │ ├── smarty_internal_method_getstreamvariable.php
│ │ ├── smarty_internal_method_gettags.php
│ │ ├── smarty_internal_method_gettemplatevars.php
│ │ ├── smarty_internal_method_literals.php
│ │ ├── smarty_internal_method_loadfilter.php
│ │ ├── smarty_internal_method_loadplugin.php
│ │ ├── smarty_internal_method_mustcompile.php
│ │ ├── smarty_internal_method_registercacheresource.php
│ │ ├── smarty_internal_method_registerclass.php
│ │ ├── smarty_internal_method_registerdefaultconfighandler.php
│ │ ├── smarty_internal_method_registerdefaultpluginhandler.php
│ │ ├── smarty_internal_method_registerdefaulttemplatehandler.php
│ │ ├── smarty_internal_method_registerfilter.php
│ │ ├── smarty_internal_method_registerobject.php
│ │ ├── smarty_internal_method_registerplugin.php
│ │ ├── smarty_internal_method_registerresource.php
│ │ ├── smarty_internal_method_setautoloadfilters.php
│ │ ├── smarty_internal_method_setdebugtemplate.php
│ │ ├── smarty_internal_method_setdefaultmodifiers.php
│ │ ├── smarty_internal_method_unloadfilter.php
│ │ ├── smarty_internal_method_unregistercacheresource.php
│ │ ├── smarty_internal_method_unregisterfilter.php
│ │ ├── smarty_internal_method_unregisterobject.php
│ │ ├── smarty_internal_method_unregisterplugin.php
│ │ ├── smarty_internal_method_unregisterresource.php
│ │ ├── smarty_internal_nocache_insert.php
│ │ ├── smarty_internal_parsetree.php
│ │ ├── smarty_internal_parsetree_code.php
│ │ ├── smarty_internal_parsetree_dq.php
│ │ ├── smarty_internal_parsetree_dqcontent.php
│ │ ├── smarty_internal_parsetree_tag.php
│ │ ├── smarty_internal_parsetree_template.php
│ │ ├── smarty_internal_parsetree_text.php
│ │ ├── smarty_internal_resource_eval.php
│ │ ├── smarty_internal_resource_extends.php
│ │ ├── smarty_internal_resource_file.php
│ │ ├── smarty_internal_resource_php.php
│ │ ├── smarty_internal_resource_registered.php
│ │ ├── smarty_internal_resource_stream.php
│ │ ├── smarty_internal_resource_string.php
│ │ ├── smarty_internal_runtime_cachemodify.php
│ │ ├── smarty_internal_runtime_cacheresourcefile.php
│ │ ├── smarty_internal_runtime_capture.php
│ │ ├── smarty_internal_runtime_codeframe.php
│ │ ├── smarty_internal_runtime_filterhandler.php
│ │ ├── smarty_internal_runtime_foreach.php
│ │ ├── smarty_internal_runtime_getincludepath.php
│ │ ├── smarty_internal_runtime_inheritance.php
│ │ ├── smarty_internal_runtime_make_nocache.php
│ │ ├── smarty_internal_runtime_tplfunction.php
│ │ ├── smarty_internal_runtime_updatecache.php
│ │ ├── smarty_internal_runtime_updatescope.php
│ │ ├── smarty_internal_runtime_writefile.php
│ │ ├── smarty_internal_smartytemplatecompiler.php
│ │ ├── smarty_internal_template.php
│ │ ├── smarty_internal_templatebase.php
│ │ ├── smarty_internal_templatecompilerbase.php
│ │ ├── smarty_internal_templatelexer.php
│ │ ├── smarty_internal_templateparser.php
│ │ ├── smarty_internal_testinstall.php
│ │ ├── smarty_internal_undefined.php
│ │ ├── smarty_resource.php
│ │ ├── smarty_resource_custom.php
│ │ ├── smarty_resource_recompiled.php
│ │ ├── smarty_resource_uncompiled.php
│ │ ├── smarty_security.php
│ │ ├── smarty_template_cached.php
│ │ ├── smarty_template_compiled.php
│ │ ├── smarty_template_config.php
│ │ ├── smarty_template_resource_base.php
│ │ ├── smarty_template_source.php
│ │ ├── smarty_undefined_variable.php
│ │ ├── smarty_variable.php
│ │ ├── smartycompilerexception.php
│ │ └── smartyexception.php
└── templates
│ └── default
│ ├── add.tpl
│ ├── footer.tpl
│ ├── header.tpl
│ ├── index.tpl
│ ├── nav.tpl
│ ├── raw.tpl
│ ├── tos.tpl
│ └── upload.tpl
└── templates_c
├── 397bc03ab8ab632bc6d59c03448cd672302bc6d2_0.file.index.tpl.php
├── 3e701bdc52f0cf250ffe2003261233d3492a6ec7_0.file.header.tpl.php
├── 46b7475b8057797ab58ec91236a8f45693b54983_0.file.nav.tpl.php
├── 4c206a33b9b7387ad56d075ccc4c695e47664a8a_0.file.add.tpl.php
├── c5056aef55d91fd21af7549d01b7ab74d1f331e2_0.file.raw.tpl.php
├── e748bae1fde97d414fca627451ae3dfff1145665_0.file.footer.tpl.php
├── ed0be6ec092005d0b0690fb5cfc6ccb983abcf2d_0.file.upload.tpl.php
├── f446516c6e049b53e58f929bd3ead9881e9ebea0_0.file.tos.tpl.php
└── f95a2d39b687b0e170fd4e6d5ff2a3b60db457df_0.file.view.tpl.php
/.htaccess:
--------------------------------------------------------------------------------
1 | RewriteEngine On
2 |
3 | RewriteRule ^home/?$ index.php
4 | RewriteRule ^add/?$ index.php?page=add
5 | RewriteRule ^tos/?$ index.php?page=tos
6 | RewriteRule ^upload/(.+)/raw$ index.php?page=raw&id=$1
7 | RewriteRule ^upload/(.+)$ index.php?page=upload&id=$1
8 |
9 |
10 | Order allow,deny
11 | Deny from all
12 |
--------------------------------------------------------------------------------
/Db.class.php:
--------------------------------------------------------------------------------
1 | PDO::ERRMODE_EXCEPTION,
11 | PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
12 | PDO::ATTR_EMULATE_PREPARES => false,
13 | ];
14 |
15 | function __construct()
16 | {
17 | //get config details
18 | if(!file_exists("config"))
19 | {
20 | die("config file not found.");
21 | }
22 |
23 | $config = json_decode(file_get_contents("config"));
24 |
25 | $this->host = $config->db_host;
26 | $this->db = $config->db_db;
27 | $this->user = $config->db_user;
28 | $this->pass = $config->db_pass;
29 |
30 | $this->dsn = "mysql:host=$this->host;dbname=$this->db;charset=$this->charset";
31 | $this->pdo = new PDO($this->dsn, $this->user, $this->pass, $this->options);
32 | return $this->pdo;
33 | }
34 |
35 | //this adds a new dox to the db
36 | function addDox($title, $dox, $ip)
37 | {
38 | $q = $this->pdo->prepare("insert into dox (title, dox, ip) values (?,?,?)")->execute([$title, $dox, $ip]);
39 | }
40 |
41 | //this will return dox info by its id
42 | function getDox($id)
43 | {
44 | $q = $this->pdo->prepare("select * from dox where id = ?");
45 | $q->execute([$id]);
46 | return $q->fetch(PDO::FETCH_ASSOC);
47 | }
48 |
49 | //get a list of the dox
50 | function getDoxList()
51 | {
52 | $q = $this->pdo->query("select * from dox order by id desc");
53 | return $q->fetchAll();
54 | }
55 |
56 | //increment the views
57 | function addView($id)
58 | {
59 | $q = $this->pdo->prepare("update dox set views = views+1 where (id = ?)")->execute([$id]);
60 | }
61 |
62 | //install tables
63 | function installTables()
64 | {
65 | $q = $this->pdo->exec(file_get_contents("db.sql"));
66 | }
67 | }
68 | ?>
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | ISC License
2 |
3 | Copyright (c) 2022, SleepTheGod
4 |
5 | Permission to use, copy, modify, and/or distribute this software for any
6 | purpose with or without fee is hereby granted, provided that the above
7 | copyright notice and this permission notice appear in all copies.
8 |
9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 |
--------------------------------------------------------------------------------
/README.markdown:
--------------------------------------------------------------------------------
1 | # doxbin-src
2 | Promising Doxbin source code.
3 |
4 | ## License
5 | ISC © SleepTheGod
--------------------------------------------------------------------------------
/db.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE `dox` (
2 | `id` int(11) NOT NULL,
3 | `title` varchar(50) NOT NULL,
4 | `views` int(11) NOT NULL,
5 | `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
6 | `dox` longtext NOT NULL,
7 | `ip` text NOT NULL
8 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
9 |
10 | ALTER TABLE `dox` ADD PRIMARY KEY (`id`);
11 | ALTER TABLE `dox` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
12 | ALTER TABLE `dox` CHANGE `views` `views` INT(11) NOT NULL DEFAULT '0';
--------------------------------------------------------------------------------
/images/favicons/android-icon-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/I2rys/doxbin-src/9c23eea427827069e707011848b2d9e44a042e72/images/favicons/android-icon-192x192.png
--------------------------------------------------------------------------------
/images/favicons/apple-icon-114x114.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/I2rys/doxbin-src/9c23eea427827069e707011848b2d9e44a042e72/images/favicons/apple-icon-114x114.png
--------------------------------------------------------------------------------
/images/favicons/apple-icon-120x120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/I2rys/doxbin-src/9c23eea427827069e707011848b2d9e44a042e72/images/favicons/apple-icon-120x120.png
--------------------------------------------------------------------------------
/images/favicons/apple-icon-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/I2rys/doxbin-src/9c23eea427827069e707011848b2d9e44a042e72/images/favicons/apple-icon-144x144.png
--------------------------------------------------------------------------------
/images/favicons/apple-icon-152x152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/I2rys/doxbin-src/9c23eea427827069e707011848b2d9e44a042e72/images/favicons/apple-icon-152x152.png
--------------------------------------------------------------------------------
/images/favicons/apple-icon-180x180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/I2rys/doxbin-src/9c23eea427827069e707011848b2d9e44a042e72/images/favicons/apple-icon-180x180.png
--------------------------------------------------------------------------------
/images/favicons/apple-icon-57x57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/I2rys/doxbin-src/9c23eea427827069e707011848b2d9e44a042e72/images/favicons/apple-icon-57x57.png
--------------------------------------------------------------------------------
/images/favicons/apple-icon-60x60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/I2rys/doxbin-src/9c23eea427827069e707011848b2d9e44a042e72/images/favicons/apple-icon-60x60.png
--------------------------------------------------------------------------------
/images/favicons/apple-icon-72x72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/I2rys/doxbin-src/9c23eea427827069e707011848b2d9e44a042e72/images/favicons/apple-icon-72x72.png
--------------------------------------------------------------------------------
/images/favicons/apple-icon-76x76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/I2rys/doxbin-src/9c23eea427827069e707011848b2d9e44a042e72/images/favicons/apple-icon-76x76.png
--------------------------------------------------------------------------------
/images/favicons/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/I2rys/doxbin-src/9c23eea427827069e707011848b2d9e44a042e72/images/favicons/favicon-16x16.png
--------------------------------------------------------------------------------
/images/favicons/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/I2rys/doxbin-src/9c23eea427827069e707011848b2d9e44a042e72/images/favicons/favicon-32x32.png
--------------------------------------------------------------------------------
/images/favicons/favicon-96x96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/I2rys/doxbin-src/9c23eea427827069e707011848b2d9e44a042e72/images/favicons/favicon-96x96.png
--------------------------------------------------------------------------------
/install.php:
--------------------------------------------------------------------------------
1 | config in this directory.");
11 | }
12 | fclose($fh);
13 |
14 | die("config file not found.
creating config file
file created
Try the install again");
15 | }
16 |
17 | //check file perms
18 | if(!is_writable($config_file))
19 | {
20 | die("please change permissions of config file to ");
21 | }
22 |
23 | if($_POST)
24 | {
25 | $fh = fopen($config_file, "w");
26 |
27 | fwrite($fh, json_encode([
28 | "db_host" => $_POST['db_host'],
29 | "db_user" => $_POST['db_user'],
30 | "db_pass" => $_POST['db_pass'],
31 | "db_db" => $_POST['db_db'],
32 | "cap_sec_key" => $_POST['cap_sec_key'],
33 | "cap_site_key" => $_POST['cap_site_key']
34 | ]));
35 |
36 | fclose($fh);
37 |
38 | include("Db.class.php");
39 | $db = new Db();
40 | $db->installTables();
41 |
42 | die("config file created. please delete this file (install.php).");
43 | }
44 | ?>
45 |
46 |
71 |
72 |
--------------------------------------------------------------------------------
/legacy/bin.js:
--------------------------------------------------------------------------------
1 | $("#submitBtn").click(function(e)
2 | {
3 | e.preventDefault();
4 |
5 | $.post("index.php?page=submit", $("#frmSubmit").serialize(), function(data)
6 | {
7 | document.location.replace('index.php');
8 | return false;
9 | });
10 | });
--------------------------------------------------------------------------------
/legacy/google-code-prettify/tomorrow-night.css:
--------------------------------------------------------------------------------
1 | /* Tomorrow Night Theme */
2 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */
3 | .prettyprint {
4 | background: #1d1f21;
5 | font-family: Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Consolas, monospace;
6 | font-size: 12px;
7 | line-height: 1.5;
8 | border: 1px solid #ccc;
9 | padding: 10px;
10 | }
11 |
12 | .pln {
13 | color: #c5c8c6;
14 | }
15 |
16 | @media screen {
17 | .str {
18 | color: #b5bd68;
19 | }
20 |
21 | .kwd {
22 | color: #b294bb;
23 | }
24 |
25 | .com {
26 | color: #969896;
27 | }
28 |
29 | .typ {
30 | color: #81a2be;
31 | }
32 |
33 | .lit {
34 | color: #de935f;
35 | }
36 |
37 | .pun {
38 | color: #c5c8c6;
39 | }
40 |
41 | .opn {
42 | color: #c5c8c6;
43 | }
44 |
45 | .clo {
46 | color: #c5c8c6;
47 | }
48 |
49 | .tag {
50 | color: #cc6666;
51 | }
52 |
53 | .atn {
54 | color: #de935f;
55 | }
56 |
57 | .atv {
58 | color: #8abeb7;
59 | }
60 |
61 | .dec {
62 | color: #de935f;
63 | }
64 |
65 | .var {
66 | color: #cc6666;
67 | }
68 |
69 | .fun {
70 | color: #81a2be;
71 | }
72 | }
73 | @media print, projection {
74 | .str {
75 | color: #006600;
76 | }
77 |
78 | .kwd {
79 | color: #006;
80 | font-weight: bold;
81 | }
82 |
83 | .com {
84 | color: #600;
85 | font-style: italic;
86 | }
87 |
88 | .typ {
89 | color: #404;
90 | font-weight: bold;
91 | }
92 |
93 | .lit {
94 | color: #004444;
95 | }
96 |
97 | .pun, .opn, .clo {
98 | color: #444400;
99 | }
100 |
101 | .tag {
102 | color: #006;
103 | font-weight: bold;
104 | }
105 |
106 | .atn {
107 | color: #440044;
108 | }
109 |
110 | .atv {
111 | color: #006600;
112 | }
113 | }
114 | /* Specify class=linenums on a pre to get line numbering */
115 | ol.linenums {
116 | margin-top: 0;
117 | margin-bottom: 0;
118 | }
119 |
120 | /* IE indents via margin-left */
121 | li.L0,
122 | li.L1,
123 | li.L2,
124 | li.L3,
125 | li.L4,
126 | li.L5,
127 | li.L6,
128 | li.L7,
129 | li.L8,
130 | li.L9 {
131 | /* */
132 | }
133 |
134 | /* Alternate shading for lines */
135 | li.L1,
136 | li.L3,
137 | li.L5,
138 | li.L7,
139 | li.L9 {
140 | /* */
141 | }
--------------------------------------------------------------------------------
/legacy/tos.css:
--------------------------------------------------------------------------------
1 | body {
2 | color: white;
3 | background: black;
4 | }
5 |
6 | p {
7 | margin: 0px 15px 0px 15px;
8 | }
--------------------------------------------------------------------------------
/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Doxbin",
3 | "icons": [
4 | {
5 | "src": "\/images\/favicons\/android-icon-36x36.png",
6 | "sizes": "36x36",
7 | "type": "image\/png",
8 | "density": "0.75"
9 | },
10 | {
11 | "src": "\/images\/favicons\/android-icon-48x48.png",
12 | "sizes": "48x48",
13 | "type": "image\/png",
14 | "density": "1.0"
15 | },
16 | {
17 | "src": "\/images\/favicons\/android-icon-72x72.png",
18 | "sizes": "72x72",
19 | "type": "image\/png",
20 | "density": "1.5"
21 | },
22 | {
23 | "src": "\/images\/favicons\/android-icon-96x96.png",
24 | "sizes": "96x96",
25 | "type": "image\/png",
26 | "density": "2.0"
27 | },
28 | {
29 | "src": "\/images\/favicons\/android-icon-144x144.png",
30 | "sizes": "144x144",
31 | "type": "image\/png",
32 | "density": "3.0"
33 | },
34 | {
35 | "src": "\/images\/favicons\/android-icon-192x192.png",
36 | "sizes": "192x192",
37 | "type": "image\/png",
38 | "density": "4.0"
39 | }
40 | ]
41 | }
--------------------------------------------------------------------------------
/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow:
3 |
--------------------------------------------------------------------------------
/smarty/COMPOSER_RELEASE_NOTES.txt:
--------------------------------------------------------------------------------
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 |
30 | If you are using (include) the composer generated autoloader.php which is located
31 | in the /vendor folder it is no longer needed to require the Smarty.class.php file.
--------------------------------------------------------------------------------
/smarty/README.md:
--------------------------------------------------------------------------------
1 | # Smarty 3 template engine
2 | [smarty.net](https://www.smarty.net/)
3 |
4 | ## Documentation
5 |
6 | For documentation see
7 | [www.smarty.net/docs/en/](https://www.smarty.net/docs/en/)
8 |
9 | ## Distribution repository
10 |
11 | > Smarty 3.1.28 introduces run time template inheritance
12 |
13 | > Read the NEW_FEATURES and INHERITANCE_RELEASE_NOTES file for recent extensions to Smarty 3.1 functionality
14 |
15 | Smarty versions 3.1.11 or later are now on github and can be installed with Composer.
16 |
17 |
18 | The "smarty/smarty" package will start at libs/.... subfolder.
19 |
20 | To get the latest stable version of Smarty 3.1 use:
21 |
22 | ```json
23 | "require": {
24 | "smarty/smarty": "~3.1"
25 | }
26 | ```
27 |
28 | in your composer.json file.
29 |
30 | To get the trunk version use:
31 |
32 | ```json
33 | "require": {
34 | "smarty/smarty": "~3.1@dev"
35 | }
36 | ```
37 |
38 | For a specific version use something like:
39 |
40 | ```json
41 | "require": {
42 | "smarty/smarty": "3.1.19"
43 | }
44 | ```
45 |
46 | PHPUnit test can be installed by corresponding composer entries like:
47 |
48 | ```json
49 | "require": {
50 | "smarty/smarty-phpunit": "3.1.19"
51 | }
52 | ```
53 |
54 | Similar applies for the lexer/parser generator.
55 |
56 | ```json
57 | "require": {
58 | "smarty/smarty-lexer": "3.1.19"
59 | }
60 | ```
61 |
62 | Or you could use:
63 |
64 | ```json
65 | "require": {
66 | "smarty/smarty-dev": "3.1.19"
67 | }
68 | ```
69 |
70 | Which is a wrapper to install all 3 packages.
71 |
72 | Composer can also be used for Smarty2 versions 2.6.24 to 2.6.30.
73 |
--------------------------------------------------------------------------------
/smarty/SMARTY_3.0_BC_NOTES.txt:
--------------------------------------------------------------------------------
1 | == Smarty2 backward compatibility ==
2 | All Smarty2 specific API functions and deprecated functionality has been moved
3 | to the SmartyBC class.
4 |
5 | == {php} Tag ==
6 | The {php} tag is no longer available in the standard Smarty calls.
7 | The use of {php} tags is deprecated and only available in the SmartyBC class.
8 |
9 | == {include_php} Tag ==
10 | The {include_php} tag is no longer available in the standard Smarty calls.
11 | The use of {include_php} tags is deprecated and only available in the SmartyBC class.
12 |
13 | == php template resource ==
14 | The support of the php template resource is removed.
15 |
16 | == $cache_dir, $compile_dir, $config_dir, $template_dir access ==
17 | The mentioned properties can't be accessed directly any longer. You must use
18 | corresponding getter/setters like addConfigDir(), setConfigDir(), getConfigDir()
19 |
20 | == obsolete Smarty class properties ==
21 | The following no longer used properties are removed:
22 | $allow_php_tag
23 | $allow_php_template
24 | $deprecation_notices
--------------------------------------------------------------------------------
/smarty/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "smarty/smarty",
3 | "type": "library",
4 | "description": "Smarty - the compiling PHP template engine",
5 | "keywords": [
6 | "templating"
7 | ],
8 | "homepage": "http://www.smarty.net",
9 | "license": "LGPL-3.0",
10 | "authors": [
11 | {
12 | "name": "Monte Ohrt",
13 | "email": "monte@ohrt.com"
14 | },
15 | {
16 | "name": "Uwe Tews",
17 | "email": "uwe.tews@googlemail.com"
18 | },
19 | {
20 | "name": "Rodney Rehm",
21 | "email": "rodney.rehm@medialize.de"
22 | }
23 | ],
24 | "support": {
25 | "irc": "irc://irc.freenode.org/smarty",
26 | "issues": "https://github.com/smarty-php/smarty/issues",
27 | "forum": "http://www.smarty.net/forums/"
28 | },
29 | "require": {
30 | "php": ">=5.2"
31 | },
32 | "autoload": {
33 | "classmap": [
34 | "libs/"
35 | ]
36 | },
37 | "extra": {
38 | "branch-alias": {
39 | "dev-master": "3.1.x-dev"
40 | }
41 | },
42 | "require-dev": {
43 | "smarty/smarty-dev": "~3.1@dev"
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/smarty/error_reporting.ini:
--------------------------------------------------------------------------------
1 | error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
--------------------------------------------------------------------------------
/smarty/libs/bootstrap.php:
--------------------------------------------------------------------------------
1 |
6 | *
7 | * For the full copyright and license information, please view the LICENSE
8 | * file that was distributed with this source code.
9 | */
10 | /**
11 | * Load and register Smarty Autoloader
12 | */
13 | if (!class_exists('Smarty_Autoloader')) {
14 | include dirname(__FILE__) . '/Autoloader.php';
15 | }
16 | Smarty_Autoloader::register(true);
17 |
--------------------------------------------------------------------------------
/smarty/libs/plugins/function.counter.php:
--------------------------------------------------------------------------------
1 |
15 | * @link http://www.smarty.net/manual/en/language.function.counter.php {counter}
16 | * (Smarty online manual)
17 | *
18 | * @param array $params parameters
19 | * @param Smarty_Internal_Template $template template object
20 | *
21 | * @return string|null
22 | */
23 | function smarty_function_counter($params, $template)
24 | {
25 | static $counters = array();
26 | $name = (isset($params[ 'name' ])) ? $params[ 'name' ] : 'default';
27 | if (!isset($counters[ $name ])) {
28 | $counters[ $name ] = array('start' => 1, 'skip' => 1, 'direction' => 'up', 'count' => 1);
29 | }
30 | $counter =& $counters[ $name ];
31 | if (isset($params[ 'start' ])) {
32 | $counter[ 'start' ] = $counter[ 'count' ] = (int)$params[ 'start' ];
33 | }
34 | if (!empty($params[ 'assign' ])) {
35 | $counter[ 'assign' ] = $params[ 'assign' ];
36 | }
37 | if (isset($counter[ 'assign' ])) {
38 | $template->assign($counter[ 'assign' ], $counter[ 'count' ]);
39 | }
40 | if (isset($params[ 'print' ])) {
41 | $print = (bool)$params[ 'print' ];
42 | } else {
43 | $print = empty($counter[ 'assign' ]);
44 | }
45 | if ($print) {
46 | $retval = $counter[ 'count' ];
47 | } else {
48 | $retval = null;
49 | }
50 | if (isset($params[ 'skip' ])) {
51 | $counter[ 'skip' ] = $params[ 'skip' ];
52 | }
53 | if (isset($params[ 'direction' ])) {
54 | $counter[ 'direction' ] = $params[ 'direction' ];
55 | }
56 | if ($counter[ 'direction' ] === 'down') {
57 | $counter[ 'count' ] -= $counter[ 'skip' ];
58 | } else {
59 | $counter[ 'count' ] += $counter[ 'skip' ];
60 | }
61 | return $retval;
62 | }
63 |
--------------------------------------------------------------------------------
/smarty/libs/plugins/modifier.date_format.php:
--------------------------------------------------------------------------------
1 |
20 | *
21 | * @param string $string input date string
22 | * @param string $format strftime format for output
23 | * @param string $default_date default date if $string is empty
24 | * @param string $formatter either 'strftime' or 'auto'
25 | *
26 | * @return string |void
27 | * @uses smarty_make_timestamp()
28 | */
29 | function smarty_modifier_date_format($string, $format = null, $default_date = '', $formatter = 'auto')
30 | {
31 | if ($format === null) {
32 | $format = Smarty::$_DATE_FORMAT;
33 | }
34 | /**
35 | * require_once the {@link shared.make_timestamp.php} plugin
36 | */
37 | static $is_loaded = false;
38 | if (!$is_loaded) {
39 | if (!is_callable('smarty_make_timestamp')) {
40 | include_once SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php';
41 | }
42 | $is_loaded = true;
43 | }
44 | if (!empty($string) && $string !== '0000-00-00' && $string !== '0000-00-00 00:00:00') {
45 | $timestamp = smarty_make_timestamp($string);
46 | } elseif (!empty($default_date)) {
47 | $timestamp = smarty_make_timestamp($default_date);
48 | } else {
49 | return;
50 | }
51 | if ($formatter === 'strftime' || ($formatter === 'auto' && strpos($format, '%') !== false)) {
52 | if (Smarty::$_IS_WINDOWS) {
53 | $_win_from = array(
54 | '%D',
55 | '%h',
56 | '%n',
57 | '%r',
58 | '%R',
59 | '%t',
60 | '%T'
61 | );
62 | $_win_to = array(
63 | '%m/%d/%y',
64 | '%b',
65 | "\n",
66 | '%I:%M:%S %p',
67 | '%H:%M',
68 | "\t",
69 | '%H:%M:%S'
70 | );
71 | if (strpos($format, '%e') !== false) {
72 | $_win_from[] = '%e';
73 | $_win_to[] = sprintf('%\' 2d', date('j', $timestamp));
74 | }
75 | if (strpos($format, '%l') !== false) {
76 | $_win_from[] = '%l';
77 | $_win_to[] = sprintf('%\' 2d', date('h', $timestamp));
78 | }
79 | $format = str_replace($_win_from, $_win_to, $format);
80 | }
81 | return strftime($format, $timestamp);
82 | } else {
83 | return date($format, $timestamp);
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/smarty/libs/plugins/modifier.mb_wordwrap.php:
--------------------------------------------------------------------------------
1 | $width) {
36 | if ($cut) {
37 | $_tokens = preg_split(
38 | '!(.{' . $width . '})!S' . Smarty::$_UTF8_MODIFIER,
39 | $_token,
40 | -1,
41 | PREG_SPLIT_NO_EMPTY + PREG_SPLIT_DELIM_CAPTURE
42 | );
43 | }
44 | }
45 | foreach ($_tokens as $token) {
46 | $_space = !!preg_match('!^\s$!S' . Smarty::$_UTF8_MODIFIER, $token);
47 | $token_length = mb_strlen($token, Smarty::$_CHARSET);
48 | $length += $token_length;
49 | if ($length > $width) {
50 | // remove space before inserted break
51 | if ($_previous) {
52 | $t = mb_substr($t, 0, -1, Smarty::$_CHARSET);
53 | }
54 | if (!$_space) {
55 | // add the break before the token
56 | if (!empty($t)) {
57 | $t .= $break;
58 | }
59 | $length = $token_length;
60 | }
61 | } elseif ($token === "\n") {
62 | // hard break must reset counters
63 | $length = 0;
64 | }
65 | $_previous = $_space;
66 | // add the token
67 | $t .= $token;
68 | }
69 | }
70 | return $t;
71 | }
72 |
--------------------------------------------------------------------------------
/smarty/libs/plugins/modifier.regex_replace.php:
--------------------------------------------------------------------------------
1 |
17 | *
18 | * @param string $string input string
19 | * @param string|array $search regular expression(s) to search for
20 | * @param string|array $replace string(s) that should be replaced
21 | * @param int $limit the maximum number of replacements
22 | *
23 | * @return string
24 | */
25 | function smarty_modifier_regex_replace($string, $search, $replace, $limit = -1)
26 | {
27 | if (is_array($search)) {
28 | foreach ($search as $idx => $s) {
29 | $search[ $idx ] = _smarty_regex_replace_check($s);
30 | }
31 | } else {
32 | $search = _smarty_regex_replace_check($search);
33 | }
34 | return preg_replace($search, $replace, $string, $limit);
35 | }
36 |
37 | /**
38 | * @param string $search string(s) that should be replaced
39 | *
40 | * @return string
41 | * @ignore
42 | */
43 | function _smarty_regex_replace_check($search)
44 | {
45 | // null-byte injection detection
46 | // anything behind the first null-byte is ignored
47 | if (($pos = strpos($search, "\0")) !== false) {
48 | $search = substr($search, 0, $pos);
49 | }
50 | // remove eval-modifier from $search
51 | if (preg_match('!([a-zA-Z\s]+)$!s', $search, $match) && (strpos($match[ 1 ], 'e') !== false)) {
52 | $search = substr($search, 0, -strlen($match[ 1 ])) . preg_replace('![e\s]+!', '', $match[ 1 ]);
53 | }
54 | return $search;
55 | }
56 |
--------------------------------------------------------------------------------
/smarty/libs/plugins/modifier.replace.php:
--------------------------------------------------------------------------------
1 |
16 | * @author Uwe Tews
17 | *
18 | * @param string $string input string
19 | * @param string $search text to search for
20 | * @param string $replace replacement text
21 | *
22 | * @return string
23 | */
24 | function smarty_modifier_replace($string, $search, $replace)
25 | {
26 | static $is_loaded = false;
27 | if (Smarty::$_MBSTRING) {
28 | if (!$is_loaded) {
29 | if (!is_callable('smarty_mb_str_replace')) {
30 | include_once SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php';
31 | }
32 | $is_loaded = true;
33 | }
34 | return smarty_mb_str_replace($search, $replace, $string);
35 | }
36 | return str_replace($search, $replace, $string);
37 | }
38 |
--------------------------------------------------------------------------------
/smarty/libs/plugins/modifier.spacify.php:
--------------------------------------------------------------------------------
1 |
16 | *
17 | * @param string $string input string
18 | * @param string $spacify_char string to insert between characters.
19 | *
20 | * @return string
21 | */
22 | function smarty_modifier_spacify($string, $spacify_char = ' ')
23 | {
24 | // well… what about charsets besides latin and UTF-8?
25 | return implode($spacify_char, preg_split('//' . Smarty::$_UTF8_MODIFIER, $string, -1, PREG_SPLIT_NO_EMPTY));
26 | }
27 |
--------------------------------------------------------------------------------
/smarty/libs/plugins/modifier.truncate.php:
--------------------------------------------------------------------------------
1 |
18 | *
19 | * @param string $string input string
20 | * @param integer $length length of truncated text
21 | * @param string $etc end string
22 | * @param boolean $break_words truncate at word boundary
23 | * @param boolean $middle truncate in the middle of text
24 | *
25 | * @return string truncated string
26 | */
27 | function smarty_modifier_truncate($string, $length = 80, $etc = '...', $break_words = false, $middle = false)
28 | {
29 | if ($length === 0) {
30 | return '';
31 | }
32 | if (Smarty::$_MBSTRING) {
33 | if (mb_strlen($string, Smarty::$_CHARSET) > $length) {
34 | $length -= min($length, mb_strlen($etc, Smarty::$_CHARSET));
35 | if (!$break_words && !$middle) {
36 | $string = preg_replace(
37 | '/\s+?(\S+)?$/' . Smarty::$_UTF8_MODIFIER,
38 | '',
39 | mb_substr($string, 0, $length + 1, Smarty::$_CHARSET)
40 | );
41 | }
42 | if (!$middle) {
43 | return mb_substr($string, 0, $length, Smarty::$_CHARSET) . $etc;
44 | }
45 | return mb_substr($string, 0, $length / 2, Smarty::$_CHARSET) . $etc .
46 | mb_substr($string, -$length / 2, $length, Smarty::$_CHARSET);
47 | }
48 | return $string;
49 | }
50 | // no MBString fallback
51 | if (isset($string[ $length ])) {
52 | $length -= min($length, strlen($etc));
53 | if (!$break_words && !$middle) {
54 | $string = preg_replace('/\s+?(\S+)?$/', '', substr($string, 0, $length + 1));
55 | }
56 | if (!$middle) {
57 | return substr($string, 0, $length) . $etc;
58 | }
59 | return substr($string, 0, $length / 2) . $etc . substr($string, -$length / 2);
60 | }
61 | return $string;
62 | }
63 |
--------------------------------------------------------------------------------
/smarty/libs/plugins/modifiercompiler.cat.php:
--------------------------------------------------------------------------------
1 |
16 | * @author Uwe Tews
17 | *
18 | * @param array $params parameters
19 | *
20 | * @return string with compiled code
21 | */
22 | function smarty_modifiercompiler_lower($params)
23 | {
24 | if (Smarty::$_MBSTRING) {
25 | return 'mb_strtolower(' . $params[ 0 ] . ', \'' . addslashes(Smarty::$_CHARSET) . '\')';
26 | }
27 | // no MBString fallback
28 | return 'strtolower(' . $params[ 0 ] . ')';
29 | }
30 |
--------------------------------------------------------------------------------
/smarty/libs/plugins/modifiercompiler.noprint.php:
--------------------------------------------------------------------------------
1 | ]*?>!', ' ', {$params[0]})";
25 | } else {
26 | return 'strip_tags(' . $params[ 0 ] . ')';
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/smarty/libs/plugins/modifiercompiler.to_charset.php:
--------------------------------------------------------------------------------
1 | getPlugin('mb_wordwrap', 'modifier');
37 | }
38 | return $function . '(' . $params[ 0 ] . ',' . $params[ 1 ] . ',' . $params[ 2 ] . ',' . $params[ 3 ] . ')';
39 | }
40 |
--------------------------------------------------------------------------------
/smarty/libs/plugins/shared.escape_special_chars.php:
--------------------------------------------------------------------------------
1 |
15 | *
16 | * @param string $string text that should by escaped
17 | *
18 | * @return string
19 | */
20 | function smarty_function_escape_special_chars($string)
21 | {
22 | if (!is_array($string)) {
23 | if (version_compare(PHP_VERSION, '5.2.3', '>=')) {
24 | $string = htmlspecialchars($string, ENT_COMPAT, Smarty::$_CHARSET, false);
25 | } else {
26 | $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string);
27 | $string = htmlspecialchars($string);
28 | $string = str_replace(array('%%%SMARTY_START%%%', '%%%SMARTY_END%%%'), array('&', ';'), $string);
29 | }
30 | }
31 | return $string;
32 | }
33 |
--------------------------------------------------------------------------------
/smarty/libs/plugins/shared.literal_compiler_param.php:
--------------------------------------------------------------------------------
1 |
13 | *
14 | * @param DateTime|int|string $string date object, timestamp or string that can be converted using strtotime()
15 | *
16 | * @return int
17 | */
18 | function smarty_make_timestamp($string)
19 | {
20 | if (empty($string)) {
21 | // use "now":
22 | return time();
23 | } elseif ($string instanceof DateTime
24 | || (interface_exists('DateTimeInterface', false) && $string instanceof DateTimeInterface)
25 | ) {
26 | return (int)$string->format('U'); // PHP 5.2 BC
27 | } elseif (strlen($string) === 14 && ctype_digit($string)) {
28 | // it is mysql timestamp format of YYYYMMDDHHMMSS?
29 | return mktime(
30 | substr($string, 8, 2),
31 | substr($string, 10, 2),
32 | substr($string, 12, 2),
33 | substr($string, 4, 2),
34 | substr($string, 6, 2),
35 | substr($string, 0, 4)
36 | );
37 | } elseif (is_numeric($string)) {
38 | // it is a numeric string, we handle it as timestamp
39 | return (int)$string;
40 | } else {
41 | // strtotime should handle it
42 | $time = strtotime($string);
43 | if ($time === -1 || $time === false) {
44 | // strtotime() was not able to parse $string, use "now":
45 | return time();
46 | }
47 | return $time;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/smarty/libs/plugins/shared.mb_str_replace.php:
--------------------------------------------------------------------------------
1 | dataObjectName = 'Data_object ' . (isset($name) ? "'{$name}'" : self::$count);
55 | $this->smarty = $smarty;
56 | if (is_object($_parent)) {
57 | // when object set up back pointer
58 | $this->parent = $_parent;
59 | } elseif (is_array($_parent)) {
60 | // set up variable values
61 | foreach ($_parent as $_key => $_val) {
62 | $this->tpl_vars[ $_key ] = new Smarty_Variable($_val);
63 | }
64 | } elseif ($_parent !== null) {
65 | throw new SmartyException('Wrong type for template variables');
66 | }
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_block.php:
--------------------------------------------------------------------------------
1 | name = $name;
79 | $this->tplIndex = $tplIndex;
80 | }
81 |
82 | /**
83 | * Compiled block code overloaded by {block} class
84 | *
85 | * @param \Smarty_Internal_Template $tpl
86 | */
87 | public function callBlock(Smarty_Internal_Template $tpl)
88 | {
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_compile_append.php:
--------------------------------------------------------------------------------
1 | required_attributes = array('var', 'value');
33 | $this->shorttag_order = array('var', 'value');
34 | $this->optional_attributes = array('scope', 'index');
35 | $this->mapCache = array();
36 | // check and get attributes
37 | $_attr = $this->getAttributes($compiler, $args);
38 | // map to compile assign attributes
39 | if (isset($_attr[ 'index' ])) {
40 | $_params[ 'smarty_internal_index' ] = '[' . $_attr[ 'index' ] . ']';
41 | unset($_attr[ 'index' ]);
42 | } else {
43 | $_params[ 'smarty_internal_index' ] = '[]';
44 | }
45 | $_new_attr = array();
46 | foreach ($_attr as $key => $value) {
47 | $_new_attr[] = array($key => $value);
48 | }
49 | // call compile assign
50 | return parent::compile($_new_attr, $compiler, $_params);
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_compile_block_child.php:
--------------------------------------------------------------------------------
1 |
15 | */
16 | class Smarty_Internal_Compile_Block_Child extends Smarty_Internal_Compile_Child
17 | {
18 | /**
19 | * Tag name
20 | *
21 | * @var string
22 | */
23 | public $tag = 'block_child';
24 | }
25 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_compile_block_parent.php:
--------------------------------------------------------------------------------
1 |
15 | */
16 | class Smarty_Internal_Compile_Block_Parent extends Smarty_Internal_Compile_Child
17 | {
18 | /**
19 | * Tag name
20 | *
21 | * @var string
22 | */
23 | public $tag = 'block_parent';
24 |
25 | /**
26 | * Block type
27 | *
28 | * @var string
29 | */
30 | public $blockType = 'Parent';
31 | }
32 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_compile_call.php:
--------------------------------------------------------------------------------
1 | getAttributes($compiler, $args);
55 | // save possible attributes
56 | if (isset($_attr[ 'assign' ])) {
57 | // output will be stored in a smarty variable instead of being displayed
58 | $_assign = $_attr[ 'assign' ];
59 | }
60 | //$_name = trim($_attr['name'], "''");
61 | $_name = $_attr[ 'name' ];
62 | unset($_attr[ 'name' ], $_attr[ 'assign' ], $_attr[ 'nocache' ]);
63 | // set flag (compiled code of {function} must be included in cache file
64 | if (!$compiler->template->caching || $compiler->nocache || $compiler->tag_nocache) {
65 | $_nocache = 'true';
66 | } else {
67 | $_nocache = 'false';
68 | }
69 | $_paramsArray = array();
70 | foreach ($_attr as $_key => $_value) {
71 | if (is_int($_key)) {
72 | $_paramsArray[] = "$_key=>$_value";
73 | } else {
74 | $_paramsArray[] = "'$_key'=>$_value";
75 | }
76 | }
77 | $_params = 'array(' . implode(',', $_paramsArray) . ')';
78 | //$compiler->suppressNocacheProcessing = true;
79 | // was there an assign attribute
80 | if (isset($_assign)) {
81 | $_output =
82 | "smarty->ext->_tplFunction->callTemplateFunction(\$_smarty_tpl, {$_name}, {$_params}, {$_nocache});\n\$_smarty_tpl->assign({$_assign}, ob_get_clean());?>\n";
83 | } else {
84 | $_output =
85 | "smarty->ext->_tplFunction->callTemplateFunction(\$_smarty_tpl, {$_name}, {$_params}, {$_nocache});?>\n";
86 | }
87 | return $_output;
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_compile_child.php:
--------------------------------------------------------------------------------
1 |
15 | */
16 | class Smarty_Internal_Compile_Child extends Smarty_Internal_CompileBase
17 | {
18 | /**
19 | * Attribute definition: Overwrites base class.
20 | *
21 | * @var array
22 | * @see Smarty_Internal_CompileBase
23 | */
24 | public $optional_attributes = array('assign');
25 |
26 | /**
27 | * Tag name
28 | *
29 | * @var string
30 | */
31 | public $tag = 'child';
32 |
33 | /**
34 | * Block type
35 | *
36 | * @var string
37 | */
38 | public $blockType = 'Child';
39 |
40 | /**
41 | * Compiles code for the {child} tag
42 | *
43 | * @param array $args array with attributes from parser
44 | * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
45 | * @param array $parameter array with compilation parameter
46 | *
47 | * @return string compiled code
48 | * @throws \SmartyCompilerException
49 | */
50 | public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)
51 | {
52 | // check and get attributes
53 | $_attr = $this->getAttributes($compiler, $args);
54 | $tag = isset($parameter[ 0 ]) ? "'{$parameter[0]}'" : "'{{$this->tag}}'";
55 | if (!isset($compiler->_cache[ 'blockNesting' ])) {
56 | $compiler->trigger_template_error(
57 | "{$tag} used outside {block} tags ",
58 | $compiler->parser->lex->taglineno
59 | );
60 | }
61 | $compiler->has_code = true;
62 | $compiler->suppressNocacheProcessing = true;
63 | if ($this->blockType === 'Child') {
64 | $compiler->_cache[ 'blockParams' ][ $compiler->_cache[ 'blockNesting' ] ][ 'callsChild' ] = 'true';
65 | }
66 | $_assign = isset($_attr[ 'assign' ]) ? $_attr[ 'assign' ] : null;
67 | $output = "inheritance->call' . $this->blockType . '($_smarty_tpl, $this' .
72 | ($this->blockType === 'Child' ? '' : ", {$tag}") . ");\n";
73 | if (isset($_assign)) {
74 | $output .= "\$_smarty_tpl->assign({$_assign}, ob_get_clean());\n";
75 | }
76 | $output .= "?>\n";
77 | return $output;
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_compile_config_load.php:
--------------------------------------------------------------------------------
1 | Smarty::SCOPE_LOCAL, 'parent' => Smarty::SCOPE_PARENT,
58 | 'root' => Smarty::SCOPE_ROOT, 'tpl_root' => Smarty::SCOPE_TPL_ROOT,
59 | 'smarty' => Smarty::SCOPE_SMARTY, 'global' => Smarty::SCOPE_SMARTY
60 | );
61 |
62 | /**
63 | * Compiles code for the {config_load} tag
64 | *
65 | * @param array $args array with attributes from parser
66 | * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
67 | *
68 | * @return string compiled code
69 | * @throws \SmartyCompilerException
70 | */
71 | public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
72 | {
73 | // check and get attributes
74 | $_attr = $this->getAttributes($compiler, $args);
75 | if ($_attr[ 'nocache' ] === true) {
76 | $compiler->trigger_template_error('nocache option not allowed', null, true);
77 | }
78 | // save possible attributes
79 | $conf_file = $_attr[ 'file' ];
80 | if (isset($_attr[ 'section' ])) {
81 | $section = $_attr[ 'section' ];
82 | } else {
83 | $section = 'null';
84 | }
85 | // scope setup
86 | if ($_attr[ 'noscope' ]) {
87 | $_scope = -1;
88 | } else {
89 | $_scope = $compiler->convertScope($_attr, $this->valid_scopes);
90 | }
91 | // create config object
92 | $_output =
93 | "smarty->ext->configLoad->_loadConfigFile(\$_smarty_tpl, {$conf_file}, {$section}, {$_scope});\n?>\n";
94 | return $_output;
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_compile_continue.php:
--------------------------------------------------------------------------------
1 | getAttributes($compiler, $args);
32 | // compile always as nocache
33 | $compiler->tag_nocache = true;
34 | // display debug template
35 | $_output =
36 | "display_debug(\$_smarty_tpl);\n";
37 | $_output .= "unset(\$_smarty_debug);\n?>";
38 | return $_output;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_compile_eval.php:
--------------------------------------------------------------------------------
1 | getAttributes($compiler, $args);
55 | if (isset($_attr[ 'assign' ])) {
56 | // output will be stored in a smarty variable instead of being displayed
57 | $_assign = $_attr[ 'assign' ];
58 | }
59 | // create template object
60 | $_output =
61 | "\$_template = new {$compiler->smarty->template_class}('eval:'.{$_attr[ 'var' ]}, \$_smarty_tpl->smarty, \$_smarty_tpl);";
62 | //was there an assign attribute?
63 | if (isset($_assign)) {
64 | $_output .= "\$_smarty_tpl->assign($_assign,\$_template->fetch());";
65 | } else {
66 | $_output .= 'echo $_template->fetch();';
67 | }
68 | return "";
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_compile_ldelim.php:
--------------------------------------------------------------------------------
1 | getAttributes($compiler, $args);
32 | if ($_attr[ 'nocache' ] === true) {
33 | $compiler->trigger_template_error('nocache option not allowed', null, true);
34 | }
35 | return $compiler->smarty->left_delimiter;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_compile_make_nocache.php:
--------------------------------------------------------------------------------
1 | getAttributes($compiler, $args);
53 | if ($compiler->template->caching) {
54 | $output = "smarty->ext->_make_nocache->save(\$_smarty_tpl, {$_attr[ 'var' ]});\n?>\n";
55 | $compiler->template->compiled->has_nocache_code = true;
56 | $compiler->suppressNocacheProcessing = true;
57 | return $output;
58 | } else {
59 | return true;
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_compile_nocache.php:
--------------------------------------------------------------------------------
1 | getAttributes($compiler, $args);
38 | $this->openTag($compiler, 'nocache', array($compiler->nocache));
39 | // enter nocache mode
40 | $compiler->nocache = true;
41 | // this tag does not return compiled code
42 | $compiler->has_code = false;
43 | return true;
44 | }
45 | }
46 |
47 | /**
48 | * Smarty Internal Plugin Compile Nocacheclose Class
49 | *
50 | * @package Smarty
51 | * @subpackage Compiler
52 | */
53 | class Smarty_Internal_Compile_Nocacheclose extends Smarty_Internal_CompileBase
54 | {
55 | /**
56 | * Compiles code for the {/nocache} tag
57 | * This tag does not generate compiled output. It only sets a compiler flag.
58 | *
59 | * @param array $args array with attributes from parser
60 | * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
61 | *
62 | * @return bool
63 | */
64 | public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
65 | {
66 | $_attr = $this->getAttributes($compiler, $args);
67 | // leave nocache mode
68 | list($compiler->nocache) = $this->closeTag($compiler, array('nocache'));
69 | // this tag does not return compiled code
70 | $compiler->has_code = false;
71 | return true;
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_compile_parent.php:
--------------------------------------------------------------------------------
1 |
15 | */
16 | class Smarty_Internal_Compile_Parent extends Smarty_Internal_Compile_Child
17 | {
18 | /**
19 | * Tag name
20 | *
21 | * @var string
22 | */
23 | public $tag = 'parent';
24 |
25 | /**
26 | * Block type
27 | *
28 | * @var string
29 | */
30 | public $blockType = 'Parent';
31 | }
32 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_compile_private_function_plugin.php:
--------------------------------------------------------------------------------
1 | getAttributes($compiler, $args);
52 | unset($_attr[ 'nocache' ]);
53 | // convert attributes into parameter array string
54 | $_paramsArray = array();
55 | foreach ($_attr as $_key => $_value) {
56 | if (is_int($_key)) {
57 | $_paramsArray[] = "$_key=>$_value";
58 | } else {
59 | $_paramsArray[] = "'$_key'=>$_value";
60 | }
61 | }
62 | $_params = 'array(' . implode(',', $_paramsArray) . ')';
63 | // compile code
64 | $output = "{$function}({$_params},\$_smarty_tpl)";
65 | if (!empty($parameter[ 'modifierlist' ])) {
66 | $output = $compiler->compileTag(
67 | 'private_modifier',
68 | array(),
69 | array(
70 | 'modifierlist' => $parameter[ 'modifierlist' ],
71 | 'value' => $output
72 | )
73 | );
74 | }
75 | $output = "\n";
76 | return $output;
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_compile_private_object_block_function.php:
--------------------------------------------------------------------------------
1 | $_value) {
33 | if (is_int($_key)) {
34 | $_paramsArray[] = "$_key=>$_value";
35 | } else {
36 | $_paramsArray[] = "'$_key'=>$_value";
37 | }
38 | }
39 | $callback = array("\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]", "->{$method}");
40 | return array($callback, $_paramsArray, "array(\$_block_plugin{$this->nesting}, '{$method}')");
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_compile_rdelim.php:
--------------------------------------------------------------------------------
1 | smarty->right_delimiter;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_compile_setfilter.php:
--------------------------------------------------------------------------------
1 | variable_filter_stack[] = $compiler->variable_filters;
31 | $compiler->variable_filters = $parameter[ 'modifier_list' ];
32 | // this tag does not return compiled code
33 | $compiler->has_code = false;
34 | return true;
35 | }
36 | }
37 |
38 | /**
39 | * Smarty Internal Plugin Compile Setfilterclose Class
40 | *
41 | * @package Smarty
42 | * @subpackage Compiler
43 | */
44 | class Smarty_Internal_Compile_Setfilterclose extends Smarty_Internal_CompileBase
45 | {
46 | /**
47 | * Compiles code for the {/setfilter} tag
48 | * This tag does not generate compiled output. It resets variable filter.
49 | *
50 | * @param array $args array with attributes from parser
51 | * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
52 | *
53 | * @return string compiled code
54 | */
55 | public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
56 | {
57 | $_attr = $this->getAttributes($compiler, $args);
58 | // reset variable filter to previous state
59 | if (count($compiler->variable_filter_stack)) {
60 | $compiler->variable_filters = array_pop($compiler->variable_filter_stack);
61 | } else {
62 | $compiler->variable_filters = array();
63 | }
64 | // this tag does not return compiled code
65 | $compiler->has_code = false;
66 | return true;
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_compile_shared_inheritance.php:
--------------------------------------------------------------------------------
1 | prefixCompiledCode .= "_loadInheritance();\n\$_smarty_tpl->inheritance->init(\$_smarty_tpl, " .
28 | var_export($initChildSequence, true) . ");\n?>\n";
29 | }
30 |
31 | /**
32 | * Register post compile callback to compile inheritance initialization code
33 | *
34 | * @param \Smarty_Internal_TemplateCompilerBase $compiler
35 | * @param bool|false $initChildSequence if true force child template
36 | */
37 | public function registerInit(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false)
38 | {
39 | if ($initChildSequence || !isset($compiler->_cache[ 'inheritanceInit' ])) {
40 | $compiler->registerPostCompileCallback(
41 | array('Smarty_Internal_Compile_Shared_Inheritance', 'postCompile'),
42 | array($initChildSequence),
43 | 'inheritanceInit',
44 | $initChildSequence
45 | );
46 | $compiler->_cache[ 'inheritanceInit' ] = true;
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_addautoloadfilters.php:
--------------------------------------------------------------------------------
1 | _getSmartyObj();
33 | if ($type !== null) {
34 | $this->_checkFilterType($type);
35 | if (!empty($smarty->autoload_filters[ $type ])) {
36 | $smarty->autoload_filters[ $type ] = array_merge($smarty->autoload_filters[ $type ], (array)$filters);
37 | } else {
38 | $smarty->autoload_filters[ $type ] = (array)$filters;
39 | }
40 | } else {
41 | foreach ((array)$filters as $type => $value) {
42 | $this->_checkFilterType($type);
43 | if (!empty($smarty->autoload_filters[ $type ])) {
44 | $smarty->autoload_filters[ $type ] =
45 | array_merge($smarty->autoload_filters[ $type ], (array)$value);
46 | } else {
47 | $smarty->autoload_filters[ $type ] = (array)$value;
48 | }
49 | }
50 | }
51 | return $obj;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_adddefaultmodifiers.php:
--------------------------------------------------------------------------------
1 | _getSmartyObj();
35 | if (is_array($modifiers)) {
36 | $smarty->default_modifiers = array_merge($smarty->default_modifiers, $modifiers);
37 | } else {
38 | $smarty->default_modifiers[] = $modifiers;
39 | }
40 | return $obj;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_append.php:
--------------------------------------------------------------------------------
1 | $_val) {
41 | if ($_key !== '') {
42 | $this->append($data, $_key, $_val, $merge, $nocache);
43 | }
44 | }
45 | } else {
46 | if ($tpl_var !== '' && isset($value)) {
47 | if (!isset($data->tpl_vars[ $tpl_var ])) {
48 | $tpl_var_inst = $data->ext->getTemplateVars->_getVariable($data, $tpl_var, null, true, false);
49 | if ($tpl_var_inst instanceof Smarty_Undefined_Variable) {
50 | $data->tpl_vars[ $tpl_var ] = new Smarty_Variable(null, $nocache);
51 | } else {
52 | $data->tpl_vars[ $tpl_var ] = clone $tpl_var_inst;
53 | }
54 | }
55 | if (!(is_array($data->tpl_vars[ $tpl_var ]->value)
56 | || $data->tpl_vars[ $tpl_var ]->value instanceof ArrayAccess)
57 | ) {
58 | settype($data->tpl_vars[ $tpl_var ]->value, 'array');
59 | }
60 | if ($merge && is_array($value)) {
61 | foreach ($value as $_mkey => $_mval) {
62 | $data->tpl_vars[ $tpl_var ]->value[ $_mkey ] = $_mval;
63 | }
64 | } else {
65 | $data->tpl_vars[ $tpl_var ]->value[] = $value;
66 | }
67 | }
68 | if ($data->_isTplObj() && $data->scope) {
69 | $data->ext->_updateScope->_updateScope($data, $tpl_var);
70 | }
71 | }
72 | return $data;
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_appendbyref.php:
--------------------------------------------------------------------------------
1 | tpl_vars[ $tpl_var ])) {
31 | $data->tpl_vars[ $tpl_var ] = new Smarty_Variable();
32 | }
33 | if (!is_array($data->tpl_vars[ $tpl_var ]->value)) {
34 | settype($data->tpl_vars[ $tpl_var ]->value, 'array');
35 | }
36 | if ($merge && is_array($value)) {
37 | foreach ($value as $_key => $_val) {
38 | $data->tpl_vars[ $tpl_var ]->value[ $_key ] = &$value[ $_key ];
39 | }
40 | } else {
41 | $data->tpl_vars[ $tpl_var ]->value[] = &$value;
42 | }
43 | if ($data->_isTplObj() && $data->scope) {
44 | $data->ext->_updateScope->_updateScope($data, $tpl_var);
45 | }
46 | }
47 | return $data;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_assignbyref.php:
--------------------------------------------------------------------------------
1 | tpl_vars[ $tpl_var ] = new Smarty_Variable(null, $nocache);
29 | $data->tpl_vars[ $tpl_var ]->value = &$value;
30 | if ($data->_isTplObj() && $data->scope) {
31 | $data->ext->_updateScope->_updateScope($data, $tpl_var);
32 | }
33 | }
34 | return $data;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_assignglobal.php:
--------------------------------------------------------------------------------
1 | _isTplObj()) {
38 | $ptr->tpl_vars[ $varName ] = clone Smarty::$global_tpl_vars[ $varName ];
39 | $ptr = $ptr->parent;
40 | }
41 | }
42 | return $data;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_clearallassign.php:
--------------------------------------------------------------------------------
1 | tpl_vars = array();
34 | return $data;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_clearallcache.php:
--------------------------------------------------------------------------------
1 | _clearTemplateCache();
37 | // load cache resource and call clearAll
38 | $_cache_resource = Smarty_CacheResource::load($smarty, $type);
39 | return $_cache_resource->clearAll($smarty, $exp_time);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_clearassign.php:
--------------------------------------------------------------------------------
1 | tpl_vars[ $curr_var ]);
37 | }
38 | } else {
39 | unset($data->tpl_vars[ $tpl_var ]);
40 | }
41 | return $data;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_clearcache.php:
--------------------------------------------------------------------------------
1 | _clearTemplateCache();
46 | // load cache resource and call clear
47 | $_cache_resource = Smarty_CacheResource::load($smarty, $type);
48 | return $_cache_resource->clear($smarty, $template_name, $cache_id, $compile_id, $exp_time);
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_clearconfig.php:
--------------------------------------------------------------------------------
1 | config_vars[ $name ]);
36 | } else {
37 | $data->config_vars = array();
38 | }
39 | return $data;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_compileallconfig.php:
--------------------------------------------------------------------------------
1 | compileAll($smarty, $extension, $force_compile, $time_limit, $max_errors, true);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_createdata.php:
--------------------------------------------------------------------------------
1 | _getSmartyObj();
38 | $dataObj = new Smarty_Data($parent, $smarty, $name);
39 | if ($smarty->debugging) {
40 | Smarty_Internal_Debug::register_data($dataObj);
41 | }
42 | return $dataObj;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_getautoloadfilters.php:
--------------------------------------------------------------------------------
1 | array( 'filter1', 'filter2', … ) ) or array( 'filter1', 'filter2', …) if $type
25 | * was specified
26 | * @throws \SmartyException
27 | */
28 | public function getAutoloadFilters(Smarty_Internal_TemplateBase $obj, $type = null)
29 | {
30 | $smarty = $obj->_getSmartyObj();
31 | if ($type !== null) {
32 | $this->_checkFilterType($type);
33 | return isset($smarty->autoload_filters[ $type ]) ? $smarty->autoload_filters[ $type ] : array();
34 | }
35 | return $smarty->autoload_filters;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_getconfigvariable.php:
--------------------------------------------------------------------------------
1 | ext->configLoad->_getConfigVariable($data, $varName, $errorEnable);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_getconfigvars.php:
--------------------------------------------------------------------------------
1 | config_vars[ $varname ])) {
40 | return $_ptr->config_vars[ $varname ];
41 | }
42 | } else {
43 | $var_array = array_merge($_ptr->config_vars, $var_array);
44 | }
45 | // not found, try at parent
46 | if ($search_parents) {
47 | $_ptr = $_ptr->parent;
48 | } else {
49 | $_ptr = null;
50 | }
51 | }
52 | if (isset($varname)) {
53 | return '';
54 | } else {
55 | return $var_array;
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_getdebugtemplate.php:
--------------------------------------------------------------------------------
1 | _getSmartyObj();
33 | return $smarty->debug_tpl;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_getdefaultmodifiers.php:
--------------------------------------------------------------------------------
1 | _getSmartyObj();
33 | return $smarty->default_modifiers;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_getglobal.php:
--------------------------------------------------------------------------------
1 | value;
36 | } else {
37 | return '';
38 | }
39 | } else {
40 | $_result = array();
41 | foreach (Smarty::$global_tpl_vars as $key => $var) {
42 | $_result[ $key ] = $var->value;
43 | }
44 | return $_result;
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_getregisteredobject.php:
--------------------------------------------------------------------------------
1 | _getSmartyObj();
36 | if (!isset($smarty->registered_objects[ $object_name ])) {
37 | throw new SmartyException("'$object_name' is not a registered object");
38 | }
39 | if (!is_object($smarty->registered_objects[ $object_name ][ 0 ])) {
40 | throw new SmartyException("registered '$object_name' is not an object");
41 | }
42 | return $smarty->registered_objects[ $object_name ][ 0 ];
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_getstreamvariable.php:
--------------------------------------------------------------------------------
1 | smarty) ? $data->smarty : $data;
44 | if ($smarty->error_unassigned) {
45 | throw new SmartyException('Undefined stream variable "' . $variable . '"');
46 | } else {
47 | return null;
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_gettags.php:
--------------------------------------------------------------------------------
1 | _getSmartyObj();
38 | if ($obj->_isTplObj() && !isset($template)) {
39 | $tpl = clone $obj;
40 | } elseif (isset($template) && $template->_isTplObj()) {
41 | $tpl = clone $template;
42 | } elseif (isset($template) && is_string($template)) {
43 | /* @var Smarty_Internal_Template $tpl */
44 | $tpl = new $smarty->template_class($template, $smarty);
45 | // checks if template exists
46 | if (!$tpl->source->exists) {
47 | throw new SmartyException("Unable to load template {$tpl->source->type} '{$tpl->source->name}'");
48 | }
49 | }
50 | if (isset($tpl)) {
51 | $tpl->smarty = clone $tpl->smarty;
52 | $tpl->smarty->_cache[ 'get_used_tags' ] = true;
53 | $tpl->_cache[ 'used_tags' ] = array();
54 | $tpl->smarty->merge_compiled_includes = false;
55 | $tpl->smarty->disableSecurity();
56 | $tpl->caching = Smarty::CACHING_OFF;
57 | $tpl->loadCompiler();
58 | $tpl->compiler->compileTemplate($tpl);
59 | return $tpl->_cache[ 'used_tags' ];
60 | }
61 | throw new SmartyException('Missing template specification');
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_loadfilter.php:
--------------------------------------------------------------------------------
1 | true, 'post' => true, 'output' => true, 'variable' => true);
27 |
28 | /**
29 | * load a filter of specified type and name
30 | *
31 | * @api Smarty::loadFilter()
32 | *
33 | * @link http://www.smarty.net/docs/en/api.load.filter.tpl
34 | *
35 | * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj
36 | * @param string $type filter type
37 | * @param string $name filter name
38 | *
39 | * @return bool
40 | * @throws SmartyException if filter could not be loaded
41 | */
42 | public function loadFilter(Smarty_Internal_TemplateBase $obj, $type, $name)
43 | {
44 | $smarty = $obj->_getSmartyObj();
45 | $this->_checkFilterType($type);
46 | $_plugin = "smarty_{$type}filter_{$name}";
47 | $_filter_name = $_plugin;
48 | if (is_callable($_plugin)) {
49 | $smarty->registered_filters[ $type ][ $_filter_name ] = $_plugin;
50 | return true;
51 | }
52 | if ($smarty->loadPlugin($_plugin)) {
53 | if (class_exists($_plugin, false)) {
54 | $_plugin = array($_plugin, 'execute');
55 | }
56 | if (is_callable($_plugin)) {
57 | $smarty->registered_filters[ $type ][ $_filter_name ] = $_plugin;
58 | return true;
59 | }
60 | }
61 | throw new SmartyException("{$type}filter '{$name}' not found or callable");
62 | }
63 |
64 | /**
65 | * Check if filter type is valid
66 | *
67 | * @param string $type
68 | *
69 | * @throws \SmartyException
70 | */
71 | public function _checkFilterType($type)
72 | {
73 | if (!isset($this->filterTypes[ $type ])) {
74 | throw new SmartyException("Illegal filter type '{$type}'");
75 | }
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_mustcompile.php:
--------------------------------------------------------------------------------
1 | source->exists) {
34 | if ($_template->_isSubTpl()) {
35 | $parent_resource = " in '$_template->parent->template_resource}'";
36 | } else {
37 | $parent_resource = '';
38 | }
39 | throw new SmartyException("Unable to load template {$_template->source->type} '{$_template->source->name}'{$parent_resource}");
40 | }
41 | if ($_template->mustCompile === null) {
42 | $_template->mustCompile = (!$_template->source->handler->uncompiled &&
43 | ($_template->smarty->force_compile || $_template->source->handler->recompiled ||
44 | !$_template->compiled->exists || ($_template->compile_check &&
45 | $_template->compiled->getTimeStamp() <
46 | $_template->source->getTimeStamp())));
47 | }
48 | return $_template->mustCompile;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_registercacheresource.php:
--------------------------------------------------------------------------------
1 | _getSmartyObj();
39 | $smarty->registered_cache_resources[ $name ] = $resource_handler;
40 | return $obj;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_registerclass.php:
--------------------------------------------------------------------------------
1 | _getSmartyObj();
38 | // test if exists
39 | if (!class_exists($class_impl)) {
40 | throw new SmartyException("Undefined class '$class_impl' in register template class");
41 | }
42 | // register the class
43 | $smarty->registered_classes[ $class_name ] = $class_impl;
44 | return $obj;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_registerdefaultconfighandler.php:
--------------------------------------------------------------------------------
1 | _getSmartyObj();
35 | if (is_callable($callback)) {
36 | $smarty->default_config_handler_func = $callback;
37 | } else {
38 | throw new SmartyException('Default config handler not callable');
39 | }
40 | return $obj;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_registerdefaultpluginhandler.php:
--------------------------------------------------------------------------------
1 | _getSmartyObj();
36 | if (is_callable($callback)) {
37 | $smarty->default_plugin_handler_func = $callback;
38 | } else {
39 | throw new SmartyException("Default plugin handler '$callback' not callable");
40 | }
41 | return $obj;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_registerfilter.php:
--------------------------------------------------------------------------------
1 | true, 'post' => true, 'output' => true, 'variable' => true);
27 |
28 | /**
29 | * Registers a filter function
30 | *
31 | * @api Smarty::registerFilter()
32 | *
33 | * @link http://www.smarty.net/docs/en/api.register.filter.tpl
34 | *
35 | * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj
36 | * @param string $type filter type
37 | * @param callback $callback
38 | * @param string|null $name optional filter name
39 | *
40 | * @return \Smarty|\Smarty_Internal_Template
41 | * @throws \SmartyException
42 | */
43 | public function registerFilter(Smarty_Internal_TemplateBase $obj, $type, $callback, $name = null)
44 | {
45 | $smarty = $obj->_getSmartyObj();
46 | $this->_checkFilterType($type);
47 | $name = isset($name) ? $name : $this->_getFilterName($callback);
48 | if (!is_callable($callback)) {
49 | throw new SmartyException("{$type}filter '{$name}' not callable");
50 | }
51 | $smarty->registered_filters[ $type ][ $name ] = $callback;
52 | return $obj;
53 | }
54 |
55 | /**
56 | * Return internal filter name
57 | *
58 | * @param callback $function_name
59 | *
60 | * @return string internal filter name
61 | */
62 | public function _getFilterName($function_name)
63 | {
64 | if (is_array($function_name)) {
65 | $_class_name = (is_object($function_name[ 0 ]) ? get_class($function_name[ 0 ]) : $function_name[ 0 ]);
66 | return $_class_name . '_' . $function_name[ 1 ];
67 | } elseif (is_string($function_name)) {
68 | return $function_name;
69 | } else {
70 | return 'closure';
71 | }
72 | }
73 |
74 | /**
75 | * Check if filter type is valid
76 | *
77 | * @param string $type
78 | *
79 | * @throws \SmartyException
80 | */
81 | public function _checkFilterType($type)
82 | {
83 | if (!isset($this->filterTypes[ $type ])) {
84 | throw new SmartyException("Illegal filter type '{$type}'");
85 | }
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_registerplugin.php:
--------------------------------------------------------------------------------
1 | _getSmartyObj();
47 | if (isset($smarty->registered_plugins[ $type ][ $name ])) {
48 | throw new SmartyException("Plugin tag '{$name}' already registered");
49 | } elseif (!is_callable($callback)) {
50 | throw new SmartyException("Plugin '{$name}' not callable");
51 | } else {
52 | $smarty->registered_plugins[ $type ][ $name ] = array($callback, (bool)$cacheable, (array)$cache_attr);
53 | }
54 | return $obj;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_registerresource.php:
--------------------------------------------------------------------------------
1 | _getSmartyObj();
42 | $smarty->registered_resources[ $name ] =
43 | $resource_handler instanceof Smarty_Resource ? $resource_handler : array($resource_handler, false);
44 | return $obj;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_setautoloadfilters.php:
--------------------------------------------------------------------------------
1 | true, 'post' => true, 'output' => true, 'variable' => true);
27 |
28 | /**
29 | * Set autoload filters
30 | *
31 | * @api Smarty::setAutoloadFilters()
32 | *
33 | * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj
34 | * @param array $filters filters to load automatically
35 | * @param string $type "pre", "output", … specify
36 | * the filter type to set.
37 | * Defaults to none treating
38 | * $filters' keys as the
39 | * appropriate types
40 | *
41 | * @return \Smarty|\Smarty_Internal_Template
42 | * @throws \SmartyException
43 | */
44 | public function setAutoloadFilters(Smarty_Internal_TemplateBase $obj, $filters, $type = null)
45 | {
46 | $smarty = $obj->_getSmartyObj();
47 | if ($type !== null) {
48 | $this->_checkFilterType($type);
49 | $smarty->autoload_filters[ $type ] = (array)$filters;
50 | } else {
51 | foreach ((array)$filters as $type => $value) {
52 | $this->_checkFilterType($type);
53 | }
54 | $smarty->autoload_filters = (array)$filters;
55 | }
56 | return $obj;
57 | }
58 |
59 | /**
60 | * Check if filter type is valid
61 | *
62 | * @param string $type
63 | *
64 | * @throws \SmartyException
65 | */
66 | public function _checkFilterType($type)
67 | {
68 | if (!isset($this->filterTypes[ $type ])) {
69 | throw new SmartyException("Illegal filter type '{$type}'");
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_setdebugtemplate.php:
--------------------------------------------------------------------------------
1 | _getSmartyObj();
35 | if (!is_readable($tpl_name)) {
36 | throw new SmartyException("Unknown file '{$tpl_name}'");
37 | }
38 | $smarty->debug_tpl = $tpl_name;
39 | return $obj;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_setdefaultmodifiers.php:
--------------------------------------------------------------------------------
1 | _getSmartyObj();
35 | $smarty->default_modifiers = (array)$modifiers;
36 | return $obj;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_unloadfilter.php:
--------------------------------------------------------------------------------
1 | _getSmartyObj();
31 | $this->_checkFilterType($type);
32 | if (isset($smarty->registered_filters[ $type ])) {
33 | $_filter_name = "smarty_{$type}filter_{$name}";
34 | if (isset($smarty->registered_filters[ $type ][ $_filter_name ])) {
35 | unset($smarty->registered_filters[ $type ][ $_filter_name ]);
36 | if (empty($smarty->registered_filters[ $type ])) {
37 | unset($smarty->registered_filters[ $type ]);
38 | }
39 | }
40 | }
41 | return $obj;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_unregistercacheresource.php:
--------------------------------------------------------------------------------
1 | _getSmartyObj();
35 | if (isset($smarty->registered_cache_resources[ $name ])) {
36 | unset($smarty->registered_cache_resources[ $name ]);
37 | }
38 | return $obj;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_unregisterfilter.php:
--------------------------------------------------------------------------------
1 | _getSmartyObj();
31 | $this->_checkFilterType($type);
32 | if (isset($smarty->registered_filters[ $type ])) {
33 | $name = is_string($callback) ? $callback : $this->_getFilterName($callback);
34 | if (isset($smarty->registered_filters[ $type ][ $name ])) {
35 | unset($smarty->registered_filters[ $type ][ $name ]);
36 | if (empty($smarty->registered_filters[ $type ])) {
37 | unset($smarty->registered_filters[ $type ]);
38 | }
39 | }
40 | }
41 | return $obj;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_unregisterobject.php:
--------------------------------------------------------------------------------
1 | _getSmartyObj();
35 | if (isset($smarty->registered_objects[ $object_name ])) {
36 | unset($smarty->registered_objects[ $object_name ]);
37 | }
38 | return $obj;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_unregisterplugin.php:
--------------------------------------------------------------------------------
1 | _getSmartyObj();
36 | if (isset($smarty->registered_plugins[ $type ][ $name ])) {
37 | unset($smarty->registered_plugins[ $type ][ $name ]);
38 | }
39 | return $obj;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_method_unregisterresource.php:
--------------------------------------------------------------------------------
1 | _getSmartyObj();
35 | if (isset($smarty->registered_resources[ $type ])) {
36 | unset($smarty->registered_resources[ $type ]);
37 | }
38 | return $obj;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_nocache_insert.php:
--------------------------------------------------------------------------------
1 | assign('{$_assign}' , {$_function} (" . var_export($_attr, true) .
41 | ',\$_smarty_tpl), true);?>';
42 | } else {
43 | $_output .= "echo {$_function}(" . var_export($_attr, true) . ',$_smarty_tpl);?>';
44 | }
45 | $_tpl = $_template;
46 | while ($_tpl->_isSubTpl()) {
47 | $_tpl = $_tpl->parent;
48 | }
49 | return "/*%%SmartyNocache:{$_tpl->compiled->nocache_hash}%%*/{$_output}/*/%%SmartyNocache:{$_tpl->compiled->nocache_hash}%%*/";
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_parsetree.php:
--------------------------------------------------------------------------------
1 | data = null;
48 | $this->subtrees = null;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_parsetree_code.php:
--------------------------------------------------------------------------------
1 | data = $data;
29 | }
30 |
31 | /**
32 | * Return buffer content in parentheses
33 | *
34 | * @param \Smarty_Internal_Templateparser $parser
35 | *
36 | * @return string content
37 | */
38 | public function to_smarty_php(Smarty_Internal_Templateparser $parser)
39 | {
40 | return sprintf('(%s)', $this->data);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_parsetree_dqcontent.php:
--------------------------------------------------------------------------------
1 | data = $data;
29 | }
30 |
31 | /**
32 | * Return content as double quoted string
33 | *
34 | * @param \Smarty_Internal_Templateparser $parser
35 | *
36 | * @return string doubled quoted string
37 | */
38 | public function to_smarty_php(Smarty_Internal_Templateparser $parser)
39 | {
40 | return '"' . $this->data . '"';
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_parsetree_tag.php:
--------------------------------------------------------------------------------
1 | data = $data;
37 | $this->saved_block_nesting = $parser->block_nesting_level;
38 | }
39 |
40 | /**
41 | * Return buffer content
42 | *
43 | * @param \Smarty_Internal_Templateparser $parser
44 | *
45 | * @return string content
46 | */
47 | public function to_smarty_php(Smarty_Internal_Templateparser $parser)
48 | {
49 | return $this->data;
50 | }
51 |
52 | /**
53 | * Return complied code that loads the evaluated output of buffer content into a temporary variable
54 | *
55 | * @param \Smarty_Internal_Templateparser $parser
56 | *
57 | * @return string template code
58 | */
59 | public function assign_to_var(Smarty_Internal_Templateparser $parser)
60 | {
61 | $var = $parser->compiler->getNewPrefixVariable();
62 | $tmp = $parser->compiler->appendCode('', $this->data);
63 | $tmp = $parser->compiler->appendCode($tmp, "");
64 | $parser->compiler->prefix_code[] = sprintf('%s', $tmp);
65 | return $var;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_parsetree_text.php:
--------------------------------------------------------------------------------
1 | data = $data;
27 | }
28 |
29 | /**
30 | * Return buffer content
31 | *
32 | * @param \Smarty_Internal_Templateparser $parser
33 | *
34 | * @return string text
35 | */
36 | public function to_smarty_php(Smarty_Internal_Templateparser $parser)
37 | {
38 | return $this->data;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_resource_eval.php:
--------------------------------------------------------------------------------
1 | uid = $source->filepath = sha1($source->name);
32 | $source->timestamp = $source->exists = true;
33 | }
34 |
35 | /**
36 | * Load template's source from $resource_name into current template object
37 | *
38 | * @uses decode() to decode base64 and urlencoded template_resources
39 | *
40 | * @param Smarty_Template_Source $source source object
41 | *
42 | * @return string template source
43 | */
44 | public function getContent(Smarty_Template_Source $source)
45 | {
46 | return $this->decode($source->name);
47 | }
48 |
49 | /**
50 | * decode base64 and urlencode
51 | *
52 | * @param string $string template_resource to decode
53 | *
54 | * @return string decoded template_resource
55 | */
56 | protected function decode($string)
57 | {
58 | // decode if specified
59 | if (($pos = strpos($string, ':')) !== false) {
60 | if (!strncmp($string, 'base64', 6)) {
61 | return base64_decode(substr($string, 7));
62 | } elseif (!strncmp($string, 'urlencode', 9)) {
63 | return urldecode(substr($string, 10));
64 | }
65 | }
66 | return $string;
67 | }
68 |
69 | /**
70 | * modify resource_name according to resource handlers specifications
71 | *
72 | * @param Smarty $smarty Smarty instance
73 | * @param string $resource_name resource_name to make unique
74 | * @param boolean $isConfig flag for config resource
75 | *
76 | * @return string unique resource name
77 | */
78 | public function buildUniqueResourceName(Smarty $smarty, $resource_name, $isConfig = false)
79 | {
80 | return get_class($this) . '#' . $this->decode($resource_name);
81 | }
82 |
83 | /**
84 | * Determine basename for compiled filename
85 | *
86 | * @param Smarty_Template_Source $source source object
87 | *
88 | * @return string resource's basename
89 | */
90 | public function getBasename(Smarty_Template_Source $source)
91 | {
92 | return '';
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_resource_stream.php:
--------------------------------------------------------------------------------
1 | resource, '://') !== false) {
33 | $source->filepath = $source->resource;
34 | } else {
35 | $source->filepath = str_replace(':', '://', $source->resource);
36 | }
37 | $source->uid = false;
38 | $source->content = $this->getContent($source);
39 | $source->timestamp = $source->exists = !!$source->content;
40 | }
41 |
42 | /**
43 | * Load template's source from stream into current template object
44 | *
45 | * @param Smarty_Template_Source $source source object
46 | *
47 | * @return string template source
48 | */
49 | public function getContent(Smarty_Template_Source $source)
50 | {
51 | $t = '';
52 | // the availability of the stream has already been checked in Smarty_Resource::fetch()
53 | $fp = fopen($source->filepath, 'r+');
54 | if ($fp) {
55 | while (!feof($fp) && ($current_line = fgets($fp)) !== false) {
56 | $t .= $current_line;
57 | }
58 | fclose($fp);
59 | return $t;
60 | } else {
61 | return false;
62 | }
63 | }
64 |
65 | /**
66 | * modify resource_name according to resource handlers specifications
67 | *
68 | * @param Smarty $smarty Smarty instance
69 | * @param string $resource_name resource_name to make unique
70 | * @param boolean $isConfig flag for config resource
71 | *
72 | * @return string unique resource name
73 | */
74 | public function buildUniqueResourceName(Smarty $smarty, $resource_name, $isConfig = false)
75 | {
76 | return get_class($this) . '#' . $resource_name;
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_runtime_cachemodify.php:
--------------------------------------------------------------------------------
1 | isCached() && !$_template->compiled->has_nocache_code;
25 | $_last_modified_date =
26 | @substr($_SERVER[ 'HTTP_IF_MODIFIED_SINCE' ], 0, strpos($_SERVER[ 'HTTP_IF_MODIFIED_SINCE' ], 'GMT') + 3);
27 | if ($_isCached && $cached->timestamp <= strtotime($_last_modified_date)) {
28 | switch (PHP_SAPI) {
29 | case 'cgi': // php-cgi < 5.3
30 | case 'cgi-fcgi': // php-cgi >= 5.3
31 | case 'fpm-fcgi': // php-fpm >= 5.3.3
32 | header('Status: 304 Not Modified');
33 | break;
34 | case 'cli':
35 | if (/* ^phpunit */
36 | !empty($_SERVER[ 'SMARTY_PHPUNIT_DISABLE_HEADERS' ]) /* phpunit$ */
37 | ) {
38 | $_SERVER[ 'SMARTY_PHPUNIT_HEADERS' ][] = '304 Not Modified';
39 | }
40 | break;
41 | default:
42 | if (/* ^phpunit */
43 | !empty($_SERVER[ 'SMARTY_PHPUNIT_DISABLE_HEADERS' ]) /* phpunit$ */
44 | ) {
45 | $_SERVER[ 'SMARTY_PHPUNIT_HEADERS' ][] = '304 Not Modified';
46 | } else {
47 | header($_SERVER[ 'SERVER_PROTOCOL' ] . ' 304 Not Modified');
48 | }
49 | break;
50 | }
51 | } else {
52 | switch (PHP_SAPI) {
53 | case 'cli':
54 | if (/* ^phpunit */
55 | !empty($_SERVER[ 'SMARTY_PHPUNIT_DISABLE_HEADERS' ]) /* phpunit$ */
56 | ) {
57 | $_SERVER[ 'SMARTY_PHPUNIT_HEADERS' ][] =
58 | 'Last-Modified: ' . gmdate('D, d M Y H:i:s', $cached->timestamp) . ' GMT';
59 | }
60 | break;
61 | default:
62 | header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $cached->timestamp) . ' GMT');
63 | break;
64 | }
65 | echo $content;
66 | }
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_runtime_filterhandler.php:
--------------------------------------------------------------------------------
1 | smarty->autoload_filters[ $type ])) {
37 | foreach ((array)$template->smarty->autoload_filters[ $type ] as $name) {
38 | $plugin_name = "Smarty_{$type}filter_{$name}";
39 | if (function_exists($plugin_name)) {
40 | $callback = $plugin_name;
41 | } elseif (class_exists($plugin_name, false) && is_callable(array($plugin_name, 'execute'))) {
42 | $callback = array($plugin_name, 'execute');
43 | } elseif ($template->smarty->loadPlugin($plugin_name, false)) {
44 | if (function_exists($plugin_name)) {
45 | // use loaded Smarty2 style plugin
46 | $callback = $plugin_name;
47 | } elseif (class_exists($plugin_name, false) && is_callable(array($plugin_name, 'execute'))) {
48 | // loaded class of filter plugin
49 | $callback = array($plugin_name, 'execute');
50 | } else {
51 | throw new SmartyException("Auto load {$type}-filter plugin method '{$plugin_name}::execute' not callable");
52 | }
53 | } else {
54 | // nothing found, throw exception
55 | throw new SmartyException("Unable to auto load {$type}-filter plugin '{$plugin_name}'");
56 | }
57 | $content = call_user_func($callback, $content, $template);
58 | }
59 | }
60 | // loop over registered filters of specified type
61 | if (!empty($template->smarty->registered_filters[ $type ])) {
62 | foreach ($template->smarty->registered_filters[ $type ] as $key => $name) {
63 | $content = call_user_func($template->smarty->registered_filters[ $type ][ $key ], $content, $template);
64 | }
65 | }
66 | // return filtered output
67 | return $content;
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_runtime_make_nocache.php:
--------------------------------------------------------------------------------
1 | tpl_vars[ $var ])) {
24 | $export =
25 | preg_replace('/^Smarty_Variable::__set_state[(]|[)]$/', '', var_export($tpl->tpl_vars[ $var ], true));
26 | if (preg_match('/(\w+)::__set_state/', $export, $match)) {
27 | throw new SmartyException("{make_nocache \${$var}} in template '{$tpl->source->name}': variable does contain object '{$match[1]}' not implementing method '__set_state'");
28 | }
29 | echo "/*%%SmartyNocache:{$tpl->compiled->nocache_hash}%%*/smarty->ext->_make_nocache->store(\$_smarty_tpl, '{$var}', ", '\\') .
31 | $export . ");?>\n/*/%%SmartyNocache:{$tpl->compiled->nocache_hash}%%*/";
32 | }
33 | }
34 |
35 | /**
36 | * Store variable value saved while rendering compiled template in cached template context
37 | *
38 | * @param \Smarty_Internal_Template $tpl
39 | * @param string $var variable name
40 | * @param array $properties
41 | */
42 | public function store(Smarty_Internal_Template $tpl, $var, $properties)
43 | {
44 | // do not overwrite existing nocache variables
45 | if (!isset($tpl->tpl_vars[ $var ]) || !$tpl->tpl_vars[ $var ]->nocache) {
46 | $newVar = new Smarty_Variable();
47 | unset($properties[ 'nocache' ]);
48 | foreach ($properties as $k => $v) {
49 | $newVar->$k = $v;
50 | }
51 | $tpl->tpl_vars[ $var ] = $newVar;
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_internal_undefined.php:
--------------------------------------------------------------------------------
1 | class = $class;
29 | }
30 |
31 | /**
32 | * Wrapper for obsolete class Smarty_Internal_Runtime_ValidateCompiled
33 | *
34 | * @param \Smarty_Internal_Template $tpl
35 | * @param array $properties special template properties
36 | * @param bool $cache flag if called from cache file
37 | *
38 | * @return bool false
39 | */
40 | public function decodeProperties(Smarty_Internal_Template $tpl, $properties, $cache = false)
41 | {
42 | if ($cache) {
43 | $tpl->cached->valid = false;
44 | } else {
45 | $tpl->mustCompile = true;
46 | }
47 | return false;
48 | }
49 |
50 | /**
51 | * Call error handler for undefined method
52 | *
53 | * @param string $name unknown method-name
54 | * @param array $args argument array
55 | *
56 | * @return mixed
57 | * @throws SmartyException
58 | */
59 | public function __call($name, $args)
60 | {
61 | if (isset($this->class)) {
62 | throw new SmartyException("undefined extension class '{$this->class}'");
63 | } else {
64 | throw new SmartyException(get_class($args[ 0 ]) . "->{$name}() undefined method");
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_resource_recompiled.php:
--------------------------------------------------------------------------------
1 | compiled;
43 | $compiled->file_dependency = array();
44 | $compiled->includes = array();
45 | $compiled->nocache_hash = null;
46 | $compiled->unifunc = null;
47 | $level = ob_get_level();
48 | ob_start();
49 | $_smarty_tpl->loadCompiler();
50 | // call compiler
51 | try {
52 | eval('?>' . $_smarty_tpl->compiler->compileTemplate($_smarty_tpl));
53 | } catch (Exception $e) {
54 | unset($_smarty_tpl->compiler);
55 | while (ob_get_level() > $level) {
56 | ob_end_clean();
57 | }
58 | throw $e;
59 | }
60 | // release compiler object to free memory
61 | unset($_smarty_tpl->compiler);
62 | ob_get_clean();
63 | $compiled->timestamp = time();
64 | $compiled->exists = true;
65 | }
66 |
67 | /**
68 | * populate Compiled Object with compiled filepath
69 | *
70 | * @param Smarty_Template_Compiled $compiled compiled object
71 | * @param Smarty_Internal_Template $_template template object
72 | *
73 | * @return void
74 | */
75 | public function populateCompiledFilepath(Smarty_Template_Compiled $compiled, Smarty_Internal_Template $_template)
76 | {
77 | $compiled->filepath = false;
78 | $compiled->timestamp = false;
79 | $compiled->exists = false;
80 | }
81 |
82 | /*
83 | * Disable timestamp checks for recompiled resource.
84 | *
85 | * @return bool
86 | */
87 | /**
88 | * @return bool
89 | */
90 | public function checkTimestamps()
91 | {
92 | return false;
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_resource_uncompiled.php:
--------------------------------------------------------------------------------
1 | filepath = $_template->source->filepath;
42 | $compiled->timestamp = $_template->source->timestamp;
43 | $compiled->exists = $_template->source->exists;
44 | if ($_template->smarty->merge_compiled_includes || $_template->source->handler->checkTimestamps()) {
45 | $compiled->file_dependency[ $_template->source->uid ] =
46 | array($compiled->filepath, $compiled->timestamp, $_template->source->type,);
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smarty_undefined_variable.php:
--------------------------------------------------------------------------------
1 | value = $value;
35 | $this->nocache = $nocache;
36 | }
37 |
38 | /**
39 | * <> String conversion
40 | *
41 | * @return string
42 | */
43 | public function __toString()
44 | {
45 | return (string)$this->value;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smartycompilerexception.php:
--------------------------------------------------------------------------------
1 | Smarty Compiler: ' . $this->message . ' <-- ';
16 | }
17 |
18 | /**
19 | * The line number of the template error
20 | *
21 | * @type int|null
22 | */
23 | public $line = null;
24 |
25 | /**
26 | * The template source snippet relating to the error
27 | *
28 | * @type string|null
29 | */
30 | public $source = null;
31 |
32 | /**
33 | * The raw text of the error message
34 | *
35 | * @type string|null
36 | */
37 | public $desc = null;
38 |
39 | /**
40 | * The resource identifier or template name
41 | *
42 | * @type string|null
43 | */
44 | public $template = null;
45 | }
46 |
--------------------------------------------------------------------------------
/smarty/libs/sysplugins/smartyexception.php:
--------------------------------------------------------------------------------
1 | Smarty: ' . (self::$escape ? htmlentities($this->message) : $this->message) . ' <-- ';
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/smarty/templates/default/add.tpl:
--------------------------------------------------------------------------------
1 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |