update overlib to 3.50, adjust addon code so that the overlib.js file isn't modified

This commit is contained in:
mohrt
2001-08-31 14:25:56 +00:00
parent fde4fb602f
commit 14cee2d567
5 changed files with 1232 additions and 803 deletions

View File

@@ -700,7 +700,9 @@ function smarty_func_assign_debug_info($args, &$smarty_obj) {
function smarty_func_overlib_init($args, &$smarty_obj) { function smarty_func_overlib_init($args, &$smarty_obj) {
// be sure to place overlib.js where Smarty can locate it. // be sure to place overlib.js where Smarty can locate it.
// overlib.js came with the distribution of Smarty. // overlib.js came with the distribution of Smarty.
echo '<DIV ID="overDiv" STYLE="position:absolute; visibility:hidden; z-index:1000;"></DIV>'."\n".'<SCRIPT LANGUAGE=javascript>'."\n".'<!--'."\n";
readfile(SMARTY_DIR."overlib.js",1); readfile(SMARTY_DIR."overlib.js",1);
echo '// -->'."\n".'</SCRIPT>'."\n";
return; return;
} }

View File

@@ -602,7 +602,11 @@ class Smarty
\*======================================================================*/ \*======================================================================*/
function _generate_debug_output() { function _generate_debug_output() {
// we must force compile the debug template in case the environment
// changed between separate applications.
ob_start(); ob_start();
$force_compile_orig = $this->force_compile;
$this->force_compile = true;
if($this->_process_template($this->debug_tpl, $compile_path)) if($this->_process_template($this->debug_tpl, $compile_path))
{ {
if ($this->show_info_include) { if ($this->show_info_include) {
@@ -614,6 +618,7 @@ function _generate_debug_output() {
} }
} }
$results = ob_get_contents(); $results = ob_get_contents();
$this->force_compile = $force_compile_orig;
ob_end_clean(); ob_end_clean();
return $results; return $results;
} }

View File

@@ -56,8 +56,8 @@
pull variables from them into the templates. The list goes on. pull variables from them into the templates. The list goes on.
</para> </para>
<para> <para>
We started out writing out a spec for a template engine about a year We started out writing out a spec for a template engine back in late
ago. After finishing the spec, we began to work on a template engine 1999. After finishing the spec, we began to work on a template engine
written in C that would hopefully be accepted for inclusion with PHP. written in C that would hopefully be accepted for inclusion with PHP.
Not only did we run into many complicated technical barriers, but there Not only did we run into many complicated technical barriers, but there
was also much heated debate about exactly what a template engine should was also much heated debate about exactly what a template engine should
@@ -1530,14 +1530,15 @@ email: zaphod@slartibartfast.com&lt;br&gt;
</para> </para>
</sect2> </sect2>
<sect2> <sect2>
<title>Request Variables</title> <title>{$smarty} reserved variable</title>
<para> <para>
You can access request variables in Smarty via the special variable You can access reserved variables in Smarty via the special
{$smarty}. You can access get, post, cookies, server, env and variable {$smarty}. You can access request variables such as get,
session variables with the syntax in the following examples. post, cookies, server, env and session variables with the syntax in
the following examples.
</para> </para>
<para> <para>
Request variable access was added to Smarty 1.4.4. The special variable {$smarty} was added to Smarty 1.4.4.
</para> </para>
<example> <example>
@@ -1565,6 +1566,20 @@ email: zaphod@slartibartfast.com&lt;br&gt;
{* display the variable "username" from merged get/post/cookies/server/env *} {* display the variable "username" from merged get/post/cookies/server/env *}
{$smarty.request.username} {$smarty.request.username}
</programlisting>
</example>
<para>
The current date can be displayed with {$smarty.now}. This is a unix
timestamp of the current date/time.
</para>
<example>
<title>displaying current date</title>
<programlisting>
{* use the date_formate modifier to format the date *}
{$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}
</programlisting> </programlisting>
</example> </example>
</sect2> </sect2>

View File

@@ -602,7 +602,11 @@ class Smarty
\*======================================================================*/ \*======================================================================*/
function _generate_debug_output() { function _generate_debug_output() {
// we must force compile the debug template in case the environment
// changed between separate applications.
ob_start(); ob_start();
$force_compile_orig = $this->force_compile;
$this->force_compile = true;
if($this->_process_template($this->debug_tpl, $compile_path)) if($this->_process_template($this->debug_tpl, $compile_path))
{ {
if ($this->show_info_include) { if ($this->show_info_include) {
@@ -614,6 +618,7 @@ function _generate_debug_output() {
} }
} }
$results = ob_get_contents(); $results = ob_get_contents();
$this->force_compile = $force_compile_orig;
ob_end_clean(); ob_end_clean();
return $results; return $results;
} }

1424
overlib.js

File diff suppressed because it is too large Load Diff