annotate Smarty/Smarty.class.php @ 29:ae5491d72470

modified: templates/recordedTable.html
author yoneda <epgrec@park.mda.or.jp>
date Sun, 26 Jul 2009 18:38:44 +0900
parents f5a9f0eb4858
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1 <?php
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
2
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
3 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
4 * Project: Smarty: the PHP compiling template engine
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
5 * File: Smarty.class.php
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
6 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
7 * This library is free software; you can redistribute it and/or
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
11 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
12 * This library is distributed in the hope that it will be useful,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
15 * Lesser General Public License for more details.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
16 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
18 * License along with this library; if not, write to the Free Software
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
20 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
21 * For questions, help, comments, discussion, etc., please join the
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
22 * Smarty mailing list. Send a blank e-mail to
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
23 * smarty-discussion-subscribe@googlegroups.com
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
24 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
25 * @link http://www.smarty.net/
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
26 * @copyright 2001-2005 New Digital Group, Inc.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
27 * @author Monte Ohrt <monte at ohrt dot com>
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
28 * @author Andrei Zmievski <andrei@php.net>
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
29 * @package Smarty
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
30 * @version 2.6.25
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
31 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
32
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
33 /* $Id: Smarty.class.php 3149 2009-05-23 20:59:25Z monte.ohrt $ */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
34
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
35 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
36 * DIR_SEP isn't used anymore, but third party apps might
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
37 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
38 if(!defined('DIR_SEP')) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
39 define('DIR_SEP', DIRECTORY_SEPARATOR);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
40 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
41
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
42 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
43 * set SMARTY_DIR to absolute path to Smarty library files.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
44 * if not defined, include_path will be used. Sets SMARTY_DIR only if user
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
45 * application has not already defined it.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
46 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
47
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
48 if (!defined('SMARTY_DIR')) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
49 define('SMARTY_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
50 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
51
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
52 if (!defined('SMARTY_CORE_DIR')) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
53 define('SMARTY_CORE_DIR', SMARTY_DIR . 'internals' . DIRECTORY_SEPARATOR);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
54 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
55
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
56 define('SMARTY_PHP_PASSTHRU', 0);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
57 define('SMARTY_PHP_QUOTE', 1);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
58 define('SMARTY_PHP_REMOVE', 2);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
59 define('SMARTY_PHP_ALLOW', 3);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
60
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
61 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
62 * @package Smarty
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
63 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
64 class Smarty
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
65 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
66 /**#@+
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
67 * Smarty Configuration Section
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
68 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
69
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
70 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
71 * The name of the directory where templates are located.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
72 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
73 * @var string
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
74 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
75 var $template_dir = 'templates';
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
76
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
77 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
78 * The directory where compiled templates are located.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
79 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
80 * @var string
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
81 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
82 var $compile_dir = 'templates_c';
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
83
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
84 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
85 * The directory where config files are located.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
86 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
87 * @var string
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
88 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
89 var $config_dir = 'configs';
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
90
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
91 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
92 * An array of directories searched for plugins.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
93 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
94 * @var array
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
95 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
96 var $plugins_dir = array('plugins');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
97
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
98 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
99 * If debugging is enabled, a debug console window will display
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
100 * when the page loads (make sure your browser allows unrequested
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
101 * popup windows)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
102 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
103 * @var boolean
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
104 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
105 var $debugging = false;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
106
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
107 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
108 * When set, smarty does uses this value as error_reporting-level.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
109 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
110 * @var integer
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
111 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
112 var $error_reporting = null;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
113
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
114 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
115 * This is the path to the debug console template. If not set,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
116 * the default one will be used.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
117 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
118 * @var string
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
119 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
120 var $debug_tpl = '';
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
121
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
122 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
123 * This determines if debugging is enable-able from the browser.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
124 * <ul>
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
125 * <li>NONE => no debugging control allowed</li>
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
126 * <li>URL => enable debugging when SMARTY_DEBUG is found in the URL.</li>
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
127 * </ul>
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
128 * @link http://www.foo.dom/index.php?SMARTY_DEBUG
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
129 * @var string
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
130 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
131 var $debugging_ctrl = 'NONE';
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
132
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
133 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
134 * This tells Smarty whether to check for recompiling or not. Recompiling
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
135 * does not need to happen unless a template or config file is changed.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
136 * Typically you enable this during development, and disable for
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
137 * production.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
138 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
139 * @var boolean
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
140 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
141 var $compile_check = true;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
142
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
143 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
144 * This forces templates to compile every time. Useful for development
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
145 * or debugging.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
146 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
147 * @var boolean
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
148 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
149 var $force_compile = false;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
150
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
151 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
152 * This enables template caching.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
153 * <ul>
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
154 * <li>0 = no caching</li>
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
155 * <li>1 = use class cache_lifetime value</li>
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
156 * <li>2 = use cache_lifetime in cache file</li>
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
157 * </ul>
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
158 * @var integer
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
159 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
160 var $caching = 0;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
161
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
162 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
163 * The name of the directory for cache files.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
164 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
165 * @var string
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
166 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
167 var $cache_dir = 'cache';
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
168
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
169 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
170 * This is the number of seconds cached content will persist.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
171 * <ul>
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
172 * <li>0 = always regenerate cache</li>
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
173 * <li>-1 = never expires</li>
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
174 * </ul>
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
175 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
176 * @var integer
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
177 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
178 var $cache_lifetime = 3600;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
179
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
180 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
181 * Only used when $caching is enabled. If true, then If-Modified-Since headers
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
182 * are respected with cached content, and appropriate HTTP headers are sent.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
183 * This way repeated hits to a cached page do not send the entire page to the
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
184 * client every time.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
185 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
186 * @var boolean
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
187 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
188 var $cache_modified_check = false;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
189
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
190 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
191 * This determines how Smarty handles "<?php ... ?>" tags in templates.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
192 * possible values:
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
193 * <ul>
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
194 * <li>SMARTY_PHP_PASSTHRU -> print tags as plain text</li>
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
195 * <li>SMARTY_PHP_QUOTE -> escape tags as entities</li>
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
196 * <li>SMARTY_PHP_REMOVE -> remove php tags</li>
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
197 * <li>SMARTY_PHP_ALLOW -> execute php tags</li>
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
198 * </ul>
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
199 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
200 * @var integer
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
201 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
202 var $php_handling = SMARTY_PHP_PASSTHRU;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
203
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
204 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
205 * This enables template security. When enabled, many things are restricted
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
206 * in the templates that normally would go unchecked. This is useful when
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
207 * untrusted parties are editing templates and you want a reasonable level
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
208 * of security. (no direct execution of PHP in templates for example)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
209 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
210 * @var boolean
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
211 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
212 var $security = false;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
213
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
214 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
215 * This is the list of template directories that are considered secure. This
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
216 * is used only if {@link $security} is enabled. One directory per array
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
217 * element. {@link $template_dir} is in this list implicitly.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
218 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
219 * @var array
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
220 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
221 var $secure_dir = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
222
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
223 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
224 * These are the security settings for Smarty. They are used only when
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
225 * {@link $security} is enabled.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
226 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
227 * @var array
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
228 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
229 var $security_settings = array(
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
230 'PHP_HANDLING' => false,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
231 'IF_FUNCS' => array('array', 'list',
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
232 'isset', 'empty',
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
233 'count', 'sizeof',
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
234 'in_array', 'is_array',
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
235 'true', 'false', 'null'),
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
236 'INCLUDE_ANY' => false,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
237 'PHP_TAGS' => false,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
238 'MODIFIER_FUNCS' => array('count'),
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
239 'ALLOW_CONSTANTS' => false,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
240 'ALLOW_SUPER_GLOBALS' => true
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
241 );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
242
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
243 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
244 * This is an array of directories where trusted php scripts reside.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
245 * {@link $security} is disabled during their inclusion/execution.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
246 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
247 * @var array
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
248 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
249 var $trusted_dir = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
250
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
251 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
252 * The left delimiter used for the template tags.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
253 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
254 * @var string
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
255 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
256 var $left_delimiter = '{';
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
257
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
258 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
259 * The right delimiter used for the template tags.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
260 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
261 * @var string
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
262 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
263 var $right_delimiter = '}';
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
264
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
265 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
266 * The order in which request variables are registered, similar to
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
267 * variables_order in php.ini E = Environment, G = GET, P = POST,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
268 * C = Cookies, S = Server
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
269 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
270 * @var string
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
271 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
272 var $request_vars_order = 'EGPCS';
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
273
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
274 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
275 * Indicates wether $HTTP_*_VARS[] (request_use_auto_globals=false)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
276 * are uses as request-vars or $_*[]-vars. note: if
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
277 * request_use_auto_globals is true, then $request_vars_order has
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
278 * no effect, but the php-ini-value "gpc_order"
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
279 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
280 * @var boolean
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
281 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
282 var $request_use_auto_globals = true;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
283
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
284 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
285 * Set this if you want different sets of compiled files for the same
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
286 * templates. This is useful for things like different languages.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
287 * Instead of creating separate sets of templates per language, you
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
288 * set different compile_ids like 'en' and 'de'.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
289 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
290 * @var string
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
291 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
292 var $compile_id = null;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
293
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
294 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
295 * This tells Smarty whether or not to use sub dirs in the cache/ and
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
296 * templates_c/ directories. sub directories better organized, but
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
297 * may not work well with PHP safe mode enabled.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
298 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
299 * @var boolean
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
300 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
301 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
302 var $use_sub_dirs = false;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
303
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
304 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
305 * This is a list of the modifiers to apply to all template variables.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
306 * Put each modifier in a separate array element in the order you want
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
307 * them applied. example: <code>array('escape:"htmlall"');</code>
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
308 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
309 * @var array
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
310 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
311 var $default_modifiers = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
312
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
313 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
314 * This is the resource type to be used when not specified
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
315 * at the beginning of the resource path. examples:
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
316 * $smarty->display('file:index.tpl');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
317 * $smarty->display('db:index.tpl');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
318 * $smarty->display('index.tpl'); // will use default resource type
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
319 * {include file="file:index.tpl"}
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
320 * {include file="db:index.tpl"}
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
321 * {include file="index.tpl"} {* will use default resource type *}
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
322 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
323 * @var array
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
324 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
325 var $default_resource_type = 'file';
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
326
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
327 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
328 * The function used for cache file handling. If not set, built-in caching is used.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
329 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
330 * @var null|string function name
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
331 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
332 var $cache_handler_func = null;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
333
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
334 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
335 * This indicates which filters are automatically loaded into Smarty.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
336 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
337 * @var array array of filter names
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
338 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
339 var $autoload_filters = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
340
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
341 /**#@+
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
342 * @var boolean
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
343 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
344 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
345 * This tells if config file vars of the same name overwrite each other or not.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
346 * if disabled, same name variables are accumulated in an array.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
347 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
348 var $config_overwrite = true;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
349
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
350 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
351 * This tells whether or not to automatically booleanize config file variables.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
352 * If enabled, then the strings "on", "true", and "yes" are treated as boolean
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
353 * true, and "off", "false" and "no" are treated as boolean false.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
354 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
355 var $config_booleanize = true;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
356
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
357 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
358 * This tells whether hidden sections [.foobar] are readable from the
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
359 * tempalates or not. Normally you would never allow this since that is
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
360 * the point behind hidden sections: the application can access them, but
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
361 * the templates cannot.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
362 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
363 var $config_read_hidden = false;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
364
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
365 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
366 * This tells whether or not automatically fix newlines in config files.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
367 * It basically converts \r (mac) or \r\n (dos) to \n
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
368 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
369 var $config_fix_newlines = true;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
370 /**#@-*/
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
371
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
372 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
373 * If a template cannot be found, this PHP function will be executed.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
374 * Useful for creating templates on-the-fly or other special action.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
375 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
376 * @var string function name
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
377 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
378 var $default_template_handler_func = '';
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
379
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
380 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
381 * The file that contains the compiler class. This can a full
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
382 * pathname, or relative to the php_include path.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
383 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
384 * @var string
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
385 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
386 var $compiler_file = 'Smarty_Compiler.class.php';
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
387
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
388 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
389 * The class used for compiling templates.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
390 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
391 * @var string
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
392 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
393 var $compiler_class = 'Smarty_Compiler';
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
394
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
395 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
396 * The class used to load config vars.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
397 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
398 * @var string
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
399 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
400 var $config_class = 'Config_File';
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
401
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
402 /**#@+
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
403 * END Smarty Configuration Section
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
404 * There should be no need to touch anything below this line.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
405 * @access private
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
406 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
407 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
408 * where assigned template vars are kept
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
409 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
410 * @var array
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
411 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
412 var $_tpl_vars = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
413
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
414 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
415 * stores run-time $smarty.* vars
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
416 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
417 * @var null|array
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
418 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
419 var $_smarty_vars = null;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
420
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
421 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
422 * keeps track of sections
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
423 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
424 * @var array
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
425 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
426 var $_sections = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
427
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
428 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
429 * keeps track of foreach blocks
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
430 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
431 * @var array
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
432 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
433 var $_foreach = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
434
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
435 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
436 * keeps track of tag hierarchy
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
437 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
438 * @var array
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
439 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
440 var $_tag_stack = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
441
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
442 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
443 * configuration object
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
444 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
445 * @var Config_file
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
446 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
447 var $_conf_obj = null;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
448
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
449 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
450 * loaded configuration settings
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
451 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
452 * @var array
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
453 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
454 var $_config = array(array('vars' => array(), 'files' => array()));
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
455
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
456 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
457 * md5 checksum of the string 'Smarty'
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
458 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
459 * @var string
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
460 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
461 var $_smarty_md5 = 'f8d698aea36fcbead2b9d5359ffca76f';
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
462
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
463 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
464 * Smarty version number
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
465 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
466 * @var string
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
467 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
468 var $_version = '2.6.25';
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
469
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
470 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
471 * current template inclusion depth
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
472 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
473 * @var integer
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
474 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
475 var $_inclusion_depth = 0;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
476
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
477 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
478 * for different compiled templates
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
479 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
480 * @var string
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
481 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
482 var $_compile_id = null;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
483
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
484 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
485 * text in URL to enable debug mode
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
486 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
487 * @var string
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
488 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
489 var $_smarty_debug_id = 'SMARTY_DEBUG';
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
490
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
491 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
492 * debugging information for debug console
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
493 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
494 * @var array
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
495 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
496 var $_smarty_debug_info = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
497
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
498 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
499 * info that makes up a cache file
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
500 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
501 * @var array
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
502 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
503 var $_cache_info = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
504
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
505 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
506 * default file permissions
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
507 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
508 * @var integer
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
509 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
510 var $_file_perms = 0644;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
511
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
512 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
513 * default dir permissions
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
514 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
515 * @var integer
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
516 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
517 var $_dir_perms = 0771;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
518
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
519 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
520 * registered objects
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
521 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
522 * @var array
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
523 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
524 var $_reg_objects = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
525
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
526 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
527 * table keeping track of plugins
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
528 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
529 * @var array
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
530 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
531 var $_plugins = array(
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
532 'modifier' => array(),
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
533 'function' => array(),
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
534 'block' => array(),
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
535 'compiler' => array(),
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
536 'prefilter' => array(),
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
537 'postfilter' => array(),
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
538 'outputfilter' => array(),
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
539 'resource' => array(),
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
540 'insert' => array());
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
541
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
542
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
543 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
544 * cache serials
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
545 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
546 * @var array
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
547 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
548 var $_cache_serials = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
549
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
550 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
551 * name of optional cache include file
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
552 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
553 * @var string
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
554 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
555 var $_cache_include = null;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
556
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
557 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
558 * indicate if the current code is used in a compiled
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
559 * include
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
560 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
561 * @var string
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
562 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
563 var $_cache_including = false;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
564
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
565 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
566 * array of super globals internally
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
567 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
568 * @var array
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
569 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
570 var $_supers = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
571
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
572
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
573 /**#@-*/
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
574 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
575 * The class constructor.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
576 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
577 function Smarty()
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
578 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
579 $this->assign('SCRIPT_NAME', isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME']
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
580 : @$GLOBALS['HTTP_SERVER_VARS']['SCRIPT_NAME']);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
581
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
582 $this->_supers['get'] = $this->request_use_auto_globals ? $_GET : $GLOBALS['HTTP_GET_VARS'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
583 $this->_supers['post'] = $this->request_use_auto_globals ? $_POST : $GLOBALS['HTTP_POST_VARS'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
584 $this->_supers['server'] = $this->request_use_auto_globals ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
585 if(isset($_SESSION))
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
586 $this->_supers['session'] = $this->request_use_auto_globals ? $_SESSION : $GLOBALS['HTTP_SESSION_VARS'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
587 else
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
588 $this->_supers['session'] = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
589 $this->_supers['request'] = $this->request_use_auto_globals ? $_REQUEST : $GLOBALS['HTTP_REQUEST_VARS'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
590 $this->_supers['cookies'] = $this->request_use_auto_globals ? $_COOKIE : $GLOBALS['HTTP_COOKIE_VARS'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
591 $this->_supers['env'] = $this->request_use_auto_globals ? $_ENV : $GLOBALS['HTTP_ENV_VARS'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
592
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
593 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
594
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
595 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
596 * assigns values to template variables
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
597 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
598 * @param array|string $tpl_var the template variable name(s)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
599 * @param mixed $value the value to assign
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
600 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
601 function assign($tpl_var, $value = null)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
602 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
603 if (is_array($tpl_var)){
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
604 foreach ($tpl_var as $key => $val) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
605 if ($key != '') {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
606 $this->_tpl_vars[$key] = $val;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
607 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
608 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
609 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
610 if ($tpl_var != '')
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
611 $this->_tpl_vars[$tpl_var] = $value;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
612 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
613 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
614
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
615 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
616 * assigns values to template variables by reference
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
617 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
618 * @param string $tpl_var the template variable name
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
619 * @param mixed $value the referenced value to assign
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
620 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
621 function assign_by_ref($tpl_var, &$value)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
622 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
623 if ($tpl_var != '')
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
624 $this->_tpl_vars[$tpl_var] = &$value;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
625 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
626
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
627 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
628 * appends values to template variables
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
629 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
630 * @param array|string $tpl_var the template variable name(s)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
631 * @param mixed $value the value to append
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
632 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
633 function append($tpl_var, $value=null, $merge=false)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
634 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
635 if (is_array($tpl_var)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
636 // $tpl_var is an array, ignore $value
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
637 foreach ($tpl_var as $_key => $_val) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
638 if ($_key != '') {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
639 if(!@is_array($this->_tpl_vars[$_key])) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
640 settype($this->_tpl_vars[$_key],'array');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
641 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
642 if($merge && is_array($_val)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
643 foreach($_val as $_mkey => $_mval) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
644 $this->_tpl_vars[$_key][$_mkey] = $_mval;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
645 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
646 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
647 $this->_tpl_vars[$_key][] = $_val;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
648 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
649 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
650 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
651 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
652 if ($tpl_var != '' && isset($value)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
653 if(!@is_array($this->_tpl_vars[$tpl_var])) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
654 settype($this->_tpl_vars[$tpl_var],'array');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
655 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
656 if($merge && is_array($value)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
657 foreach($value as $_mkey => $_mval) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
658 $this->_tpl_vars[$tpl_var][$_mkey] = $_mval;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
659 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
660 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
661 $this->_tpl_vars[$tpl_var][] = $value;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
662 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
663 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
664 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
665 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
666
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
667 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
668 * appends values to template variables by reference
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
669 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
670 * @param string $tpl_var the template variable name
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
671 * @param mixed $value the referenced value to append
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
672 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
673 function append_by_ref($tpl_var, &$value, $merge=false)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
674 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
675 if ($tpl_var != '' && isset($value)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
676 if(!@is_array($this->_tpl_vars[$tpl_var])) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
677 settype($this->_tpl_vars[$tpl_var],'array');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
678 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
679 if ($merge && is_array($value)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
680 foreach($value as $_key => $_val) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
681 $this->_tpl_vars[$tpl_var][$_key] = &$value[$_key];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
682 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
683 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
684 $this->_tpl_vars[$tpl_var][] = &$value;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
685 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
686 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
687 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
688
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
689
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
690 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
691 * clear the given assigned template variable.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
692 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
693 * @param string $tpl_var the template variable to clear
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
694 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
695 function clear_assign($tpl_var)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
696 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
697 if (is_array($tpl_var))
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
698 foreach ($tpl_var as $curr_var)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
699 unset($this->_tpl_vars[$curr_var]);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
700 else
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
701 unset($this->_tpl_vars[$tpl_var]);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
702 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
703
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
704
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
705 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
706 * Registers custom function to be used in templates
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
707 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
708 * @param string $function the name of the template function
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
709 * @param string $function_impl the name of the PHP function to register
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
710 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
711 function register_function($function, $function_impl, $cacheable=true, $cache_attrs=null)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
712 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
713 $this->_plugins['function'][$function] =
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
714 array($function_impl, null, null, false, $cacheable, $cache_attrs);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
715
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
716 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
717
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
718 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
719 * Unregisters custom function
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
720 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
721 * @param string $function name of template function
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
722 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
723 function unregister_function($function)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
724 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
725 unset($this->_plugins['function'][$function]);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
726 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
727
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
728 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
729 * Registers object to be used in templates
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
730 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
731 * @param string $object name of template object
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
732 * @param object &$object_impl the referenced PHP object to register
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
733 * @param null|array $allowed list of allowed methods (empty = all)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
734 * @param boolean $smarty_args smarty argument format, else traditional
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
735 * @param null|array $block_functs list of methods that are block format
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
736 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
737 function register_object($object, &$object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
738 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
739 settype($allowed, 'array');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
740 settype($smarty_args, 'boolean');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
741 $this->_reg_objects[$object] =
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
742 array(&$object_impl, $allowed, $smarty_args, $block_methods);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
743 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
744
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
745 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
746 * Unregisters object
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
747 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
748 * @param string $object name of template object
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
749 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
750 function unregister_object($object)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
751 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
752 unset($this->_reg_objects[$object]);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
753 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
754
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
755
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
756 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
757 * Registers block function to be used in templates
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
758 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
759 * @param string $block name of template block
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
760 * @param string $block_impl PHP function to register
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
761 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
762 function register_block($block, $block_impl, $cacheable=true, $cache_attrs=null)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
763 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
764 $this->_plugins['block'][$block] =
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
765 array($block_impl, null, null, false, $cacheable, $cache_attrs);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
766 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
767
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
768 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
769 * Unregisters block function
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
770 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
771 * @param string $block name of template function
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
772 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
773 function unregister_block($block)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
774 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
775 unset($this->_plugins['block'][$block]);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
776 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
777
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
778 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
779 * Registers compiler function
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
780 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
781 * @param string $function name of template function
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
782 * @param string $function_impl name of PHP function to register
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
783 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
784 function register_compiler_function($function, $function_impl, $cacheable=true)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
785 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
786 $this->_plugins['compiler'][$function] =
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
787 array($function_impl, null, null, false, $cacheable);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
788 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
789
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
790 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
791 * Unregisters compiler function
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
792 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
793 * @param string $function name of template function
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
794 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
795 function unregister_compiler_function($function)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
796 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
797 unset($this->_plugins['compiler'][$function]);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
798 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
799
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
800 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
801 * Registers modifier to be used in templates
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
802 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
803 * @param string $modifier name of template modifier
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
804 * @param string $modifier_impl name of PHP function to register
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
805 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
806 function register_modifier($modifier, $modifier_impl)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
807 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
808 $this->_plugins['modifier'][$modifier] =
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
809 array($modifier_impl, null, null, false);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
810 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
811
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
812 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
813 * Unregisters modifier
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
814 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
815 * @param string $modifier name of template modifier
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
816 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
817 function unregister_modifier($modifier)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
818 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
819 unset($this->_plugins['modifier'][$modifier]);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
820 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
821
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
822 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
823 * Registers a resource to fetch a template
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
824 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
825 * @param string $type name of resource
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
826 * @param array $functions array of functions to handle resource
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
827 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
828 function register_resource($type, $functions)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
829 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
830 if (count($functions)==4) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
831 $this->_plugins['resource'][$type] =
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
832 array($functions, false);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
833
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
834 } elseif (count($functions)==5) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
835 $this->_plugins['resource'][$type] =
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
836 array(array(array(&$functions[0], $functions[1])
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
837 ,array(&$functions[0], $functions[2])
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
838 ,array(&$functions[0], $functions[3])
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
839 ,array(&$functions[0], $functions[4]))
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
840 ,false);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
841
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
842 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
843 $this->trigger_error("malformed function-list for '$type' in register_resource");
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
844
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
845 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
846 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
847
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
848 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
849 * Unregisters a resource
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
850 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
851 * @param string $type name of resource
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
852 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
853 function unregister_resource($type)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
854 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
855 unset($this->_plugins['resource'][$type]);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
856 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
857
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
858 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
859 * Registers a prefilter function to apply
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
860 * to a template before compiling
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
861 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
862 * @param callback $function
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
863 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
864 function register_prefilter($function)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
865 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
866 $this->_plugins['prefilter'][$this->_get_filter_name($function)]
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
867 = array($function, null, null, false);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
868 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
869
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
870 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
871 * Unregisters a prefilter function
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
872 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
873 * @param callback $function
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
874 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
875 function unregister_prefilter($function)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
876 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
877 unset($this->_plugins['prefilter'][$this->_get_filter_name($function)]);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
878 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
879
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
880 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
881 * Registers a postfilter function to apply
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
882 * to a compiled template after compilation
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
883 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
884 * @param callback $function
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
885 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
886 function register_postfilter($function)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
887 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
888 $this->_plugins['postfilter'][$this->_get_filter_name($function)]
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
889 = array($function, null, null, false);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
890 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
891
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
892 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
893 * Unregisters a postfilter function
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
894 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
895 * @param callback $function
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
896 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
897 function unregister_postfilter($function)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
898 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
899 unset($this->_plugins['postfilter'][$this->_get_filter_name($function)]);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
900 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
901
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
902 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
903 * Registers an output filter function to apply
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
904 * to a template output
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
905 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
906 * @param callback $function
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
907 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
908 function register_outputfilter($function)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
909 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
910 $this->_plugins['outputfilter'][$this->_get_filter_name($function)]
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
911 = array($function, null, null, false);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
912 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
913
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
914 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
915 * Unregisters an outputfilter function
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
916 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
917 * @param callback $function
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
918 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
919 function unregister_outputfilter($function)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
920 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
921 unset($this->_plugins['outputfilter'][$this->_get_filter_name($function)]);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
922 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
923
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
924 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
925 * load a filter of specified type and name
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
926 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
927 * @param string $type filter type
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
928 * @param string $name filter name
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
929 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
930 function load_filter($type, $name)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
931 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
932 switch ($type) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
933 case 'output':
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
934 $_params = array('plugins' => array(array($type . 'filter', $name, null, null, false)));
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
935 require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
936 smarty_core_load_plugins($_params, $this);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
937 break;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
938
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
939 case 'pre':
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
940 case 'post':
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
941 if (!isset($this->_plugins[$type . 'filter'][$name]))
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
942 $this->_plugins[$type . 'filter'][$name] = false;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
943 break;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
944 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
945 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
946
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
947 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
948 * clear cached content for the given template and cache id
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
949 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
950 * @param string $tpl_file name of template file
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
951 * @param string $cache_id name of cache_id
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
952 * @param string $compile_id name of compile_id
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
953 * @param string $exp_time expiration time
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
954 * @return boolean
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
955 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
956 function clear_cache($tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
957 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
958
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
959 if (!isset($compile_id))
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
960 $compile_id = $this->compile_id;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
961
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
962 if (!isset($tpl_file))
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
963 $compile_id = null;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
964
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
965 $_auto_id = $this->_get_auto_id($cache_id, $compile_id);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
966
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
967 if (!empty($this->cache_handler_func)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
968 return call_user_func_array($this->cache_handler_func,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
969 array('clear', &$this, &$dummy, $tpl_file, $cache_id, $compile_id, $exp_time));
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
970 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
971 $_params = array('auto_base' => $this->cache_dir,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
972 'auto_source' => $tpl_file,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
973 'auto_id' => $_auto_id,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
974 'exp_time' => $exp_time);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
975 require_once(SMARTY_CORE_DIR . 'core.rm_auto.php');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
976 return smarty_core_rm_auto($_params, $this);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
977 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
978
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
979 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
980
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
981
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
982 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
983 * clear the entire contents of cache (all templates)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
984 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
985 * @param string $exp_time expire time
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
986 * @return boolean results of {@link smarty_core_rm_auto()}
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
987 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
988 function clear_all_cache($exp_time = null)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
989 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
990 return $this->clear_cache(null, null, null, $exp_time);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
991 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
992
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
993
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
994 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
995 * test to see if valid cache exists for this template
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
996 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
997 * @param string $tpl_file name of template file
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
998 * @param string $cache_id
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
999 * @param string $compile_id
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1000 * @return string|false results of {@link _read_cache_file()}
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1001 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1002 function is_cached($tpl_file, $cache_id = null, $compile_id = null)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1003 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1004 if (!$this->caching)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1005 return false;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1006
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1007 if (!isset($compile_id))
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1008 $compile_id = $this->compile_id;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1009
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1010 $_params = array(
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1011 'tpl_file' => $tpl_file,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1012 'cache_id' => $cache_id,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1013 'compile_id' => $compile_id
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1014 );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1015 require_once(SMARTY_CORE_DIR . 'core.read_cache_file.php');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1016 return smarty_core_read_cache_file($_params, $this);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1017 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1018
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1019
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1020 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1021 * clear all the assigned template variables.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1022 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1023 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1024 function clear_all_assign()
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1025 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1026 $this->_tpl_vars = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1027 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1028
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1029 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1030 * clears compiled version of specified template resource,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1031 * or all compiled template files if one is not specified.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1032 * This function is for advanced use only, not normally needed.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1033 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1034 * @param string $tpl_file
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1035 * @param string $compile_id
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1036 * @param string $exp_time
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1037 * @return boolean results of {@link smarty_core_rm_auto()}
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1038 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1039 function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1040 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1041 if (!isset($compile_id)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1042 $compile_id = $this->compile_id;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1043 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1044 $_params = array('auto_base' => $this->compile_dir,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1045 'auto_source' => $tpl_file,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1046 'auto_id' => $compile_id,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1047 'exp_time' => $exp_time,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1048 'extensions' => array('.inc', '.php'));
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1049 require_once(SMARTY_CORE_DIR . 'core.rm_auto.php');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1050 return smarty_core_rm_auto($_params, $this);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1051 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1052
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1053 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1054 * Checks whether requested template exists.
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1055 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1056 * @param string $tpl_file
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1057 * @return boolean
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1058 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1059 function template_exists($tpl_file)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1060 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1061 $_params = array('resource_name' => $tpl_file, 'quiet'=>true, 'get_source'=>false);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1062 return $this->_fetch_resource_info($_params);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1063 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1064
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1065 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1066 * Returns an array containing template variables
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1067 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1068 * @param string $name
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1069 * @param string $type
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1070 * @return array
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1071 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1072 function &get_template_vars($name=null)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1073 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1074 if(!isset($name)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1075 return $this->_tpl_vars;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1076 } elseif(isset($this->_tpl_vars[$name])) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1077 return $this->_tpl_vars[$name];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1078 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1079 // var non-existant, return valid reference
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1080 $_tmp = null;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1081 return $_tmp;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1082 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1083 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1084
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1085 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1086 * Returns an array containing config variables
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1087 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1088 * @param string $name
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1089 * @param string $type
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1090 * @return array
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1091 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1092 function &get_config_vars($name=null)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1093 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1094 if(!isset($name) && is_array($this->_config[0])) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1095 return $this->_config[0]['vars'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1096 } else if(isset($this->_config[0]['vars'][$name])) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1097 return $this->_config[0]['vars'][$name];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1098 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1099 // var non-existant, return valid reference
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1100 $_tmp = null;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1101 return $_tmp;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1102 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1103 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1104
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1105 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1106 * trigger Smarty error
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1107 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1108 * @param string $error_msg
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1109 * @param integer $error_type
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1110 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1111 function trigger_error($error_msg, $error_type = E_USER_WARNING)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1112 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1113 trigger_error("Smarty error: $error_msg", $error_type);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1114 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1115
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1116
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1117 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1118 * executes & displays the template results
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1119 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1120 * @param string $resource_name
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1121 * @param string $cache_id
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1122 * @param string $compile_id
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1123 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1124 function display($resource_name, $cache_id = null, $compile_id = null)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1125 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1126 $this->fetch($resource_name, $cache_id, $compile_id, true);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1127 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1128
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1129 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1130 * executes & returns or displays the template results
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1131 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1132 * @param string $resource_name
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1133 * @param string $cache_id
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1134 * @param string $compile_id
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1135 * @param boolean $display
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1136 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1137 function fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1138 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1139 static $_cache_info = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1140
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1141 $_smarty_old_error_level = $this->debugging ? error_reporting() : error_reporting(isset($this->error_reporting)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1142 ? $this->error_reporting : error_reporting() & ~E_NOTICE);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1143
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1144 if (!$this->debugging && $this->debugging_ctrl == 'URL') {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1145 $_query_string = $this->request_use_auto_globals ? $_SERVER['QUERY_STRING'] : $GLOBALS['HTTP_SERVER_VARS']['QUERY_STRING'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1146 if (@strstr($_query_string, $this->_smarty_debug_id)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1147 if (@strstr($_query_string, $this->_smarty_debug_id . '=on')) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1148 // enable debugging for this browser session
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1149 @setcookie('SMARTY_DEBUG', true);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1150 $this->debugging = true;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1151 } elseif (@strstr($_query_string, $this->_smarty_debug_id . '=off')) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1152 // disable debugging for this browser session
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1153 @setcookie('SMARTY_DEBUG', false);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1154 $this->debugging = false;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1155 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1156 // enable debugging for this page
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1157 $this->debugging = true;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1158 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1159 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1160 $this->debugging = (bool)($this->request_use_auto_globals ? @$_COOKIE['SMARTY_DEBUG'] : @$GLOBALS['HTTP_COOKIE_VARS']['SMARTY_DEBUG']);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1161 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1162 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1163
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1164 if ($this->debugging) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1165 // capture time for debugging info
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1166 $_params = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1167 require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1168 $_debug_start_time = smarty_core_get_microtime($_params, $this);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1169 $this->_smarty_debug_info[] = array('type' => 'template',
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1170 'filename' => $resource_name,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1171 'depth' => 0);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1172 $_included_tpls_idx = count($this->_smarty_debug_info) - 1;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1173 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1174
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1175 if (!isset($compile_id)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1176 $compile_id = $this->compile_id;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1177 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1178
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1179 $this->_compile_id = $compile_id;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1180 $this->_inclusion_depth = 0;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1181
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1182 if ($this->caching) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1183 // save old cache_info, initialize cache_info
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1184 array_push($_cache_info, $this->_cache_info);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1185 $this->_cache_info = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1186 $_params = array(
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1187 'tpl_file' => $resource_name,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1188 'cache_id' => $cache_id,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1189 'compile_id' => $compile_id,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1190 'results' => null
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1191 );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1192 require_once(SMARTY_CORE_DIR . 'core.read_cache_file.php');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1193 if (smarty_core_read_cache_file($_params, $this)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1194 $_smarty_results = $_params['results'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1195 if (!empty($this->_cache_info['insert_tags'])) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1196 $_params = array('plugins' => $this->_cache_info['insert_tags']);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1197 require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1198 smarty_core_load_plugins($_params, $this);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1199 $_params = array('results' => $_smarty_results);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1200 require_once(SMARTY_CORE_DIR . 'core.process_cached_inserts.php');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1201 $_smarty_results = smarty_core_process_cached_inserts($_params, $this);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1202 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1203 if (!empty($this->_cache_info['cache_serials'])) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1204 $_params = array('results' => $_smarty_results);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1205 require_once(SMARTY_CORE_DIR . 'core.process_compiled_include.php');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1206 $_smarty_results = smarty_core_process_compiled_include($_params, $this);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1207 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1208
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1209
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1210 if ($display) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1211 if ($this->debugging)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1212 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1213 // capture time for debugging info
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1214 $_params = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1215 require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1216 $this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = smarty_core_get_microtime($_params, $this) - $_debug_start_time;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1217 require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1218 $_smarty_results .= smarty_core_display_debug_console($_params, $this);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1219 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1220 if ($this->cache_modified_check) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1221 $_server_vars = ($this->request_use_auto_globals) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1222 $_last_modified_date = @substr($_server_vars['HTTP_IF_MODIFIED_SINCE'], 0, strpos($_server_vars['HTTP_IF_MODIFIED_SINCE'], 'GMT') + 3);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1223 $_gmt_mtime = gmdate('D, d M Y H:i:s', $this->_cache_info['timestamp']).' GMT';
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1224 if (@count($this->_cache_info['insert_tags']) == 0
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1225 && !$this->_cache_serials
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1226 && $_gmt_mtime == $_last_modified_date) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1227 if (php_sapi_name()=='cgi')
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1228 header('Status: 304 Not Modified');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1229 else
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1230 header('HTTP/1.1 304 Not Modified');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1231
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1232 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1233 header('Last-Modified: '.$_gmt_mtime);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1234 echo $_smarty_results;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1235 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1236 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1237 echo $_smarty_results;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1238 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1239 error_reporting($_smarty_old_error_level);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1240 // restore initial cache_info
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1241 $this->_cache_info = array_pop($_cache_info);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1242 return true;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1243 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1244 error_reporting($_smarty_old_error_level);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1245 // restore initial cache_info
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1246 $this->_cache_info = array_pop($_cache_info);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1247 return $_smarty_results;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1248 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1249 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1250 $this->_cache_info['template'][$resource_name] = true;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1251 if ($this->cache_modified_check && $display) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1252 header('Last-Modified: '.gmdate('D, d M Y H:i:s', time()).' GMT');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1253 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1254 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1255 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1256
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1257 // load filters that are marked as autoload
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1258 if (count($this->autoload_filters)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1259 foreach ($this->autoload_filters as $_filter_type => $_filters) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1260 foreach ($_filters as $_filter) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1261 $this->load_filter($_filter_type, $_filter);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1262 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1263 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1264 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1265
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1266 $_smarty_compile_path = $this->_get_compile_path($resource_name);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1267
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1268 // if we just need to display the results, don't perform output
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1269 // buffering - for speed
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1270 $_cache_including = $this->_cache_including;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1271 $this->_cache_including = false;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1272 if ($display && !$this->caching && count($this->_plugins['outputfilter']) == 0) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1273 if ($this->_is_compiled($resource_name, $_smarty_compile_path)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1274 || $this->_compile_resource($resource_name, $_smarty_compile_path))
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1275 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1276 include($_smarty_compile_path);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1277 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1278 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1279 ob_start();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1280 if ($this->_is_compiled($resource_name, $_smarty_compile_path)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1281 || $this->_compile_resource($resource_name, $_smarty_compile_path))
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1282 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1283 include($_smarty_compile_path);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1284 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1285 $_smarty_results = ob_get_contents();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1286 ob_end_clean();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1287
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1288 foreach ((array)$this->_plugins['outputfilter'] as $_output_filter) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1289 $_smarty_results = call_user_func_array($_output_filter[0], array($_smarty_results, &$this));
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1290 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1291 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1292
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1293 if ($this->caching) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1294 $_params = array('tpl_file' => $resource_name,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1295 'cache_id' => $cache_id,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1296 'compile_id' => $compile_id,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1297 'results' => $_smarty_results);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1298 require_once(SMARTY_CORE_DIR . 'core.write_cache_file.php');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1299 smarty_core_write_cache_file($_params, $this);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1300 require_once(SMARTY_CORE_DIR . 'core.process_cached_inserts.php');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1301 $_smarty_results = smarty_core_process_cached_inserts($_params, $this);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1302
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1303 if ($this->_cache_serials) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1304 // strip nocache-tags from output
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1305 $_smarty_results = preg_replace('!(\{/?nocache\:[0-9a-f]{32}#\d+\})!s'
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1306 ,''
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1307 ,$_smarty_results);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1308 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1309 // restore initial cache_info
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1310 $this->_cache_info = array_pop($_cache_info);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1311 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1312 $this->_cache_including = $_cache_including;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1313
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1314 if ($display) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1315 if (isset($_smarty_results)) { echo $_smarty_results; }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1316 if ($this->debugging) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1317 // capture time for debugging info
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1318 $_params = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1319 require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1320 $this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = (smarty_core_get_microtime($_params, $this) - $_debug_start_time);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1321 require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1322 echo smarty_core_display_debug_console($_params, $this);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1323 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1324 error_reporting($_smarty_old_error_level);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1325 return;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1326 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1327 error_reporting($_smarty_old_error_level);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1328 if (isset($_smarty_results)) { return $_smarty_results; }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1329 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1330 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1331
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1332 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1333 * load configuration values
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1334 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1335 * @param string $file
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1336 * @param string $section
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1337 * @param string $scope
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1338 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1339 function config_load($file, $section = null, $scope = 'global')
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1340 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1341 require_once($this->_get_plugin_filepath('function', 'config_load'));
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1342 smarty_function_config_load(array('file' => $file, 'section' => $section, 'scope' => $scope), $this);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1343 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1344
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1345 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1346 * return a reference to a registered object
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1347 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1348 * @param string $name
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1349 * @return object
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1350 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1351 function &get_registered_object($name) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1352 if (!isset($this->_reg_objects[$name]))
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1353 $this->_trigger_fatal_error("'$name' is not a registered object");
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1354
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1355 if (!is_object($this->_reg_objects[$name][0]))
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1356 $this->_trigger_fatal_error("registered '$name' is not an object");
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1357
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1358 return $this->_reg_objects[$name][0];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1359 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1360
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1361 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1362 * clear configuration values
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1363 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1364 * @param string $var
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1365 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1366 function clear_config($var = null)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1367 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1368 if(!isset($var)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1369 // clear all values
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1370 $this->_config = array(array('vars' => array(),
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1371 'files' => array()));
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1372 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1373 unset($this->_config[0]['vars'][$var]);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1374 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1375 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1376
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1377 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1378 * get filepath of requested plugin
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1379 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1380 * @param string $type
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1381 * @param string $name
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1382 * @return string|false
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1383 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1384 function _get_plugin_filepath($type, $name)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1385 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1386 $_params = array('type' => $type, 'name' => $name);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1387 require_once(SMARTY_CORE_DIR . 'core.assemble_plugin_filepath.php');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1388 return smarty_core_assemble_plugin_filepath($_params, $this);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1389 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1390
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1391 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1392 * test if resource needs compiling
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1393 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1394 * @param string $resource_name
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1395 * @param string $compile_path
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1396 * @return boolean
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1397 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1398 function _is_compiled($resource_name, $compile_path)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1399 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1400 if (!$this->force_compile && file_exists($compile_path)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1401 if (!$this->compile_check) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1402 // no need to check compiled file
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1403 return true;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1404 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1405 // get file source and timestamp
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1406 $_params = array('resource_name' => $resource_name, 'get_source'=>false);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1407 if (!$this->_fetch_resource_info($_params)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1408 return false;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1409 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1410 if ($_params['resource_timestamp'] <= filemtime($compile_path)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1411 // template not expired, no recompile
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1412 return true;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1413 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1414 // compile template
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1415 return false;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1416 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1417 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1418 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1419 // compiled template does not exist, or forced compile
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1420 return false;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1421 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1422 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1423
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1424 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1425 * compile the template
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1426 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1427 * @param string $resource_name
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1428 * @param string $compile_path
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1429 * @return boolean
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1430 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1431 function _compile_resource($resource_name, $compile_path)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1432 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1433
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1434 $_params = array('resource_name' => $resource_name);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1435 if (!$this->_fetch_resource_info($_params)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1436 return false;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1437 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1438
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1439 $_source_content = $_params['source_content'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1440 $_cache_include = substr($compile_path, 0, -4).'.inc';
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1441
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1442 if ($this->_compile_source($resource_name, $_source_content, $_compiled_content, $_cache_include)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1443 // if a _cache_serial was set, we also have to write an include-file:
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1444 if ($this->_cache_include_info) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1445 require_once(SMARTY_CORE_DIR . 'core.write_compiled_include.php');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1446 smarty_core_write_compiled_include(array_merge($this->_cache_include_info, array('compiled_content'=>$_compiled_content, 'resource_name'=>$resource_name)), $this);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1447 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1448
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1449 $_params = array('compile_path'=>$compile_path, 'compiled_content' => $_compiled_content);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1450 require_once(SMARTY_CORE_DIR . 'core.write_compiled_resource.php');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1451 smarty_core_write_compiled_resource($_params, $this);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1452
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1453 return true;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1454 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1455 return false;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1456 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1457
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1458 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1459
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1460 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1461 * compile the given source
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1462 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1463 * @param string $resource_name
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1464 * @param string $source_content
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1465 * @param string $compiled_content
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1466 * @return boolean
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1467 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1468 function _compile_source($resource_name, &$source_content, &$compiled_content, $cache_include_path=null)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1469 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1470 if (file_exists(SMARTY_DIR . $this->compiler_file)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1471 require_once(SMARTY_DIR . $this->compiler_file);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1472 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1473 // use include_path
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1474 require_once($this->compiler_file);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1475 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1476
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1477
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1478 $smarty_compiler = new $this->compiler_class;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1479
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1480 $smarty_compiler->template_dir = $this->template_dir;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1481 $smarty_compiler->compile_dir = $this->compile_dir;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1482 $smarty_compiler->plugins_dir = $this->plugins_dir;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1483 $smarty_compiler->config_dir = $this->config_dir;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1484 $smarty_compiler->force_compile = $this->force_compile;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1485 $smarty_compiler->caching = $this->caching;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1486 $smarty_compiler->php_handling = $this->php_handling;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1487 $smarty_compiler->left_delimiter = $this->left_delimiter;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1488 $smarty_compiler->right_delimiter = $this->right_delimiter;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1489 $smarty_compiler->_version = $this->_version;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1490 $smarty_compiler->security = $this->security;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1491 $smarty_compiler->secure_dir = $this->secure_dir;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1492 $smarty_compiler->security_settings = $this->security_settings;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1493 $smarty_compiler->trusted_dir = $this->trusted_dir;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1494 $smarty_compiler->use_sub_dirs = $this->use_sub_dirs;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1495 $smarty_compiler->_reg_objects = &$this->_reg_objects;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1496 $smarty_compiler->_plugins = &$this->_plugins;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1497 $smarty_compiler->_tpl_vars = &$this->_tpl_vars;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1498 $smarty_compiler->default_modifiers = $this->default_modifiers;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1499 $smarty_compiler->compile_id = $this->_compile_id;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1500 $smarty_compiler->_config = $this->_config;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1501 $smarty_compiler->request_use_auto_globals = $this->request_use_auto_globals;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1502
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1503 if (isset($cache_include_path) && isset($this->_cache_serials[$cache_include_path])) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1504 $smarty_compiler->_cache_serial = $this->_cache_serials[$cache_include_path];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1505 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1506 $smarty_compiler->_cache_include = $cache_include_path;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1507
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1508
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1509 $_results = $smarty_compiler->_compile_file($resource_name, $source_content, $compiled_content);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1510
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1511 if ($smarty_compiler->_cache_serial) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1512 $this->_cache_include_info = array(
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1513 'cache_serial'=>$smarty_compiler->_cache_serial
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1514 ,'plugins_code'=>$smarty_compiler->_plugins_code
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1515 ,'include_file_path' => $cache_include_path);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1516
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1517 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1518 $this->_cache_include_info = null;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1519
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1520 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1521
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1522 return $_results;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1523 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1524
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1525 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1526 * Get the compile path for this resource
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1527 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1528 * @param string $resource_name
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1529 * @return string results of {@link _get_auto_filename()}
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1530 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1531 function _get_compile_path($resource_name)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1532 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1533 return $this->_get_auto_filename($this->compile_dir, $resource_name,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1534 $this->_compile_id) . '.php';
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1535 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1536
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1537 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1538 * fetch the template info. Gets timestamp, and source
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1539 * if get_source is true
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1540 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1541 * sets $source_content to the source of the template, and
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1542 * $resource_timestamp to its time stamp
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1543 * @param string $resource_name
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1544 * @param string $source_content
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1545 * @param integer $resource_timestamp
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1546 * @param boolean $get_source
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1547 * @param boolean $quiet
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1548 * @return boolean
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1549 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1550
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1551 function _fetch_resource_info(&$params)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1552 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1553 if(!isset($params['get_source'])) { $params['get_source'] = true; }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1554 if(!isset($params['quiet'])) { $params['quiet'] = false; }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1555
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1556 $_return = false;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1557 $_params = array('resource_name' => $params['resource_name']) ;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1558 if (isset($params['resource_base_path']))
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1559 $_params['resource_base_path'] = $params['resource_base_path'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1560 else
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1561 $_params['resource_base_path'] = $this->template_dir;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1562
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1563 if ($this->_parse_resource_name($_params)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1564 $_resource_type = $_params['resource_type'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1565 $_resource_name = $_params['resource_name'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1566 switch ($_resource_type) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1567 case 'file':
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1568 if ($params['get_source']) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1569 $params['source_content'] = $this->_read_file($_resource_name);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1570 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1571 $params['resource_timestamp'] = filemtime($_resource_name);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1572 $_return = is_file($_resource_name) && is_readable($_resource_name);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1573 break;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1574
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1575 default:
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1576 // call resource functions to fetch the template source and timestamp
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1577 if ($params['get_source']) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1578 $_source_return = isset($this->_plugins['resource'][$_resource_type]) &&
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1579 call_user_func_array($this->_plugins['resource'][$_resource_type][0][0],
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1580 array($_resource_name, &$params['source_content'], &$this));
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1581 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1582 $_source_return = true;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1583 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1584
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1585 $_timestamp_return = isset($this->_plugins['resource'][$_resource_type]) &&
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1586 call_user_func_array($this->_plugins['resource'][$_resource_type][0][1],
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1587 array($_resource_name, &$params['resource_timestamp'], &$this));
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1588
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1589 $_return = $_source_return && $_timestamp_return;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1590 break;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1591 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1592 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1593
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1594 if (!$_return) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1595 // see if we can get a template with the default template handler
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1596 if (!empty($this->default_template_handler_func)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1597 if (!is_callable($this->default_template_handler_func)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1598 $this->trigger_error("default template handler function \"$this->default_template_handler_func\" doesn't exist.");
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1599 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1600 $_return = call_user_func_array(
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1601 $this->default_template_handler_func,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1602 array($_params['resource_type'], $_params['resource_name'], &$params['source_content'], &$params['resource_timestamp'], &$this));
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1603 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1604 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1605 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1606
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1607 if (!$_return) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1608 if (!$params['quiet']) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1609 $this->trigger_error('unable to read resource: "' . $params['resource_name'] . '"');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1610 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1611 } else if ($_return && $this->security) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1612 require_once(SMARTY_CORE_DIR . 'core.is_secure.php');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1613 if (!smarty_core_is_secure($_params, $this)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1614 if (!$params['quiet'])
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1615 $this->trigger_error('(secure mode) accessing "' . $params['resource_name'] . '" is not allowed');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1616 $params['source_content'] = null;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1617 $params['resource_timestamp'] = null;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1618 return false;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1619 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1620 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1621 return $_return;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1622 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1623
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1624
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1625 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1626 * parse out the type and name from the resource
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1627 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1628 * @param string $resource_base_path
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1629 * @param string $resource_name
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1630 * @param string $resource_type
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1631 * @param string $resource_name
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1632 * @return boolean
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1633 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1634
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1635 function _parse_resource_name(&$params)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1636 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1637
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1638 // split tpl_path by the first colon
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1639 $_resource_name_parts = explode(':', $params['resource_name'], 2);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1640
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1641 if (count($_resource_name_parts) == 1) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1642 // no resource type given
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1643 $params['resource_type'] = $this->default_resource_type;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1644 $params['resource_name'] = $_resource_name_parts[0];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1645 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1646 if(strlen($_resource_name_parts[0]) == 1) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1647 // 1 char is not resource type, but part of filepath
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1648 $params['resource_type'] = $this->default_resource_type;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1649 $params['resource_name'] = $params['resource_name'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1650 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1651 $params['resource_type'] = $_resource_name_parts[0];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1652 $params['resource_name'] = $_resource_name_parts[1];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1653 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1654 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1655
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1656 if ($params['resource_type'] == 'file') {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1657 if (!preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $params['resource_name'])) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1658 // relative pathname to $params['resource_base_path']
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1659 // use the first directory where the file is found
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1660 foreach ((array)$params['resource_base_path'] as $_curr_path) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1661 $_fullpath = $_curr_path . DIRECTORY_SEPARATOR . $params['resource_name'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1662 if (file_exists($_fullpath) && is_file($_fullpath)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1663 $params['resource_name'] = $_fullpath;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1664 return true;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1665 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1666 // didn't find the file, try include_path
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1667 $_params = array('file_path' => $_fullpath);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1668 require_once(SMARTY_CORE_DIR . 'core.get_include_path.php');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1669 if(smarty_core_get_include_path($_params, $this)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1670 $params['resource_name'] = $_params['new_file_path'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1671 return true;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1672 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1673 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1674 return false;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1675 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1676 /* absolute path */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1677 return file_exists($params['resource_name']);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1678 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1679 } elseif (empty($this->_plugins['resource'][$params['resource_type']])) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1680 $_params = array('type' => $params['resource_type']);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1681 require_once(SMARTY_CORE_DIR . 'core.load_resource_plugin.php');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1682 smarty_core_load_resource_plugin($_params, $this);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1683 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1684
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1685 return true;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1686 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1687
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1688
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1689 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1690 * Handle modifiers
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1691 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1692 * @param string|null $modifier_name
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1693 * @param array|null $map_array
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1694 * @return string result of modifiers
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1695 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1696 function _run_mod_handler()
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1697 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1698 $_args = func_get_args();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1699 list($_modifier_name, $_map_array) = array_splice($_args, 0, 2);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1700 list($_func_name, $_tpl_file, $_tpl_line) =
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1701 $this->_plugins['modifier'][$_modifier_name];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1702
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1703 $_var = $_args[0];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1704 foreach ($_var as $_key => $_val) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1705 $_args[0] = $_val;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1706 $_var[$_key] = call_user_func_array($_func_name, $_args);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1707 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1708 return $_var;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1709 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1710
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1711 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1712 * Remove starting and ending quotes from the string
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1713 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1714 * @param string $string
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1715 * @return string
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1716 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1717 function _dequote($string)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1718 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1719 if ((substr($string, 0, 1) == "'" || substr($string, 0, 1) == '"') &&
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1720 substr($string, -1) == substr($string, 0, 1))
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1721 return substr($string, 1, -1);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1722 else
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1723 return $string;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1724 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1725
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1726
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1727 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1728 * read in a file
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1729 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1730 * @param string $filename
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1731 * @return string
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1732 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1733 function _read_file($filename)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1734 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1735 if ( file_exists($filename) && is_readable($filename) && ($fd = @fopen($filename, 'rb')) ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1736 $contents = '';
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1737 while (!feof($fd)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1738 $contents .= fread($fd, 8192);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1739 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1740 fclose($fd);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1741 return $contents;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1742 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1743 return false;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1744 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1745 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1746
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1747 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1748 * get a concrete filename for automagically created content
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1749 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1750 * @param string $auto_base
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1751 * @param string $auto_source
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1752 * @param string $auto_id
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1753 * @return string
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1754 * @staticvar string|null
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1755 * @staticvar string|null
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1756 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1757 function _get_auto_filename($auto_base, $auto_source = null, $auto_id = null)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1758 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1759 $_compile_dir_sep = $this->use_sub_dirs ? DIRECTORY_SEPARATOR : '^';
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1760 $_return = $auto_base . DIRECTORY_SEPARATOR;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1761
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1762 if(isset($auto_id)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1763 // make auto_id safe for directory names
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1764 $auto_id = str_replace('%7C',$_compile_dir_sep,(urlencode($auto_id)));
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1765 // split into separate directories
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1766 $_return .= $auto_id . $_compile_dir_sep;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1767 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1768
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1769 if(isset($auto_source)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1770 // make source name safe for filename
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1771 $_filename = urlencode(basename($auto_source));
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1772 $_crc32 = sprintf('%08X', crc32($auto_source));
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1773 // prepend %% to avoid name conflicts with
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1774 // with $params['auto_id'] names
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1775 $_crc32 = substr($_crc32, 0, 2) . $_compile_dir_sep .
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1776 substr($_crc32, 0, 3) . $_compile_dir_sep . $_crc32;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1777 $_return .= '%%' . $_crc32 . '%%' . $_filename;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1778 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1779
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1780 return $_return;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1781 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1782
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1783 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1784 * unlink a file, possibly using expiration time
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1785 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1786 * @param string $resource
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1787 * @param integer $exp_time
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1788 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1789 function _unlink($resource, $exp_time = null)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1790 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1791 if(isset($exp_time)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1792 if(time() - @filemtime($resource) >= $exp_time) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1793 return @unlink($resource);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1794 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1795 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1796 return @unlink($resource);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1797 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1798 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1799
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1800 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1801 * returns an auto_id for auto-file-functions
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1802 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1803 * @param string $cache_id
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1804 * @param string $compile_id
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1805 * @return string|null
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1806 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1807 function _get_auto_id($cache_id=null, $compile_id=null) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1808 if (isset($cache_id))
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1809 return (isset($compile_id)) ? $cache_id . '|' . $compile_id : $cache_id;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1810 elseif(isset($compile_id))
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1811 return $compile_id;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1812 else
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1813 return null;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1814 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1815
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1816 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1817 * trigger Smarty plugin error
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1818 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1819 * @param string $error_msg
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1820 * @param string $tpl_file
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1821 * @param integer $tpl_line
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1822 * @param string $file
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1823 * @param integer $line
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1824 * @param integer $error_type
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1825 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1826 function _trigger_fatal_error($error_msg, $tpl_file = null, $tpl_line = null,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1827 $file = null, $line = null, $error_type = E_USER_ERROR)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1828 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1829 if(isset($file) && isset($line)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1830 $info = ' ('.basename($file).", line $line)";
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1831 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1832 $info = '';
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1833 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1834 if (isset($tpl_line) && isset($tpl_file)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1835 $this->trigger_error('[in ' . $tpl_file . ' line ' . $tpl_line . "]: $error_msg$info", $error_type);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1836 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1837 $this->trigger_error($error_msg . $info, $error_type);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1838 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1839 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1840
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1841
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1842 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1843 * callback function for preg_replace, to call a non-cacheable block
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1844 * @return string
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1845 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1846 function _process_compiled_include_callback($match) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1847 $_func = '_smarty_tplfunc_'.$match[2].'_'.$match[3];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1848 ob_start();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1849 $_func($this);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1850 $_ret = ob_get_contents();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1851 ob_end_clean();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1852 return $_ret;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1853 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1854
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1855
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1856 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1857 * called for included templates
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1858 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1859 * @param string $_smarty_include_tpl_file
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1860 * @param string $_smarty_include_vars
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1861 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1862
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1863 // $_smarty_include_tpl_file, $_smarty_include_vars
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1864
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1865 function _smarty_include($params)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1866 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1867 if ($this->debugging) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1868 $_params = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1869 require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1870 $debug_start_time = smarty_core_get_microtime($_params, $this);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1871 $this->_smarty_debug_info[] = array('type' => 'template',
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1872 'filename' => $params['smarty_include_tpl_file'],
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1873 'depth' => ++$this->_inclusion_depth);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1874 $included_tpls_idx = count($this->_smarty_debug_info) - 1;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1875 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1876
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1877 $this->_tpl_vars = array_merge($this->_tpl_vars, $params['smarty_include_vars']);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1878
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1879 // config vars are treated as local, so push a copy of the
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1880 // current ones onto the front of the stack
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1881 array_unshift($this->_config, $this->_config[0]);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1882
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1883 $_smarty_compile_path = $this->_get_compile_path($params['smarty_include_tpl_file']);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1884
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1885
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1886 if ($this->_is_compiled($params['smarty_include_tpl_file'], $_smarty_compile_path)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1887 || $this->_compile_resource($params['smarty_include_tpl_file'], $_smarty_compile_path))
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1888 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1889 include($_smarty_compile_path);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1890 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1891
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1892 // pop the local vars off the front of the stack
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1893 array_shift($this->_config);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1894
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1895 $this->_inclusion_depth--;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1896
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1897 if ($this->debugging) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1898 // capture time for debugging info
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1899 $_params = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1900 require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1901 $this->_smarty_debug_info[$included_tpls_idx]['exec_time'] = smarty_core_get_microtime($_params, $this) - $debug_start_time;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1902 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1903
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1904 if ($this->caching) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1905 $this->_cache_info['template'][$params['smarty_include_tpl_file']] = true;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1906 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1907 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1908
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1909
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1910 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1911 * get or set an array of cached attributes for function that is
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1912 * not cacheable
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1913 * @return array
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1914 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1915 function &_smarty_cache_attrs($cache_serial, $count) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1916 $_cache_attrs =& $this->_cache_info['cache_attrs'][$cache_serial][$count];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1917
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1918 if ($this->_cache_including) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1919 /* return next set of cache_attrs */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1920 $_return = current($_cache_attrs);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1921 next($_cache_attrs);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1922 return $_return;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1923
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1924 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1925 /* add a reference to a new set of cache_attrs */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1926 $_cache_attrs[] = array();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1927 return $_cache_attrs[count($_cache_attrs)-1];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1928
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1929 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1930
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1931 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1932
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1933
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1934 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1935 * wrapper for include() retaining $this
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1936 * @return mixed
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1937 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1938 function _include($filename, $once=false, $params=null)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1939 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1940 if ($once) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1941 return include_once($filename);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1942 } else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1943 return include($filename);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1944 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1945 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1946
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1947
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1948 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1949 * wrapper for eval() retaining $this
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1950 * @return mixed
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1951 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1952 function _eval($code, $params=null)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1953 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1954 return eval($code);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1955 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1956
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1957 /**
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1958 * Extracts the filter name from the given callback
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1959 *
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1960 * @param callback $function
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1961 * @return string
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1962 */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1963 function _get_filter_name($function)
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1964 {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1965 if (is_array($function)) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1966 $_class_name = (is_object($function[0]) ?
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1967 get_class($function[0]) : $function[0]);
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1968 return $_class_name . '_' . $function[1];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1969 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1970 else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1971 return $function;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1972 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1973 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1974
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1975 /**#@-*/
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1976
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1977 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1978
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1979 /* vim: set expandtab: */
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1980
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1981 ?>