|
From: mdw c. <myd...@li...> - 2001-09-04 21:30:45
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/templates/default
Modified Files:
main.html
Removed Files:
area_f.html area_h.html area_l.html box_f.html box_h.html
box_l.html controlpanel.html cp_f.html cp_h.html cp_l.html
item_f.html item_h.html item_l.html login.html search.html
Log Message:
*** MAJOR KERNEL MODIFICATIONS ***
The behavior of the templates engine has been enhanced.
Before, we needed to open and read template file each time
we wanted to send HTML output.
Now, with the new function, we are able to read a template file
once, and then access it through memory (thanks to the use of hash tables).
This makes pages to be sent really faster.
Precisely, I've added three functions in the library called
'templates.inc.php' :
* hashtable read_template (string $template_path)
=================================================
this function is to be called whenever you want to
put the content of a template file in a hash.
This the only place where the file is opened !
It returns a hashtable with the content of the file, splitted
according to the blocks defined in the templates.
For example a file like this :
<!-- BLOCK:FOO -->
my text here ~TEXT~
would make a hash like this :
$hash["FOO"] = "my text here ~TEXT~";
* string get_hash_template (string $hash_entry, hashtable $tokens)
==================================================================
returns the content of the string located in a particular
template hash entry with substituing its content with the tokens given.
In fact this function do the same as the old 'get_template' function but
it uses hash instead of opening the template file.
This saves IO time ;)
* void print_template_hash (...)
================================
Do the same as print_template but uses a hashtable instead of opening the file.
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/templates/default/main.html,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- main.html 2001/08/02 19:27:11 1.22
+++ main.html 2001/09/04 21:30:44 1.23
@@ -1,3 +1,4 @@
+<!-- BLOCK:ALL -->
<BASE HREF="~SITE_ROOT~">
<html>
@@ -19,7 +20,7 @@
A:hover {
text-decoration:underline;
- color:#6A749D;
+ color:#0000AA;
}
td,p,li {
@@ -33,7 +34,7 @@
<body bgcolor="#65596D" marginwidth="0" marginheight="0" leftmargin="0" rightmargin="0" topmargin="0"
- alink="#D5DBEF" vlink="#72527A" link="#A68EAC">
+ alink="#DDDDDD" vlink="#000000" link="#0000AA">
<center>~TOPBAR~</center>
|